AutomationExecution.fromJson constructor

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

Implementation

factory AutomationExecution.fromJson(Map<String, dynamic> json) {
  return AutomationExecution(
    associationId: json['AssociationId'] as String?,
    automationExecutionId: json['AutomationExecutionId'] as String?,
    automationExecutionStatus: (json['AutomationExecutionStatus'] as String?)
        ?.toAutomationExecutionStatus(),
    automationSubtype:
        (json['AutomationSubtype'] as String?)?.toAutomationSubtype(),
    changeRequestName: json['ChangeRequestName'] as String?,
    currentAction: json['CurrentAction'] as String?,
    currentStepName: json['CurrentStepName'] as String?,
    documentName: json['DocumentName'] as String?,
    documentVersion: json['DocumentVersion'] as String?,
    executedBy: json['ExecutedBy'] as String?,
    executionEndTime: timeStampFromJson(json['ExecutionEndTime']),
    executionStartTime: timeStampFromJson(json['ExecutionStartTime']),
    failureMessage: json['FailureMessage'] as String?,
    maxConcurrency: json['MaxConcurrency'] as String?,
    maxErrors: json['MaxErrors'] as String?,
    mode: (json['Mode'] as String?)?.toExecutionMode(),
    opsItemId: json['OpsItemId'] as String?,
    outputs: (json['Outputs'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    parameters: (json['Parameters'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    parentAutomationExecutionId:
        json['ParentAutomationExecutionId'] as String?,
    progressCounters: json['ProgressCounters'] != null
        ? ProgressCounters.fromJson(
            json['ProgressCounters'] as Map<String, dynamic>)
        : null,
    resolvedTargets: json['ResolvedTargets'] != null
        ? ResolvedTargets.fromJson(
            json['ResolvedTargets'] as Map<String, dynamic>)
        : null,
    runbooks: (json['Runbooks'] as List?)
        ?.whereNotNull()
        .map((e) => Runbook.fromJson(e as Map<String, dynamic>))
        .toList(),
    scheduledTime: timeStampFromJson(json['ScheduledTime']),
    stepExecutions: (json['StepExecutions'] as List?)
        ?.whereNotNull()
        .map((e) => StepExecution.fromJson(e as Map<String, dynamic>))
        .toList(),
    stepExecutionsTruncated: json['StepExecutionsTruncated'] as bool?,
    target: json['Target'] as String?,
    targetLocations: (json['TargetLocations'] as List?)
        ?.whereNotNull()
        .map((e) => TargetLocation.fromJson(e as Map<String, dynamic>))
        .toList(),
    targetMaps: (json['TargetMaps'] as List?)
        ?.whereNotNull()
        .map((e) => (e as Map<String, dynamic>).map((k, e) => MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())))
        .toList(),
    targetParameterName: json['TargetParameterName'] as String?,
    targets: (json['Targets'] as List?)
        ?.whereNotNull()
        .map((e) => Target.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}