PipelineTaskDetail.fromJson constructor

PipelineTaskDetail.fromJson(
  1. Object? j
)

Implementation

factory PipelineTaskDetail.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return PipelineTaskDetail(
    taskId: switch (json['taskId']) {
      null => 0,
      Object $1 => decodeInt64($1),
    },
    parentTaskId: switch (json['parentTaskId']) {
      null => 0,
      Object $1 => decodeInt64($1),
    },
    taskName: switch (json['taskName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    startTime: switch (json['startTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    endTime: switch (json['endTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    executorDetail: switch (json['executorDetail']) {
      null => null,
      Object $1 => PipelineTaskExecutorDetail.fromJson($1),
    },
    state: switch (json['state']) {
      null => PipelineTaskDetail_State.$default,
      Object $1 => PipelineTaskDetail_State.fromJson($1),
    },
    execution: switch (json['execution']) {
      null => null,
      Object $1 => Execution.fromJson($1),
    },
    error: switch (json['error']) {
      null => null,
      Object $1 => Status.fromJson($1),
    },
    pipelineTaskStatus: switch (json['pipelineTaskStatus']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) PipelineTaskDetail_PipelineTaskStatus.fromJson(i),
      ],
      _ => throw const FormatException('"pipelineTaskStatus" is not a list'),
    },
    inputs: switch (json['inputs']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): PipelineTaskDetail_ArtifactList.fromJson(
            e.value,
          ),
      },
      _ => throw const FormatException('"inputs" is not an object'),
    },
    outputs: switch (json['outputs']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): PipelineTaskDetail_ArtifactList.fromJson(
            e.value,
          ),
      },
      _ => throw const FormatException('"outputs" is not an object'),
    },
    taskUniqueName: switch (json['taskUniqueName']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}