copyWith method
A copy with the given properties replaced; everything else, unknown keys included, is kept.
Implementation
Task copyWith({
String? createdAt,
String? lastUpdatedAt,
int? pollInterval,
TaskStatus? status,
String? statusMessage,
String? taskId,
Object? ttl = absent,
Object? ttlMs = absent,
int? pollIntervalMs,
}) =>
Task.fromJson({
...toJson(),
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),
});