copyWith method

TaskStatusNotificationParams copyWith({
  1. NotificationMetaObject? meta,
  2. String? createdAt,
  3. String? lastUpdatedAt,
  4. int? pollInterval,
  5. TaskStatus? status,
  6. String? statusMessage,
  7. String? taskId,
  8. Object? ttl = absent,
  9. Object? ttlMs = absent,
  10. int? pollIntervalMs,
  11. Map<String, InputRequest>? inputRequests,
  12. Map<String, Object?>? result,
  13. ErrorObject? error,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

TaskStatusNotificationParams copyWith({
  NotificationMetaObject? meta,
  String? createdAt,
  String? lastUpdatedAt,
  int? pollInterval,
  TaskStatus? status,
  String? statusMessage,
  String? taskId,
  Object? ttl = absent,
  Object? ttlMs = absent,
  int? pollIntervalMs,
  Map<String, InputRequest>? inputRequests,
  Map<String, Object?>? result,
  ErrorObject? error,
}) =>
    TaskStatusNotificationParams.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (createdAt != null) 'createdAt': $encode(createdAt),
      if (lastUpdatedAt != null) 'lastUpdatedAt': $encode(lastUpdatedAt),
      if (pollInterval != null) 'pollInterval': $encode(pollInterval),
      if (status != null) 'status': $encode(status),
      if (statusMessage != null) 'statusMessage': $encode(statusMessage),
      if (taskId != null) 'taskId': $encode(taskId),
      if (!identical(ttl, absent)) 'ttl': $encode(ttl),
      if (!identical(ttlMs, absent)) 'ttlMs': $encode(ttlMs),
      if (pollIntervalMs != null) 'pollIntervalMs': $encode(pollIntervalMs),
      if (inputRequests != null) 'inputRequests': $encode(inputRequests),
      if (result != null) 'result': $encode(result),
      if (error != null) 'error': $encode(error),
    });