All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.UpdateModelPackageRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

There is a newer version: 2.31.2
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.sagemaker.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateModelPackageRequest extends SageMakerRequest implements
        ToCopyableBuilder {
    private static final SdkField MODEL_PACKAGE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ModelPackageArn").getter(getter(UpdateModelPackageRequest::modelPackageArn))
            .setter(setter(Builder::modelPackageArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelPackageArn").build()).build();

    private static final SdkField MODEL_APPROVAL_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ModelApprovalStatus").getter(getter(UpdateModelPackageRequest::modelApprovalStatusAsString))
            .setter(setter(Builder::modelApprovalStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelApprovalStatus").build())
            .build();

    private static final SdkField APPROVAL_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ApprovalDescription").getter(getter(UpdateModelPackageRequest::approvalDescription))
            .setter(setter(Builder::approvalDescription))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApprovalDescription").build())
            .build();

    private static final SdkField> CUSTOMER_METADATA_PROPERTIES_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("CustomerMetadataProperties")
            .getter(getter(UpdateModelPackageRequest::customerMetadataProperties))
            .setter(setter(Builder::customerMetadataProperties))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomerMetadataProperties").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField> CUSTOMER_METADATA_PROPERTIES_TO_REMOVE_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("CustomerMetadataPropertiesToRemove")
            .getter(getter(UpdateModelPackageRequest::customerMetadataPropertiesToRemove))
            .setter(setter(Builder::customerMetadataPropertiesToRemove))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomerMetadataPropertiesToRemove")
                    .build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> ADDITIONAL_INFERENCE_SPECIFICATIONS_TO_ADD_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("AdditionalInferenceSpecificationsToAdd")
            .getter(getter(UpdateModelPackageRequest::additionalInferenceSpecificationsToAdd))
            .setter(setter(Builder::additionalInferenceSpecificationsToAdd))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                    .locationName("AdditionalInferenceSpecificationsToAdd").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(AdditionalInferenceSpecificationDefinition::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField INFERENCE_SPECIFICATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("InferenceSpecification")
            .getter(getter(UpdateModelPackageRequest::inferenceSpecification)).setter(setter(Builder::inferenceSpecification))
            .constructor(InferenceSpecification::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InferenceSpecification").build())
            .build();

    private static final SdkField SOURCE_URI_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("SourceUri").getter(getter(UpdateModelPackageRequest::sourceUri)).setter(setter(Builder::sourceUri))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceUri").build()).build();

    private static final SdkField MODEL_CARD_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ModelCard")
            .getter(getter(UpdateModelPackageRequest::modelCard)).setter(setter(Builder::modelCard))
            .constructor(ModelPackageModelCard::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelCard").build()).build();

    private static final SdkField MODEL_LIFE_CYCLE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ModelLifeCycle")
            .getter(getter(UpdateModelPackageRequest::modelLifeCycle)).setter(setter(Builder::modelLifeCycle))
            .constructor(ModelLifeCycle::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelLifeCycle").build()).build();

    private static final SdkField CLIENT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ClientToken").getter(getter(UpdateModelPackageRequest::clientToken))
            .setter(setter(Builder::clientToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientToken").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MODEL_PACKAGE_ARN_FIELD,
            MODEL_APPROVAL_STATUS_FIELD, APPROVAL_DESCRIPTION_FIELD, CUSTOMER_METADATA_PROPERTIES_FIELD,
            CUSTOMER_METADATA_PROPERTIES_TO_REMOVE_FIELD, ADDITIONAL_INFERENCE_SPECIFICATIONS_TO_ADD_FIELD,
            INFERENCE_SPECIFICATION_FIELD, SOURCE_URI_FIELD, MODEL_CARD_FIELD, MODEL_LIFE_CYCLE_FIELD, CLIENT_TOKEN_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();

    private final String modelPackageArn;

    private final String modelApprovalStatus;

    private final String approvalDescription;

    private final Map customerMetadataProperties;

    private final List customerMetadataPropertiesToRemove;

    private final List additionalInferenceSpecificationsToAdd;

    private final InferenceSpecification inferenceSpecification;

    private final String sourceUri;

    private final ModelPackageModelCard modelCard;

    private final ModelLifeCycle modelLifeCycle;

    private final String clientToken;

    private UpdateModelPackageRequest(BuilderImpl builder) {
        super(builder);
        this.modelPackageArn = builder.modelPackageArn;
        this.modelApprovalStatus = builder.modelApprovalStatus;
        this.approvalDescription = builder.approvalDescription;
        this.customerMetadataProperties = builder.customerMetadataProperties;
        this.customerMetadataPropertiesToRemove = builder.customerMetadataPropertiesToRemove;
        this.additionalInferenceSpecificationsToAdd = builder.additionalInferenceSpecificationsToAdd;
        this.inferenceSpecification = builder.inferenceSpecification;
        this.sourceUri = builder.sourceUri;
        this.modelCard = builder.modelCard;
        this.modelLifeCycle = builder.modelLifeCycle;
        this.clientToken = builder.clientToken;
    }

    /**
     * 

* The Amazon Resource Name (ARN) of the model package. *

* * @return The Amazon Resource Name (ARN) of the model package. */ public final String modelPackageArn() { return modelPackageArn; } /** *

* The approval status of the model. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #modelApprovalStatus} will return {@link ModelApprovalStatus#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #modelApprovalStatusAsString}. *

* * @return The approval status of the model. * @see ModelApprovalStatus */ public final ModelApprovalStatus modelApprovalStatus() { return ModelApprovalStatus.fromValue(modelApprovalStatus); } /** *

* The approval status of the model. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #modelApprovalStatus} will return {@link ModelApprovalStatus#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #modelApprovalStatusAsString}. *

* * @return The approval status of the model. * @see ModelApprovalStatus */ public final String modelApprovalStatusAsString() { return modelApprovalStatus; } /** *

* A description for the approval status of the model. *

* * @return A description for the approval status of the model. */ public final String approvalDescription() { return approvalDescription; } /** * For responses, this returns true if the service returned a value for the CustomerMetadataProperties property. * This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasCustomerMetadataProperties() { return customerMetadataProperties != null && !(customerMetadataProperties instanceof SdkAutoConstructMap); } /** *

* The metadata properties associated with the model package versions. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasCustomerMetadataProperties} method. *

* * @return The metadata properties associated with the model package versions. */ public final Map customerMetadataProperties() { return customerMetadataProperties; } /** * For responses, this returns true if the service returned a value for the CustomerMetadataPropertiesToRemove * property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} * method on the property). This is useful because the SDK will never return a null collection or map, but you may * need to differentiate between the service returning nothing (or null) and the service returning an empty * collection or map. For requests, this returns true if a value for the property was specified in the request * builder, and false if a value was not specified. */ public final boolean hasCustomerMetadataPropertiesToRemove() { return customerMetadataPropertiesToRemove != null && !(customerMetadataPropertiesToRemove instanceof SdkAutoConstructList); } /** *

* The metadata properties associated with the model package versions to remove. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasCustomerMetadataPropertiesToRemove} * method. *

* * @return The metadata properties associated with the model package versions to remove. */ public final List customerMetadataPropertiesToRemove() { return customerMetadataPropertiesToRemove; } /** * For responses, this returns true if the service returned a value for the AdditionalInferenceSpecificationsToAdd * property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} * method on the property). This is useful because the SDK will never return a null collection or map, but you may * need to differentiate between the service returning nothing (or null) and the service returning an empty * collection or map. For requests, this returns true if a value for the property was specified in the request * builder, and false if a value was not specified. */ public final boolean hasAdditionalInferenceSpecificationsToAdd() { return additionalInferenceSpecificationsToAdd != null && !(additionalInferenceSpecificationsToAdd instanceof SdkAutoConstructList); } /** *

* An array of additional Inference Specification objects to be added to the existing array additional Inference * Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference * Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally * used with SageMaker Neo to store the compiled artifacts. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAdditionalInferenceSpecificationsToAdd} * method. *

* * @return An array of additional Inference Specification objects to be added to the existing array additional * Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each * additional Inference Specification specifies artifacts based on this model package that can be used on * inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts. */ public final List additionalInferenceSpecificationsToAdd() { return additionalInferenceSpecificationsToAdd; } /** *

* Specifies details about inference jobs that you can run with models based on this model package, including the * following information: *

*
    *
  • *

    * The Amazon ECR paths of containers that contain the inference code and model artifacts. *

    *
  • *
  • *

    * The instance types that the model package supports for transform jobs and real-time endpoints used for inference. *

    *
  • *
  • *

    * The input and output content formats that the model package supports for inference. *

    *
  • *
* * @return Specifies details about inference jobs that you can run with models based on this model package, * including the following information:

*
    *
  • *

    * The Amazon ECR paths of containers that contain the inference code and model artifacts. *

    *
  • *
  • *

    * The instance types that the model package supports for transform jobs and real-time endpoints used for * inference. *

    *
  • *
  • *

    * The input and output content formats that the model package supports for inference. *

    *
  • */ public final InferenceSpecification inferenceSpecification() { return inferenceSpecification; } /** *

    * The URI of the source for the model package. *

    * * @return The URI of the source for the model package. */ public final String sourceUri() { return sourceUri; } /** *

    * The model card associated with the model package. Since ModelPackageModelCard is tied to a model * package, it is a specific usage of a model card and its schema is simplified compared to the schema of * ModelCard. The ModelPackageModelCard schema does not include * model_package_details, and model_overview is composed of the model_creator * and model_artifact properties. For more information about the model package model card schema, see * Model * package model card schema. For more information about the model card associated with the model package, see * View the Details of a Model * Version. *

    * * @return The model card associated with the model package. Since ModelPackageModelCard is tied to a * model package, it is a specific usage of a model card and its schema is simplified compared to the schema * of ModelCard. The ModelPackageModelCard schema does not include * model_package_details, and model_overview is composed of the * model_creator and model_artifact properties. For more information about the * model package model card schema, see Model package model card schema. For more information about the model card associated with the model * package, see View * the Details of a Model Version. */ public final ModelPackageModelCard modelCard() { return modelCard; } /** *

    * A structure describing the current state of the model in its life cycle. *

    * * @return A structure describing the current state of the model in its life cycle. */ public final ModelLifeCycle modelLifeCycle() { return modelLifeCycle; } /** *

    * A unique token that guarantees that the call to this API is idempotent. *

    * * @return A unique token that guarantees that the call to this API is idempotent. */ public final String clientToken() { return clientToken; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(modelPackageArn()); hashCode = 31 * hashCode + Objects.hashCode(modelApprovalStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(approvalDescription()); hashCode = 31 * hashCode + Objects.hashCode(hasCustomerMetadataProperties() ? customerMetadataProperties() : null); hashCode = 31 * hashCode + Objects.hashCode(hasCustomerMetadataPropertiesToRemove() ? customerMetadataPropertiesToRemove() : null); hashCode = 31 * hashCode + Objects.hashCode(hasAdditionalInferenceSpecificationsToAdd() ? additionalInferenceSpecificationsToAdd() : null); hashCode = 31 * hashCode + Objects.hashCode(inferenceSpecification()); hashCode = 31 * hashCode + Objects.hashCode(sourceUri()); hashCode = 31 * hashCode + Objects.hashCode(modelCard()); hashCode = 31 * hashCode + Objects.hashCode(modelLifeCycle()); hashCode = 31 * hashCode + Objects.hashCode(clientToken()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateModelPackageRequest)) { return false; } UpdateModelPackageRequest other = (UpdateModelPackageRequest) obj; return Objects.equals(modelPackageArn(), other.modelPackageArn()) && Objects.equals(modelApprovalStatusAsString(), other.modelApprovalStatusAsString()) && Objects.equals(approvalDescription(), other.approvalDescription()) && hasCustomerMetadataProperties() == other.hasCustomerMetadataProperties() && Objects.equals(customerMetadataProperties(), other.customerMetadataProperties()) && hasCustomerMetadataPropertiesToRemove() == other.hasCustomerMetadataPropertiesToRemove() && Objects.equals(customerMetadataPropertiesToRemove(), other.customerMetadataPropertiesToRemove()) && hasAdditionalInferenceSpecificationsToAdd() == other.hasAdditionalInferenceSpecificationsToAdd() && Objects.equals(additionalInferenceSpecificationsToAdd(), other.additionalInferenceSpecificationsToAdd()) && Objects.equals(inferenceSpecification(), other.inferenceSpecification()) && Objects.equals(sourceUri(), other.sourceUri()) && Objects.equals(modelCard(), other.modelCard()) && Objects.equals(modelLifeCycle(), other.modelLifeCycle()) && Objects.equals(clientToken(), other.clientToken()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString .builder("UpdateModelPackageRequest") .add("ModelPackageArn", modelPackageArn()) .add("ModelApprovalStatus", modelApprovalStatusAsString()) .add("ApprovalDescription", approvalDescription()) .add("CustomerMetadataProperties", hasCustomerMetadataProperties() ? customerMetadataProperties() : null) .add("CustomerMetadataPropertiesToRemove", hasCustomerMetadataPropertiesToRemove() ? customerMetadataPropertiesToRemove() : null) .add("AdditionalInferenceSpecificationsToAdd", hasAdditionalInferenceSpecificationsToAdd() ? additionalInferenceSpecificationsToAdd() : null) .add("InferenceSpecification", inferenceSpecification()).add("SourceUri", sourceUri()) .add("ModelCard", modelCard()).add("ModelLifeCycle", modelLifeCycle()).add("ClientToken", clientToken()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ModelPackageArn": return Optional.ofNullable(clazz.cast(modelPackageArn())); case "ModelApprovalStatus": return Optional.ofNullable(clazz.cast(modelApprovalStatusAsString())); case "ApprovalDescription": return Optional.ofNullable(clazz.cast(approvalDescription())); case "CustomerMetadataProperties": return Optional.ofNullable(clazz.cast(customerMetadataProperties())); case "CustomerMetadataPropertiesToRemove": return Optional.ofNullable(clazz.cast(customerMetadataPropertiesToRemove())); case "AdditionalInferenceSpecificationsToAdd": return Optional.ofNullable(clazz.cast(additionalInferenceSpecificationsToAdd())); case "InferenceSpecification": return Optional.ofNullable(clazz.cast(inferenceSpecification())); case "SourceUri": return Optional.ofNullable(clazz.cast(sourceUri())); case "ModelCard": return Optional.ofNullable(clazz.cast(modelCard())); case "ModelLifeCycle": return Optional.ofNullable(clazz.cast(modelLifeCycle())); case "ClientToken": return Optional.ofNullable(clazz.cast(clientToken())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("ModelPackageArn", MODEL_PACKAGE_ARN_FIELD); map.put("ModelApprovalStatus", MODEL_APPROVAL_STATUS_FIELD); map.put("ApprovalDescription", APPROVAL_DESCRIPTION_FIELD); map.put("CustomerMetadataProperties", CUSTOMER_METADATA_PROPERTIES_FIELD); map.put("CustomerMetadataPropertiesToRemove", CUSTOMER_METADATA_PROPERTIES_TO_REMOVE_FIELD); map.put("AdditionalInferenceSpecificationsToAdd", ADDITIONAL_INFERENCE_SPECIFICATIONS_TO_ADD_FIELD); map.put("InferenceSpecification", INFERENCE_SPECIFICATION_FIELD); map.put("SourceUri", SOURCE_URI_FIELD); map.put("ModelCard", MODEL_CARD_FIELD); map.put("ModelLifeCycle", MODEL_LIFE_CYCLE_FIELD); map.put("ClientToken", CLIENT_TOKEN_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((UpdateModelPackageRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerRequest.Builder, SdkPojo, CopyableBuilder { /** *

    * The Amazon Resource Name (ARN) of the model package. *

    * * @param modelPackageArn * The Amazon Resource Name (ARN) of the model package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelPackageArn(String modelPackageArn); /** *

    * The approval status of the model. *

    * * @param modelApprovalStatus * The approval status of the model. * @see ModelApprovalStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ModelApprovalStatus */ Builder modelApprovalStatus(String modelApprovalStatus); /** *

    * The approval status of the model. *

    * * @param modelApprovalStatus * The approval status of the model. * @see ModelApprovalStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ModelApprovalStatus */ Builder modelApprovalStatus(ModelApprovalStatus modelApprovalStatus); /** *

    * A description for the approval status of the model. *

    * * @param approvalDescription * A description for the approval status of the model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder approvalDescription(String approvalDescription); /** *

    * The metadata properties associated with the model package versions. *

    * * @param customerMetadataProperties * The metadata properties associated with the model package versions. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customerMetadataProperties(Map customerMetadataProperties); /** *

    * The metadata properties associated with the model package versions to remove. *

    * * @param customerMetadataPropertiesToRemove * The metadata properties associated with the model package versions to remove. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customerMetadataPropertiesToRemove(Collection customerMetadataPropertiesToRemove); /** *

    * The metadata properties associated with the model package versions to remove. *

    * * @param customerMetadataPropertiesToRemove * The metadata properties associated with the model package versions to remove. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customerMetadataPropertiesToRemove(String... customerMetadataPropertiesToRemove); /** *

    * An array of additional Inference Specification objects to be added to the existing array additional Inference * Specification. Total number of additional Inference Specifications can not exceed 15. Each additional * Inference Specification specifies artifacts based on this model package that can be used on inference * endpoints. Generally used with SageMaker Neo to store the compiled artifacts. *

    * * @param additionalInferenceSpecificationsToAdd * An array of additional Inference Specification objects to be added to the existing array additional * Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each * additional Inference Specification specifies artifacts based on this model package that can be used on * inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts. * @return Returns a reference to this object so that method calls can be chained together. */ Builder additionalInferenceSpecificationsToAdd( Collection additionalInferenceSpecificationsToAdd); /** *

    * An array of additional Inference Specification objects to be added to the existing array additional Inference * Specification. Total number of additional Inference Specifications can not exceed 15. Each additional * Inference Specification specifies artifacts based on this model package that can be used on inference * endpoints. Generally used with SageMaker Neo to store the compiled artifacts. *

    * * @param additionalInferenceSpecificationsToAdd * An array of additional Inference Specification objects to be added to the existing array additional * Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each * additional Inference Specification specifies artifacts based on this model package that can be used on * inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts. * @return Returns a reference to this object so that method calls can be chained together. */ Builder additionalInferenceSpecificationsToAdd( AdditionalInferenceSpecificationDefinition... additionalInferenceSpecificationsToAdd); /** *

    * An array of additional Inference Specification objects to be added to the existing array additional Inference * Specification. Total number of additional Inference Specifications can not exceed 15. Each additional * Inference Specification specifies artifacts based on this model package that can be used on inference * endpoints. Generally used with SageMaker Neo to store the compiled artifacts. *

    * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.AdditionalInferenceSpecificationDefinition.Builder} * avoiding the need to create one manually via * {@link software.amazon.awssdk.services.sagemaker.model.AdditionalInferenceSpecificationDefinition#builder()}. * *

    * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.AdditionalInferenceSpecificationDefinition.Builder#build()} * is called immediately and its result is passed to {@link * #additionalInferenceSpecificationsToAdd(List)}. * * @param additionalInferenceSpecificationsToAdd * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.AdditionalInferenceSpecificationDefinition.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see * #additionalInferenceSpecificationsToAdd(java.util.Collection) */ Builder additionalInferenceSpecificationsToAdd( Consumer... additionalInferenceSpecificationsToAdd); /** *

    * Specifies details about inference jobs that you can run with models based on this model package, including * the following information: *

    *
      *
    • *

      * The Amazon ECR paths of containers that contain the inference code and model artifacts. *

      *
    • *
    • *

      * The instance types that the model package supports for transform jobs and real-time endpoints used for * inference. *

      *
    • *
    • *

      * The input and output content formats that the model package supports for inference. *

      *
    • *
    * * @param inferenceSpecification * Specifies details about inference jobs that you can run with models based on this model package, * including the following information:

    *
      *
    • *

      * The Amazon ECR paths of containers that contain the inference code and model artifacts. *

      *
    • *
    • *

      * The instance types that the model package supports for transform jobs and real-time endpoints used for * inference. *

      *
    • *
    • *

      * The input and output content formats that the model package supports for inference. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferenceSpecification(InferenceSpecification inferenceSpecification); /** *

      * Specifies details about inference jobs that you can run with models based on this model package, including * the following information: *

      *
        *
      • *

        * The Amazon ECR paths of containers that contain the inference code and model artifacts. *

        *
      • *
      • *

        * The instance types that the model package supports for transform jobs and real-time endpoints used for * inference. *

        *
      • *
      • *

        * The input and output content formats that the model package supports for inference. *

        *
      • *
      * This is a convenience method that creates an instance of the {@link InferenceSpecification.Builder} avoiding * the need to create one manually via {@link InferenceSpecification#builder()}. * *

      * When the {@link Consumer} completes, {@link InferenceSpecification.Builder#build()} is called immediately and * its result is passed to {@link #inferenceSpecification(InferenceSpecification)}. * * @param inferenceSpecification * a consumer that will call methods on {@link InferenceSpecification.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #inferenceSpecification(InferenceSpecification) */ default Builder inferenceSpecification(Consumer inferenceSpecification) { return inferenceSpecification(InferenceSpecification.builder().applyMutation(inferenceSpecification).build()); } /** *

      * The URI of the source for the model package. *

      * * @param sourceUri * The URI of the source for the model package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceUri(String sourceUri); /** *

      * The model card associated with the model package. Since ModelPackageModelCard is tied to a model * package, it is a specific usage of a model card and its schema is simplified compared to the schema of * ModelCard. The ModelPackageModelCard schema does not include * model_package_details, and model_overview is composed of the * model_creator and model_artifact properties. For more information about the model * package model card schema, see Model * package model card schema. For more information about the model card associated with the model package, * see View the Details of * a Model Version. *

      * * @param modelCard * The model card associated with the model package. Since ModelPackageModelCard is tied to * a model package, it is a specific usage of a model card and its schema is simplified compared to the * schema of ModelCard. The ModelPackageModelCard schema does not include * model_package_details, and model_overview is composed of the * model_creator and model_artifact properties. For more information about the * model package model card schema, see Model package model card schema. For more information about the model card associated with the * model package, see View the Details of * a Model Version. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelCard(ModelPackageModelCard modelCard); /** *

      * The model card associated with the model package. Since ModelPackageModelCard is tied to a model * package, it is a specific usage of a model card and its schema is simplified compared to the schema of * ModelCard. The ModelPackageModelCard schema does not include * model_package_details, and model_overview is composed of the * model_creator and model_artifact properties. For more information about the model * package model card schema, see Model * package model card schema. For more information about the model card associated with the model package, * see View the Details of * a Model Version. *

      * This is a convenience method that creates an instance of the {@link ModelPackageModelCard.Builder} avoiding * the need to create one manually via {@link ModelPackageModelCard#builder()}. * *

      * When the {@link Consumer} completes, {@link ModelPackageModelCard.Builder#build()} is called immediately and * its result is passed to {@link #modelCard(ModelPackageModelCard)}. * * @param modelCard * a consumer that will call methods on {@link ModelPackageModelCard.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #modelCard(ModelPackageModelCard) */ default Builder modelCard(Consumer modelCard) { return modelCard(ModelPackageModelCard.builder().applyMutation(modelCard).build()); } /** *

      * A structure describing the current state of the model in its life cycle. *

      * * @param modelLifeCycle * A structure describing the current state of the model in its life cycle. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelLifeCycle(ModelLifeCycle modelLifeCycle); /** *

      * A structure describing the current state of the model in its life cycle. *

      * This is a convenience method that creates an instance of the {@link ModelLifeCycle.Builder} avoiding the need * to create one manually via {@link ModelLifeCycle#builder()}. * *

      * When the {@link Consumer} completes, {@link ModelLifeCycle.Builder#build()} is called immediately and its * result is passed to {@link #modelLifeCycle(ModelLifeCycle)}. * * @param modelLifeCycle * a consumer that will call methods on {@link ModelLifeCycle.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #modelLifeCycle(ModelLifeCycle) */ default Builder modelLifeCycle(Consumer modelLifeCycle) { return modelLifeCycle(ModelLifeCycle.builder().applyMutation(modelLifeCycle).build()); } /** *

      * A unique token that guarantees that the call to this API is idempotent. *

      * * @param clientToken * A unique token that guarantees that the call to this API is idempotent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientToken(String clientToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SageMakerRequest.BuilderImpl implements Builder { private String modelPackageArn; private String modelApprovalStatus; private String approvalDescription; private Map customerMetadataProperties = DefaultSdkAutoConstructMap.getInstance(); private List customerMetadataPropertiesToRemove = DefaultSdkAutoConstructList.getInstance(); private List additionalInferenceSpecificationsToAdd = DefaultSdkAutoConstructList .getInstance(); private InferenceSpecification inferenceSpecification; private String sourceUri; private ModelPackageModelCard modelCard; private ModelLifeCycle modelLifeCycle; private String clientToken; private BuilderImpl() { } private BuilderImpl(UpdateModelPackageRequest model) { super(model); modelPackageArn(model.modelPackageArn); modelApprovalStatus(model.modelApprovalStatus); approvalDescription(model.approvalDescription); customerMetadataProperties(model.customerMetadataProperties); customerMetadataPropertiesToRemove(model.customerMetadataPropertiesToRemove); additionalInferenceSpecificationsToAdd(model.additionalInferenceSpecificationsToAdd); inferenceSpecification(model.inferenceSpecification); sourceUri(model.sourceUri); modelCard(model.modelCard); modelLifeCycle(model.modelLifeCycle); clientToken(model.clientToken); } public final String getModelPackageArn() { return modelPackageArn; } public final void setModelPackageArn(String modelPackageArn) { this.modelPackageArn = modelPackageArn; } @Override public final Builder modelPackageArn(String modelPackageArn) { this.modelPackageArn = modelPackageArn; return this; } public final String getModelApprovalStatus() { return modelApprovalStatus; } public final void setModelApprovalStatus(String modelApprovalStatus) { this.modelApprovalStatus = modelApprovalStatus; } @Override public final Builder modelApprovalStatus(String modelApprovalStatus) { this.modelApprovalStatus = modelApprovalStatus; return this; } @Override public final Builder modelApprovalStatus(ModelApprovalStatus modelApprovalStatus) { this.modelApprovalStatus(modelApprovalStatus == null ? null : modelApprovalStatus.toString()); return this; } public final String getApprovalDescription() { return approvalDescription; } public final void setApprovalDescription(String approvalDescription) { this.approvalDescription = approvalDescription; } @Override public final Builder approvalDescription(String approvalDescription) { this.approvalDescription = approvalDescription; return this; } public final Map getCustomerMetadataProperties() { if (customerMetadataProperties instanceof SdkAutoConstructMap) { return null; } return customerMetadataProperties; } public final void setCustomerMetadataProperties(Map customerMetadataProperties) { this.customerMetadataProperties = CustomerMetadataMapCopier.copy(customerMetadataProperties); } @Override public final Builder customerMetadataProperties(Map customerMetadataProperties) { this.customerMetadataProperties = CustomerMetadataMapCopier.copy(customerMetadataProperties); return this; } public final Collection getCustomerMetadataPropertiesToRemove() { if (customerMetadataPropertiesToRemove instanceof SdkAutoConstructList) { return null; } return customerMetadataPropertiesToRemove; } public final void setCustomerMetadataPropertiesToRemove(Collection customerMetadataPropertiesToRemove) { this.customerMetadataPropertiesToRemove = CustomerMetadataKeyListCopier.copy(customerMetadataPropertiesToRemove); } @Override public final Builder customerMetadataPropertiesToRemove(Collection customerMetadataPropertiesToRemove) { this.customerMetadataPropertiesToRemove = CustomerMetadataKeyListCopier.copy(customerMetadataPropertiesToRemove); return this; } @Override @SafeVarargs public final Builder customerMetadataPropertiesToRemove(String... customerMetadataPropertiesToRemove) { customerMetadataPropertiesToRemove(Arrays.asList(customerMetadataPropertiesToRemove)); return this; } public final List getAdditionalInferenceSpecificationsToAdd() { List result = AdditionalInferenceSpecificationsCopier .copyToBuilder(this.additionalInferenceSpecificationsToAdd); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAdditionalInferenceSpecificationsToAdd( Collection additionalInferenceSpecificationsToAdd) { this.additionalInferenceSpecificationsToAdd = AdditionalInferenceSpecificationsCopier .copyFromBuilder(additionalInferenceSpecificationsToAdd); } @Override public final Builder additionalInferenceSpecificationsToAdd( Collection additionalInferenceSpecificationsToAdd) { this.additionalInferenceSpecificationsToAdd = AdditionalInferenceSpecificationsCopier .copy(additionalInferenceSpecificationsToAdd); return this; } @Override @SafeVarargs public final Builder additionalInferenceSpecificationsToAdd( AdditionalInferenceSpecificationDefinition... additionalInferenceSpecificationsToAdd) { additionalInferenceSpecificationsToAdd(Arrays.asList(additionalInferenceSpecificationsToAdd)); return this; } @Override @SafeVarargs public final Builder additionalInferenceSpecificationsToAdd( Consumer... additionalInferenceSpecificationsToAdd) { additionalInferenceSpecificationsToAdd(Stream.of(additionalInferenceSpecificationsToAdd) .map(c -> AdditionalInferenceSpecificationDefinition.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final InferenceSpecification.Builder getInferenceSpecification() { return inferenceSpecification != null ? inferenceSpecification.toBuilder() : null; } public final void setInferenceSpecification(InferenceSpecification.BuilderImpl inferenceSpecification) { this.inferenceSpecification = inferenceSpecification != null ? inferenceSpecification.build() : null; } @Override public final Builder inferenceSpecification(InferenceSpecification inferenceSpecification) { this.inferenceSpecification = inferenceSpecification; return this; } public final String getSourceUri() { return sourceUri; } public final void setSourceUri(String sourceUri) { this.sourceUri = sourceUri; } @Override public final Builder sourceUri(String sourceUri) { this.sourceUri = sourceUri; return this; } public final ModelPackageModelCard.Builder getModelCard() { return modelCard != null ? modelCard.toBuilder() : null; } public final void setModelCard(ModelPackageModelCard.BuilderImpl modelCard) { this.modelCard = modelCard != null ? modelCard.build() : null; } @Override public final Builder modelCard(ModelPackageModelCard modelCard) { this.modelCard = modelCard; return this; } public final ModelLifeCycle.Builder getModelLifeCycle() { return modelLifeCycle != null ? modelLifeCycle.toBuilder() : null; } public final void setModelLifeCycle(ModelLifeCycle.BuilderImpl modelLifeCycle) { this.modelLifeCycle = modelLifeCycle != null ? modelLifeCycle.build() : null; } @Override public final Builder modelLifeCycle(ModelLifeCycle modelLifeCycle) { this.modelLifeCycle = modelLifeCycle; return this; } public final String getClientToken() { return clientToken; } public final void setClientToken(String clientToken) { this.clientToken = clientToken; } @Override public final Builder clientToken(String clientToken) { this.clientToken = clientToken; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateModelPackageRequest build() { return new UpdateModelPackageRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy