TuningJob.fromJson constructor

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

Implementation

factory TuningJob.fromJson(Map<String, dynamic> json) {
  return TuningJob(
    baseModel: json['baseModel'],
    preTunedModel: decode(json['preTunedModel'], PreTunedModel.fromJson),
    supervisedTuningSpec: decode(
      json['supervisedTuningSpec'],
      SupervisedTuningSpec.fromJson,
    ),
    distillationSpec: decode(
      json['distillationSpec'],
      DistillationSpec.fromJson,
    ),
    partnerModelTuningSpec: decode(
      json['partnerModelTuningSpec'],
      PartnerModelTuningSpec.fromJson,
    ),
    veoTuningSpec: decode(json['veoTuningSpec'], VeoTuningSpec.fromJson),
    name: json['name'] ?? '',
    tunedModelDisplayName: json['tunedModelDisplayName'] ?? '',
    description: json['description'] ?? '',
    customBaseModel: json['customBaseModel'] ?? '',
    state: decodeEnum(json['state'], JobState.fromJson) ?? JobState.$default,
    createTime: decodeCustom(json['createTime'], protobuf.Timestamp.fromJson),
    startTime: decodeCustom(json['startTime'], protobuf.Timestamp.fromJson),
    endTime: decodeCustom(json['endTime'], protobuf.Timestamp.fromJson),
    updateTime: decodeCustom(json['updateTime'], protobuf.Timestamp.fromJson),
    error: decode(json['error'], Status.fromJson),
    labels: decodeMap(json['labels']) ?? {},
    experiment: json['experiment'] ?? '',
    tunedModel: decode(json['tunedModel'], TunedModel.fromJson),
    tuningDataStats: decode(
      json['tuningDataStats'],
      TuningDataStats.fromJson,
    ),
    pipelineJob: json['pipelineJob'] ?? '',
    encryptionSpec: decode(json['encryptionSpec'], EncryptionSpec.fromJson),
    serviceAccount: json['serviceAccount'] ?? '',
    outputUri: json['outputUri'] ?? '',
    evaluateDatasetRuns:
        decodeListMessage(
          json['evaluateDatasetRuns'],
          EvaluateDatasetRun.fromJson,
        ) ??
        [],
  );
}