copyWith method

FailedTask copyWith({
  1. String? taskId,
  2. String? statusMessage,
  3. String? createdAt,
  4. String? lastUpdatedAt,
  5. Object? ttlMs = absent,
  6. int? pollIntervalMs,
  7. ErrorObject? error,
})

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

Implementation

FailedTask copyWith({
  String? taskId,
  String? statusMessage,
  String? createdAt,
  String? lastUpdatedAt,
  Object? ttlMs = absent,
  int? pollIntervalMs,
  ErrorObject? error,
}) =>
    FailedTask.fromJson({
      ...toJson(),
      if (taskId != null) 'taskId': $encode(taskId),
      if (statusMessage != null) 'statusMessage': $encode(statusMessage),
      if (createdAt != null) 'createdAt': $encode(createdAt),
      if (lastUpdatedAt != null) 'lastUpdatedAt': $encode(lastUpdatedAt),
      if (!identical(ttlMs, absent)) 'ttlMs': $encode(ttlMs),
      if (pollIntervalMs != null) 'pollIntervalMs': $encode(pollIntervalMs),
      if (error != null) 'error': $encode(error),
    });