ModelPackage.fromJson constructor

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

Implementation

factory ModelPackage.fromJson(Map<String, dynamic> json) {
  return ModelPackage(
    approvalDescription: json['ApprovalDescription'] as String?,
    certifyForMarketplace: json['CertifyForMarketplace'] as bool?,
    createdBy: json['CreatedBy'] != null
        ? UserContext.fromJson(json['CreatedBy'] as Map<String, dynamic>)
        : null,
    creationTime: timeStampFromJson(json['CreationTime']),
    inferenceSpecification: json['InferenceSpecification'] != null
        ? InferenceSpecification.fromJson(
            json['InferenceSpecification'] as Map<String, dynamic>)
        : null,
    lastModifiedBy: json['LastModifiedBy'] != null
        ? UserContext.fromJson(json['LastModifiedBy'] as Map<String, dynamic>)
        : null,
    lastModifiedTime: timeStampFromJson(json['LastModifiedTime']),
    metadataProperties: json['MetadataProperties'] != null
        ? MetadataProperties.fromJson(
            json['MetadataProperties'] as Map<String, dynamic>)
        : null,
    modelApprovalStatus:
        (json['ModelApprovalStatus'] as String?)?.toModelApprovalStatus(),
    modelMetrics: json['ModelMetrics'] != null
        ? ModelMetrics.fromJson(json['ModelMetrics'] as Map<String, dynamic>)
        : null,
    modelPackageArn: json['ModelPackageArn'] as String?,
    modelPackageDescription: json['ModelPackageDescription'] as String?,
    modelPackageGroupName: json['ModelPackageGroupName'] as String?,
    modelPackageName: json['ModelPackageName'] as String?,
    modelPackageStatus:
        (json['ModelPackageStatus'] as String?)?.toModelPackageStatus(),
    modelPackageStatusDetails: json['ModelPackageStatusDetails'] != null
        ? ModelPackageStatusDetails.fromJson(
            json['ModelPackageStatusDetails'] as Map<String, dynamic>)
        : null,
    modelPackageVersion: json['ModelPackageVersion'] as int?,
    sourceAlgorithmSpecification: json['SourceAlgorithmSpecification'] != null
        ? SourceAlgorithmSpecification.fromJson(
            json['SourceAlgorithmSpecification'] as Map<String, dynamic>)
        : null,
    tags: (json['Tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
    validationSpecification: json['ValidationSpecification'] != null
        ? ModelPackageValidationSpecification.fromJson(
            json['ValidationSpecification'] as Map<String, dynamic>)
        : null,
  );
}