JobDefinition.fromJson constructor

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

Implementation

factory JobDefinition.fromJson(Map<String, dynamic> json) {
  return JobDefinition(
    jobDefinitionArn: json['jobDefinitionArn'] as String,
    jobDefinitionName: json['jobDefinitionName'] as String,
    revision: json['revision'] as int,
    type: json['type'] as String,
    containerProperties: json['containerProperties'] != null
        ? ContainerProperties.fromJson(
            json['containerProperties'] 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,
    status: json['status'] as String?,
    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,
  );
}