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

software.amazon.awssdk.services.sagemaker.model.DescribeEndpointConfigResponse 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.30.1
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.beans.Transient;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
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.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.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 DescribeEndpointConfigResponse extends SageMakerResponse implements
        ToCopyableBuilder {
    private static final SdkField ENDPOINT_CONFIG_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EndpointConfigName").getter(getter(DescribeEndpointConfigResponse::endpointConfigName))
            .setter(setter(Builder::endpointConfigName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointConfigName").build())
            .build();

    private static final SdkField ENDPOINT_CONFIG_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EndpointConfigArn").getter(getter(DescribeEndpointConfigResponse::endpointConfigArn))
            .setter(setter(Builder::endpointConfigArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointConfigArn").build()).build();

    private static final SdkField> PRODUCTION_VARIANTS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ProductionVariants")
            .getter(getter(DescribeEndpointConfigResponse::productionVariants))
            .setter(setter(Builder::productionVariants))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProductionVariants").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ProductionVariant::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField DATA_CAPTURE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("DataCaptureConfig")
            .getter(getter(DescribeEndpointConfigResponse::dataCaptureConfig)).setter(setter(Builder::dataCaptureConfig))
            .constructor(DataCaptureConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataCaptureConfig").build()).build();

    private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("KmsKeyId").getter(getter(DescribeEndpointConfigResponse::kmsKeyId)).setter(setter(Builder::kmsKeyId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId").build()).build();

    private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("CreationTime").getter(getter(DescribeEndpointConfigResponse::creationTime))
            .setter(setter(Builder::creationTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();

    private static final SdkField ASYNC_INFERENCE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("AsyncInferenceConfig")
            .getter(getter(DescribeEndpointConfigResponse::asyncInferenceConfig)).setter(setter(Builder::asyncInferenceConfig))
            .constructor(AsyncInferenceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AsyncInferenceConfig").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENDPOINT_CONFIG_NAME_FIELD,
            ENDPOINT_CONFIG_ARN_FIELD, PRODUCTION_VARIANTS_FIELD, DATA_CAPTURE_CONFIG_FIELD, KMS_KEY_ID_FIELD,
            CREATION_TIME_FIELD, ASYNC_INFERENCE_CONFIG_FIELD));

    private final String endpointConfigName;

    private final String endpointConfigArn;

    private final List productionVariants;

    private final DataCaptureConfig dataCaptureConfig;

    private final String kmsKeyId;

    private final Instant creationTime;

    private final AsyncInferenceConfig asyncInferenceConfig;

    private DescribeEndpointConfigResponse(BuilderImpl builder) {
        super(builder);
        this.endpointConfigName = builder.endpointConfigName;
        this.endpointConfigArn = builder.endpointConfigArn;
        this.productionVariants = builder.productionVariants;
        this.dataCaptureConfig = builder.dataCaptureConfig;
        this.kmsKeyId = builder.kmsKeyId;
        this.creationTime = builder.creationTime;
        this.asyncInferenceConfig = builder.asyncInferenceConfig;
    }

    /**
     * 

* Name of the Amazon SageMaker endpoint configuration. *

* * @return Name of the Amazon SageMaker endpoint configuration. */ public final String endpointConfigName() { return endpointConfigName; } /** *

* The Amazon Resource Name (ARN) of the endpoint configuration. *

* * @return The Amazon Resource Name (ARN) of the endpoint configuration. */ public final String endpointConfigArn() { return endpointConfigArn; } /** * For responses, this returns true if the service returned a value for the ProductionVariants 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 hasProductionVariants() { return productionVariants != null && !(productionVariants instanceof SdkAutoConstructList); } /** *

* An array of ProductionVariant objects, one for each model that you want to host at this endpoint. *

*

* 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 #hasProductionVariants} method. *

* * @return An array of ProductionVariant objects, one for each model that you want to host at this * endpoint. */ public final List productionVariants() { return productionVariants; } /** * Returns the value of the DataCaptureConfig property for this object. * * @return The value of the DataCaptureConfig property for this object. */ public final DataCaptureConfig dataCaptureConfig() { return dataCaptureConfig; } /** *

* Amazon Web Services KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume * attached to the instance. *

* * @return Amazon Web Services KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage * volume attached to the instance. */ public final String kmsKeyId() { return kmsKeyId; } /** *

* A timestamp that shows when the endpoint configuration was created. *

* * @return A timestamp that shows when the endpoint configuration was created. */ public final Instant creationTime() { return creationTime; } /** *

* Returns the description of an endpoint configuration created using the * CreateEndpointConfig API. *

* * @return Returns the description of an endpoint configuration created using the * CreateEndpointConfig API. */ public final AsyncInferenceConfig asyncInferenceConfig() { return asyncInferenceConfig; } @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(endpointConfigName()); hashCode = 31 * hashCode + Objects.hashCode(endpointConfigArn()); hashCode = 31 * hashCode + Objects.hashCode(hasProductionVariants() ? productionVariants() : null); hashCode = 31 * hashCode + Objects.hashCode(dataCaptureConfig()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(asyncInferenceConfig()); 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 DescribeEndpointConfigResponse)) { return false; } DescribeEndpointConfigResponse other = (DescribeEndpointConfigResponse) obj; return Objects.equals(endpointConfigName(), other.endpointConfigName()) && Objects.equals(endpointConfigArn(), other.endpointConfigArn()) && hasProductionVariants() == other.hasProductionVariants() && Objects.equals(productionVariants(), other.productionVariants()) && Objects.equals(dataCaptureConfig(), other.dataCaptureConfig()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(asyncInferenceConfig(), other.asyncInferenceConfig()); } /** * 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("DescribeEndpointConfigResponse").add("EndpointConfigName", endpointConfigName()) .add("EndpointConfigArn", endpointConfigArn()) .add("ProductionVariants", hasProductionVariants() ? productionVariants() : null) .add("DataCaptureConfig", dataCaptureConfig()).add("KmsKeyId", kmsKeyId()).add("CreationTime", creationTime()) .add("AsyncInferenceConfig", asyncInferenceConfig()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EndpointConfigName": return Optional.ofNullable(clazz.cast(endpointConfigName())); case "EndpointConfigArn": return Optional.ofNullable(clazz.cast(endpointConfigArn())); case "ProductionVariants": return Optional.ofNullable(clazz.cast(productionVariants())); case "DataCaptureConfig": return Optional.ofNullable(clazz.cast(dataCaptureConfig())); case "KmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "AsyncInferenceConfig": return Optional.ofNullable(clazz.cast(asyncInferenceConfig())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeEndpointConfigResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerResponse.Builder, SdkPojo, CopyableBuilder { /** *

* Name of the Amazon SageMaker endpoint configuration. *

* * @param endpointConfigName * Name of the Amazon SageMaker endpoint configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpointConfigName(String endpointConfigName); /** *

* The Amazon Resource Name (ARN) of the endpoint configuration. *

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

* An array of ProductionVariant objects, one for each model that you want to host at this * endpoint. *

* * @param productionVariants * An array of ProductionVariant objects, one for each model that you want to host at this * endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder productionVariants(Collection productionVariants); /** *

* An array of ProductionVariant objects, one for each model that you want to host at this * endpoint. *

* * @param productionVariants * An array of ProductionVariant objects, one for each model that you want to host at this * endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder productionVariants(ProductionVariant... productionVariants); /** *

* An array of ProductionVariant objects, one for each model that you want to host at this * endpoint. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately * and its result is passed to {@link #productionVariants(List)}. * * @param productionVariants * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #productionVariants(List) */ Builder productionVariants(Consumer... productionVariants); /** * Sets the value of the DataCaptureConfig property for this object. * * @param dataCaptureConfig * The new value for the DataCaptureConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataCaptureConfig(DataCaptureConfig dataCaptureConfig); /** * Sets the value of the DataCaptureConfig property for this object. * * This is a convenience that creates an instance of the {@link DataCaptureConfig.Builder} avoiding the need to * create one manually via {@link DataCaptureConfig#builder()}. * * When the {@link Consumer} completes, {@link DataCaptureConfig.Builder#build()} is called immediately and its * result is passed to {@link #dataCaptureConfig(DataCaptureConfig)}. * * @param dataCaptureConfig * a consumer that will call methods on {@link DataCaptureConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #dataCaptureConfig(DataCaptureConfig) */ default Builder dataCaptureConfig(Consumer dataCaptureConfig) { return dataCaptureConfig(DataCaptureConfig.builder().applyMutation(dataCaptureConfig).build()); } /** *

* Amazon Web Services KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume * attached to the instance. *

* * @param kmsKeyId * Amazon Web Services KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage * volume attached to the instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

* A timestamp that shows when the endpoint configuration was created. *

* * @param creationTime * A timestamp that shows when the endpoint configuration was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* Returns the description of an endpoint configuration created using the * CreateEndpointConfig API. *

* * @param asyncInferenceConfig * Returns the description of an endpoint configuration created using the * CreateEndpointConfig API. * @return Returns a reference to this object so that method calls can be chained together. */ Builder asyncInferenceConfig(AsyncInferenceConfig asyncInferenceConfig); /** *

* Returns the description of an endpoint configuration created using the * CreateEndpointConfig API. *

* This is a convenience that creates an instance of the {@link AsyncInferenceConfig.Builder} avoiding the need * to create one manually via {@link AsyncInferenceConfig#builder()}. * * When the {@link Consumer} completes, {@link AsyncInferenceConfig.Builder#build()} is called immediately and * its result is passed to {@link #asyncInferenceConfig(AsyncInferenceConfig)}. * * @param asyncInferenceConfig * a consumer that will call methods on {@link AsyncInferenceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #asyncInferenceConfig(AsyncInferenceConfig) */ default Builder asyncInferenceConfig(Consumer asyncInferenceConfig) { return asyncInferenceConfig(AsyncInferenceConfig.builder().applyMutation(asyncInferenceConfig).build()); } } static final class BuilderImpl extends SageMakerResponse.BuilderImpl implements Builder { private String endpointConfigName; private String endpointConfigArn; private List productionVariants = DefaultSdkAutoConstructList.getInstance(); private DataCaptureConfig dataCaptureConfig; private String kmsKeyId; private Instant creationTime; private AsyncInferenceConfig asyncInferenceConfig; private BuilderImpl() { } private BuilderImpl(DescribeEndpointConfigResponse model) { super(model); endpointConfigName(model.endpointConfigName); endpointConfigArn(model.endpointConfigArn); productionVariants(model.productionVariants); dataCaptureConfig(model.dataCaptureConfig); kmsKeyId(model.kmsKeyId); creationTime(model.creationTime); asyncInferenceConfig(model.asyncInferenceConfig); } public final String getEndpointConfigName() { return endpointConfigName; } public final void setEndpointConfigName(String endpointConfigName) { this.endpointConfigName = endpointConfigName; } @Override @Transient public final Builder endpointConfigName(String endpointConfigName) { this.endpointConfigName = endpointConfigName; return this; } public final String getEndpointConfigArn() { return endpointConfigArn; } public final void setEndpointConfigArn(String endpointConfigArn) { this.endpointConfigArn = endpointConfigArn; } @Override @Transient public final Builder endpointConfigArn(String endpointConfigArn) { this.endpointConfigArn = endpointConfigArn; return this; } public final List getProductionVariants() { List result = ProductionVariantListCopier.copyToBuilder(this.productionVariants); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setProductionVariants(Collection productionVariants) { this.productionVariants = ProductionVariantListCopier.copyFromBuilder(productionVariants); } @Override @Transient public final Builder productionVariants(Collection productionVariants) { this.productionVariants = ProductionVariantListCopier.copy(productionVariants); return this; } @Override @Transient @SafeVarargs public final Builder productionVariants(ProductionVariant... productionVariants) { productionVariants(Arrays.asList(productionVariants)); return this; } @Override @Transient @SafeVarargs public final Builder productionVariants(Consumer... productionVariants) { productionVariants(Stream.of(productionVariants).map(c -> ProductionVariant.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final DataCaptureConfig.Builder getDataCaptureConfig() { return dataCaptureConfig != null ? dataCaptureConfig.toBuilder() : null; } public final void setDataCaptureConfig(DataCaptureConfig.BuilderImpl dataCaptureConfig) { this.dataCaptureConfig = dataCaptureConfig != null ? dataCaptureConfig.build() : null; } @Override @Transient public final Builder dataCaptureConfig(DataCaptureConfig dataCaptureConfig) { this.dataCaptureConfig = dataCaptureConfig; return this; } public final String getKmsKeyId() { return kmsKeyId; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } @Override @Transient public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override @Transient public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final AsyncInferenceConfig.Builder getAsyncInferenceConfig() { return asyncInferenceConfig != null ? asyncInferenceConfig.toBuilder() : null; } public final void setAsyncInferenceConfig(AsyncInferenceConfig.BuilderImpl asyncInferenceConfig) { this.asyncInferenceConfig = asyncInferenceConfig != null ? asyncInferenceConfig.build() : null; } @Override @Transient public final Builder asyncInferenceConfig(AsyncInferenceConfig asyncInferenceConfig) { this.asyncInferenceConfig = asyncInferenceConfig; return this; } @Override public DescribeEndpointConfigResponse build() { return new DescribeEndpointConfigResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy