TrainingPipeline.fromJson constructor

TrainingPipeline.fromJson(
  1. Object? j
)

Implementation

factory TrainingPipeline.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return TrainingPipeline(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    displayName: switch (json['displayName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    inputDataConfig: switch (json['inputDataConfig']) {
      null => null,
      Object $1 => InputDataConfig.fromJson($1),
    },
    trainingTaskDefinition: switch (json['trainingTaskDefinition']) {
      null => '',
      Object $1 => decodeString($1),
    },
    trainingTaskInputs: switch (json['trainingTaskInputs']) {
      null => null,
      Object $1 => protobuf.Value.fromJson($1),
    },
    trainingTaskMetadata: switch (json['trainingTaskMetadata']) {
      null => null,
      Object $1 => protobuf.Value.fromJson($1),
    },
    modelToUpload: switch (json['modelToUpload']) {
      null => null,
      Object $1 => Model.fromJson($1),
    },
    modelId: switch (json['modelId']) {
      null => '',
      Object $1 => decodeString($1),
    },
    parentModel: switch (json['parentModel']) {
      null => '',
      Object $1 => decodeString($1),
    },
    state: switch (json['state']) {
      null => PipelineState.$default,
      Object $1 => PipelineState.fromJson($1),
    },
    error: switch (json['error']) {
      null => null,
      Object $1 => Status.fromJson($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),
    },
    updateTime: switch (json['updateTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    labels: switch (json['labels']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"labels" is not an object'),
    },
    encryptionSpec: switch (json['encryptionSpec']) {
      null => null,
      Object $1 => EncryptionSpec.fromJson($1),
    },
  );
}