JobDetail.fromJson constructor

JobDetail.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory JobDetail.fromJson(Map<String, dynamic> json) {
  return JobDetail(
    jobDefinition: json['jobDefinition'] as String,
    jobId: json['jobId'] as String,
    jobName: json['jobName'] as String,
    jobQueue: json['jobQueue'] as String,
    startedAt: json['startedAt'] as int,
    status: (json['status'] as String).toJobStatus(),
    arrayProperties: json['arrayProperties'] != null
        ? ArrayPropertiesDetail.fromJson(
            json['arrayProperties'] as Map<String, dynamic>)
        : null,
    attempts: (json['attempts'] as List?)
        ?.whereNotNull()
        .map((e) => AttemptDetail.fromJson(e as Map<String, dynamic>))
        .toList(),
    container: json['container'] != null
        ? ContainerDetail.fromJson(json['container'] as Map<String, dynamic>)
        : null,
    createdAt: json['createdAt'] as int?,
    dependsOn: (json['dependsOn'] as List?)
        ?.whereNotNull()
        .map((e) => JobDependency.fromJson(e as Map<String, dynamic>))
        .toList(),
    jobArn: json['jobArn'] as String?,
    nodeDetails: json['nodeDetails'] != null
        ? NodeDetails.fromJson(json['nodeDetails'] as Map<String, dynamic>)
        : null,
    nodeProperties: json['nodeProperties'] != null
        ? NodeProperties.fromJson(
            json['nodeProperties'] as Map<String, dynamic>)
        : null,
    parameters: (json['parameters'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    platformCapabilities: (json['platformCapabilities'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toPlatformCapability())
        .toList(),
    propagateTags: json['propagateTags'] as bool?,
    retryStrategy: json['retryStrategy'] != null
        ? RetryStrategy.fromJson(
            json['retryStrategy'] as Map<String, dynamic>)
        : null,
    statusReason: json['statusReason'] as String?,
    stoppedAt: json['stoppedAt'] as int?,
    tags: (json['tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    timeout: json['timeout'] != null
        ? JobTimeout.fromJson(json['timeout'] as Map<String, dynamic>)
        : null,
  );
}