Job.fromJson constructor
Implementation
factory Job.fromJson(Map<String, dynamic> json) {
return Job(
role: json['role'] as String,
settings: JobSettings.fromJson(json['settings'] as Map<String, dynamic>),
accelerationSettings: json['accelerationSettings'] != null
? AccelerationSettings.fromJson(
json['accelerationSettings'] as Map<String, dynamic>)
: null,
accelerationStatus:
(json['accelerationStatus'] as String?)?.toAccelerationStatus(),
arn: json['arn'] as String?,
billingTagsSource:
(json['billingTagsSource'] as String?)?.toBillingTagsSource(),
createdAt: timeStampFromJson(json['createdAt']),
currentPhase: (json['currentPhase'] as String?)?.toJobPhase(),
errorCode: json['errorCode'] as int?,
errorMessage: json['errorMessage'] as String?,
hopDestinations: (json['hopDestinations'] as List?)
?.whereNotNull()
.map((e) => HopDestination.fromJson(e as Map<String, dynamic>))
.toList(),
id: json['id'] as String?,
jobPercentComplete: json['jobPercentComplete'] as int?,
jobTemplate: json['jobTemplate'] as String?,
messages: json['messages'] != null
? JobMessages.fromJson(json['messages'] as Map<String, dynamic>)
: null,
outputGroupDetails: (json['outputGroupDetails'] as List?)
?.whereNotNull()
.map((e) => OutputGroupDetail.fromJson(e as Map<String, dynamic>))
.toList(),
priority: json['priority'] as int?,
queue: json['queue'] as String?,
queueTransitions: (json['queueTransitions'] as List?)
?.whereNotNull()
.map((e) => QueueTransition.fromJson(e as Map<String, dynamic>))
.toList(),
retryCount: json['retryCount'] as int?,
simulateReservedQueue:
(json['simulateReservedQueue'] as String?)?.toSimulateReservedQueue(),
status: (json['status'] as String?)?.toJobStatus(),
statusUpdateInterval:
(json['statusUpdateInterval'] as String?)?.toStatusUpdateInterval(),
timing: json['timing'] != null
? Timing.fromJson(json['timing'] as Map<String, dynamic>)
: null,
userMetadata: (json['userMetadata'] as Map<String, dynamic>?)
?.map((k, e) => MapEntry(k, e as String)),
);
}