StepExecution.fromJson constructor

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

Implementation

factory StepExecution.fromJson(Map<String, dynamic> json) {
  return StepExecution(
    action: json['Action'] as String?,
    executionEndTime: timeStampFromJson(json['ExecutionEndTime']),
    executionStartTime: timeStampFromJson(json['ExecutionStartTime']),
    failureDetails: json['FailureDetails'] != null
        ? FailureDetails.fromJson(
            json['FailureDetails'] as Map<String, dynamic>)
        : null,
    failureMessage: json['FailureMessage'] as String?,
    inputs: (json['Inputs'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    isCritical: json['IsCritical'] as bool?,
    isEnd: json['IsEnd'] as bool?,
    maxAttempts: json['MaxAttempts'] as int?,
    nextStep: json['NextStep'] as String?,
    onFailure: json['OnFailure'] as String?,
    outputs: (json['Outputs'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    overriddenParameters: (json['OverriddenParameters']
            as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    response: json['Response'] as String?,
    responseCode: json['ResponseCode'] as String?,
    stepExecutionId: json['StepExecutionId'] as String?,
    stepName: json['StepName'] as String?,
    stepStatus:
        (json['StepStatus'] as String?)?.toAutomationExecutionStatus(),
    targetLocation: json['TargetLocation'] != null
        ? TargetLocation.fromJson(
            json['TargetLocation'] as Map<String, dynamic>)
        : null,
    targets: (json['Targets'] as List?)
        ?.whereNotNull()
        .map((e) => Target.fromJson(e as Map<String, dynamic>))
        .toList(),
    timeoutSeconds: json['TimeoutSeconds'] as int?,
    validNextSteps: (json['ValidNextSteps'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
  );
}