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

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

/*
 * 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.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 DescribeInferenceExperimentResponse extends SageMakerResponse implements
        ToCopyableBuilder {
    private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
            .getter(getter(DescribeInferenceExperimentResponse::arn)).setter(setter(Builder::arn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
            .getter(getter(DescribeInferenceExperimentResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();

    private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
            .getter(getter(DescribeInferenceExperimentResponse::typeAsString)).setter(setter(Builder::type))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();

    private static final SdkField SCHEDULE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("Schedule")
            .getter(getter(DescribeInferenceExperimentResponse::schedule)).setter(setter(Builder::schedule))
            .constructor(InferenceExperimentSchedule::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Schedule").build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
            .getter(getter(DescribeInferenceExperimentResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();

    private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("StatusReason").getter(getter(DescribeInferenceExperimentResponse::statusReason))
            .setter(setter(Builder::statusReason))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusReason").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(DescribeInferenceExperimentResponse::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

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

    private static final SdkField COMPLETION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("CompletionTime").getter(getter(DescribeInferenceExperimentResponse::completionTime))
            .setter(setter(Builder::completionTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletionTime").build()).build();

    private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("LastModifiedTime").getter(getter(DescribeInferenceExperimentResponse::lastModifiedTime))
            .setter(setter(Builder::lastModifiedTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();

    private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RoleArn").getter(getter(DescribeInferenceExperimentResponse::roleArn)).setter(setter(Builder::roleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();

    private static final SdkField ENDPOINT_METADATA_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("EndpointMetadata")
            .getter(getter(DescribeInferenceExperimentResponse::endpointMetadata)).setter(setter(Builder::endpointMetadata))
            .constructor(EndpointMetadata::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointMetadata").build()).build();

    private static final SdkField> MODEL_VARIANTS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ModelVariants")
            .getter(getter(DescribeInferenceExperimentResponse::modelVariants))
            .setter(setter(Builder::modelVariants))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelVariants").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ModelVariantConfigSummary::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField DATA_STORAGE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("DataStorageConfig")
            .getter(getter(DescribeInferenceExperimentResponse::dataStorageConfig)).setter(setter(Builder::dataStorageConfig))
            .constructor(InferenceExperimentDataStorageConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataStorageConfig").build()).build();

    private static final SdkField SHADOW_MODE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ShadowModeConfig")
            .getter(getter(DescribeInferenceExperimentResponse::shadowModeConfig)).setter(setter(Builder::shadowModeConfig))
            .constructor(ShadowModeConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShadowModeConfig").build()).build();

    private static final SdkField KMS_KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("KmsKey")
            .getter(getter(DescribeInferenceExperimentResponse::kmsKey)).setter(setter(Builder::kmsKey))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKey").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NAME_FIELD,
            TYPE_FIELD, SCHEDULE_FIELD, STATUS_FIELD, STATUS_REASON_FIELD, DESCRIPTION_FIELD, CREATION_TIME_FIELD,
            COMPLETION_TIME_FIELD, LAST_MODIFIED_TIME_FIELD, ROLE_ARN_FIELD, ENDPOINT_METADATA_FIELD, MODEL_VARIANTS_FIELD,
            DATA_STORAGE_CONFIG_FIELD, SHADOW_MODE_CONFIG_FIELD, KMS_KEY_FIELD));

    private final String arn;

    private final String name;

    private final String type;

    private final InferenceExperimentSchedule schedule;

    private final String status;

    private final String statusReason;

    private final String description;

    private final Instant creationTime;

    private final Instant completionTime;

    private final Instant lastModifiedTime;

    private final String roleArn;

    private final EndpointMetadata endpointMetadata;

    private final List modelVariants;

    private final InferenceExperimentDataStorageConfig dataStorageConfig;

    private final ShadowModeConfig shadowModeConfig;

    private final String kmsKey;

    private DescribeInferenceExperimentResponse(BuilderImpl builder) {
        super(builder);
        this.arn = builder.arn;
        this.name = builder.name;
        this.type = builder.type;
        this.schedule = builder.schedule;
        this.status = builder.status;
        this.statusReason = builder.statusReason;
        this.description = builder.description;
        this.creationTime = builder.creationTime;
        this.completionTime = builder.completionTime;
        this.lastModifiedTime = builder.lastModifiedTime;
        this.roleArn = builder.roleArn;
        this.endpointMetadata = builder.endpointMetadata;
        this.modelVariants = builder.modelVariants;
        this.dataStorageConfig = builder.dataStorageConfig;
        this.shadowModeConfig = builder.shadowModeConfig;
        this.kmsKey = builder.kmsKey;
    }

    /**
     * 

* The ARN of the inference experiment being described. *

* * @return The ARN of the inference experiment being described. */ public final String arn() { return arn; } /** *

* The name of the inference experiment. *

* * @return The name of the inference experiment. */ public final String name() { return name; } /** *

* The type of the inference experiment. *

*

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

* * @return The type of the inference experiment. * @see InferenceExperimentType */ public final InferenceExperimentType type() { return InferenceExperimentType.fromValue(type); } /** *

* The type of the inference experiment. *

*

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

* * @return The type of the inference experiment. * @see InferenceExperimentType */ public final String typeAsString() { return type; } /** *

* The duration for which the inference experiment ran or will run. *

* * @return The duration for which the inference experiment ran or will run. */ public final InferenceExperimentSchedule schedule() { return schedule; } /** *

* The status of the inference experiment. The following are the possible statuses for an inference experiment: *

*
    *
  • *

    * Creating - Amazon SageMaker is creating your experiment. *

    *
  • *
  • *

    * Created - Amazon SageMaker has finished the creation of your experiment and will begin the * experiment at the scheduled time. *

    *
  • *
  • *

    * Updating - When you make changes to your experiment, your experiment shows as updating. *

    *
  • *
  • *

    * Starting - Amazon SageMaker is beginning your experiment. *

    *
  • *
  • *

    * Running - Your experiment is in progress. *

    *
  • *
  • *

    * Stopping - Amazon SageMaker is stopping your experiment. *

    *
  • *
  • *

    * Completed - Your experiment has completed. *

    *
  • *
  • *

    * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as cancelled. *

    *
  • *
*

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

* * @return The status of the inference experiment. The following are the possible statuses for an inference * experiment:

*
    *
  • *

    * Creating - Amazon SageMaker is creating your experiment. *

    *
  • *
  • *

    * Created - Amazon SageMaker has finished the creation of your experiment and will begin the * experiment at the scheduled time. *

    *
  • *
  • *

    * Updating - When you make changes to your experiment, your experiment shows as updating. *

    *
  • *
  • *

    * Starting - Amazon SageMaker is beginning your experiment. *

    *
  • *
  • *

    * Running - Your experiment is in progress. *

    *
  • *
  • *

    * Stopping - Amazon SageMaker is stopping your experiment. *

    *
  • *
  • *

    * Completed - Your experiment has completed. *

    *
  • *
  • *

    * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as * cancelled. *

    *
  • * @see InferenceExperimentStatus */ public final InferenceExperimentStatus status() { return InferenceExperimentStatus.fromValue(status); } /** *

    * The status of the inference experiment. The following are the possible statuses for an inference experiment: *

    *
      *
    • *

      * Creating - Amazon SageMaker is creating your experiment. *

      *
    • *
    • *

      * Created - Amazon SageMaker has finished the creation of your experiment and will begin the * experiment at the scheduled time. *

      *
    • *
    • *

      * Updating - When you make changes to your experiment, your experiment shows as updating. *

      *
    • *
    • *

      * Starting - Amazon SageMaker is beginning your experiment. *

      *
    • *
    • *

      * Running - Your experiment is in progress. *

      *
    • *
    • *

      * Stopping - Amazon SageMaker is stopping your experiment. *

      *
    • *
    • *

      * Completed - Your experiment has completed. *

      *
    • *
    • *

      * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as cancelled. *

      *
    • *
    *

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

    * * @return The status of the inference experiment. The following are the possible statuses for an inference * experiment:

    *
      *
    • *

      * Creating - Amazon SageMaker is creating your experiment. *

      *
    • *
    • *

      * Created - Amazon SageMaker has finished the creation of your experiment and will begin the * experiment at the scheduled time. *

      *
    • *
    • *

      * Updating - When you make changes to your experiment, your experiment shows as updating. *

      *
    • *
    • *

      * Starting - Amazon SageMaker is beginning your experiment. *

      *
    • *
    • *

      * Running - Your experiment is in progress. *

      *
    • *
    • *

      * Stopping - Amazon SageMaker is stopping your experiment. *

      *
    • *
    • *

      * Completed - Your experiment has completed. *

      *
    • *
    • *

      * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as * cancelled. *

      *
    • * @see InferenceExperimentStatus */ public final String statusAsString() { return status; } /** *

      * The error message or client-specified Reason from the StopInferenceExperiment API, that explains the status of the inference experiment. *

      * * @return The error message or client-specified Reason from the StopInferenceExperiment API, that explains the status of the inference experiment. */ public final String statusReason() { return statusReason; } /** *

      * The description of the inference experiment. *

      * * @return The description of the inference experiment. */ public final String description() { return description; } /** *

      * The timestamp at which you created the inference experiment. *

      * * @return The timestamp at which you created the inference experiment. */ public final Instant creationTime() { return creationTime; } /** *

      * The timestamp at which the inference experiment was completed. *

      * * @return The timestamp at which the inference experiment was completed. */ public final Instant completionTime() { return completionTime; } /** *

      * The timestamp at which you last modified the inference experiment. *

      * * @return The timestamp at which you last modified the inference experiment. */ public final Instant lastModifiedTime() { return lastModifiedTime; } /** *

      * The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and * manage Amazon SageMaker Inference endpoints for model deployment. *

      * * @return The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, * and manage Amazon SageMaker Inference endpoints for model deployment. */ public final String roleArn() { return roleArn; } /** *

      * The metadata of the endpoint on which the inference experiment ran. *

      * * @return The metadata of the endpoint on which the inference experiment ran. */ public final EndpointMetadata endpointMetadata() { return endpointMetadata; } /** * For responses, this returns true if the service returned a value for the ModelVariants 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 hasModelVariants() { return modelVariants != null && !(modelVariants instanceof SdkAutoConstructList); } /** *

      * An array of ModelVariantConfigSummary objects. There is one for each variant in the inference * experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure * configuration for deploying the corresponding variant. *

      *

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

      * * @return An array of ModelVariantConfigSummary objects. There is one for each variant in the * inference experiment. Each ModelVariantConfigSummary object in the array describes the * infrastructure configuration for deploying the corresponding variant. */ public final List modelVariants() { return modelVariants; } /** *

      * The Amazon S3 location and configuration for storing inference request and response data. *

      * * @return The Amazon S3 location and configuration for storing inference request and response data. */ public final InferenceExperimentDataStorageConfig dataStorageConfig() { return dataStorageConfig; } /** *

      * The configuration of ShadowMode inference experiment type, which shows the production variant that * takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the * inference requests. For the shadow variant it also shows the percentage of requests that Amazon SageMaker * replicates. *

      * * @return The configuration of ShadowMode inference experiment type, which shows the production * variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker * replicates a percentage of the inference requests. For the shadow variant it also shows the percentage of * requests that Amazon SageMaker replicates. */ public final ShadowModeConfig shadowModeConfig() { return shadowModeConfig; } /** *

      * The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses to * encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. For more * information, see CreateInferenceExperiment. *

      * * @return The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses * to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. For * more information, see CreateInferenceExperiment. */ public final String kmsKey() { return kmsKey; } @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(arn()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(schedule()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusReason()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(completionTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(endpointMetadata()); hashCode = 31 * hashCode + Objects.hashCode(hasModelVariants() ? modelVariants() : null); hashCode = 31 * hashCode + Objects.hashCode(dataStorageConfig()); hashCode = 31 * hashCode + Objects.hashCode(shadowModeConfig()); hashCode = 31 * hashCode + Objects.hashCode(kmsKey()); 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 DescribeInferenceExperimentResponse)) { return false; } DescribeInferenceExperimentResponse other = (DescribeInferenceExperimentResponse) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(name(), other.name()) && Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(schedule(), other.schedule()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusReason(), other.statusReason()) && Objects.equals(description(), other.description()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(completionTime(), other.completionTime()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(endpointMetadata(), other.endpointMetadata()) && hasModelVariants() == other.hasModelVariants() && Objects.equals(modelVariants(), other.modelVariants()) && Objects.equals(dataStorageConfig(), other.dataStorageConfig()) && Objects.equals(shadowModeConfig(), other.shadowModeConfig()) && Objects.equals(kmsKey(), other.kmsKey()); } /** * 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("DescribeInferenceExperimentResponse").add("Arn", arn()).add("Name", name()) .add("Type", typeAsString()).add("Schedule", schedule()).add("Status", statusAsString()) .add("StatusReason", statusReason()).add("Description", description()).add("CreationTime", creationTime()) .add("CompletionTime", completionTime()).add("LastModifiedTime", lastModifiedTime()).add("RoleArn", roleArn()) .add("EndpointMetadata", endpointMetadata()).add("ModelVariants", hasModelVariants() ? modelVariants() : null) .add("DataStorageConfig", dataStorageConfig()).add("ShadowModeConfig", shadowModeConfig()) .add("KmsKey", kmsKey()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "Type": return Optional.ofNullable(clazz.cast(typeAsString())); case "Schedule": return Optional.ofNullable(clazz.cast(schedule())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "StatusReason": return Optional.ofNullable(clazz.cast(statusReason())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "CompletionTime": return Optional.ofNullable(clazz.cast(completionTime())); case "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); case "RoleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "EndpointMetadata": return Optional.ofNullable(clazz.cast(endpointMetadata())); case "ModelVariants": return Optional.ofNullable(clazz.cast(modelVariants())); case "DataStorageConfig": return Optional.ofNullable(clazz.cast(dataStorageConfig())); case "ShadowModeConfig": return Optional.ofNullable(clazz.cast(shadowModeConfig())); case "KmsKey": return Optional.ofNullable(clazz.cast(kmsKey())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeInferenceExperimentResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerResponse.Builder, SdkPojo, CopyableBuilder { /** *

      * The ARN of the inference experiment being described. *

      * * @param arn * The ARN of the inference experiment being described. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

      * The name of the inference experiment. *

      * * @param name * The name of the inference experiment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

      * The type of the inference experiment. *

      * * @param type * The type of the inference experiment. * @see InferenceExperimentType * @return Returns a reference to this object so that method calls can be chained together. * @see InferenceExperimentType */ Builder type(String type); /** *

      * The type of the inference experiment. *

      * * @param type * The type of the inference experiment. * @see InferenceExperimentType * @return Returns a reference to this object so that method calls can be chained together. * @see InferenceExperimentType */ Builder type(InferenceExperimentType type); /** *

      * The duration for which the inference experiment ran or will run. *

      * * @param schedule * The duration for which the inference experiment ran or will run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder schedule(InferenceExperimentSchedule schedule); /** *

      * The duration for which the inference experiment ran or will run. *

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

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

      * The status of the inference experiment. The following are the possible statuses for an inference experiment: *

      *
        *
      • *

        * Creating - Amazon SageMaker is creating your experiment. *

        *
      • *
      • *

        * Created - Amazon SageMaker has finished the creation of your experiment and will begin the * experiment at the scheduled time. *

        *
      • *
      • *

        * Updating - When you make changes to your experiment, your experiment shows as updating. *

        *
      • *
      • *

        * Starting - Amazon SageMaker is beginning your experiment. *

        *
      • *
      • *

        * Running - Your experiment is in progress. *

        *
      • *
      • *

        * Stopping - Amazon SageMaker is stopping your experiment. *

        *
      • *
      • *

        * Completed - Your experiment has completed. *

        *
      • *
      • *

        * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as cancelled. *

        *
      • *
      * * @param status * The status of the inference experiment. The following are the possible statuses for an inference * experiment:

      *
        *
      • *

        * Creating - Amazon SageMaker is creating your experiment. *

        *
      • *
      • *

        * Created - Amazon SageMaker has finished the creation of your experiment and will begin * the experiment at the scheduled time. *

        *
      • *
      • *

        * Updating - When you make changes to your experiment, your experiment shows as updating. *

        *
      • *
      • *

        * Starting - Amazon SageMaker is beginning your experiment. *

        *
      • *
      • *

        * Running - Your experiment is in progress. *

        *
      • *
      • *

        * Stopping - Amazon SageMaker is stopping your experiment. *

        *
      • *
      • *

        * Completed - Your experiment has completed. *

        *
      • *
      • *

        * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as * cancelled. *

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

        * The status of the inference experiment. The following are the possible statuses for an inference experiment: *

        *
          *
        • *

          * Creating - Amazon SageMaker is creating your experiment. *

          *
        • *
        • *

          * Created - Amazon SageMaker has finished the creation of your experiment and will begin the * experiment at the scheduled time. *

          *
        • *
        • *

          * Updating - When you make changes to your experiment, your experiment shows as updating. *

          *
        • *
        • *

          * Starting - Amazon SageMaker is beginning your experiment. *

          *
        • *
        • *

          * Running - Your experiment is in progress. *

          *
        • *
        • *

          * Stopping - Amazon SageMaker is stopping your experiment. *

          *
        • *
        • *

          * Completed - Your experiment has completed. *

          *
        • *
        • *

          * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as cancelled. *

          *
        • *
        * * @param status * The status of the inference experiment. The following are the possible statuses for an inference * experiment:

        *
          *
        • *

          * Creating - Amazon SageMaker is creating your experiment. *

          *
        • *
        • *

          * Created - Amazon SageMaker has finished the creation of your experiment and will begin * the experiment at the scheduled time. *

          *
        • *
        • *

          * Updating - When you make changes to your experiment, your experiment shows as updating. *

          *
        • *
        • *

          * Starting - Amazon SageMaker is beginning your experiment. *

          *
        • *
        • *

          * Running - Your experiment is in progress. *

          *
        • *
        • *

          * Stopping - Amazon SageMaker is stopping your experiment. *

          *
        • *
        • *

          * Completed - Your experiment has completed. *

          *
        • *
        • *

          * Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as * cancelled. *

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

          * The error message or client-specified Reason from the StopInferenceExperiment API, that explains the status of the inference experiment. *

          * * @param statusReason * The error message or client-specified Reason from the StopInferenceExperiment API, that explains the status of the inference experiment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusReason(String statusReason); /** *

          * The description of the inference experiment. *

          * * @param description * The description of the inference experiment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

          * The timestamp at which you created the inference experiment. *

          * * @param creationTime * The timestamp at which you created the inference experiment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

          * The timestamp at which the inference experiment was completed. *

          * * @param completionTime * The timestamp at which the inference experiment was completed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder completionTime(Instant completionTime); /** *

          * The timestamp at which you last modified the inference experiment. *

          * * @param lastModifiedTime * The timestamp at which you last modified the inference experiment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTime(Instant lastModifiedTime); /** *

          * The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and * manage Amazon SageMaker Inference endpoints for model deployment. *

          * * @param roleArn * The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container * images, and manage Amazon SageMaker Inference endpoints for model deployment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

          * The metadata of the endpoint on which the inference experiment ran. *

          * * @param endpointMetadata * The metadata of the endpoint on which the inference experiment ran. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpointMetadata(EndpointMetadata endpointMetadata); /** *

          * The metadata of the endpoint on which the inference experiment ran. *

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

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

          * An array of ModelVariantConfigSummary objects. There is one for each variant in the inference * experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure * configuration for deploying the corresponding variant. *

          * * @param modelVariants * An array of ModelVariantConfigSummary objects. There is one for each variant in the * inference experiment. Each ModelVariantConfigSummary object in the array describes the * infrastructure configuration for deploying the corresponding variant. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelVariants(Collection modelVariants); /** *

          * An array of ModelVariantConfigSummary objects. There is one for each variant in the inference * experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure * configuration for deploying the corresponding variant. *

          * * @param modelVariants * An array of ModelVariantConfigSummary objects. There is one for each variant in the * inference experiment. Each ModelVariantConfigSummary object in the array describes the * infrastructure configuration for deploying the corresponding variant. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelVariants(ModelVariantConfigSummary... modelVariants); /** *

          * An array of ModelVariantConfigSummary objects. There is one for each variant in the inference * experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure * configuration for deploying the corresponding variant. *

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

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

          * The Amazon S3 location and configuration for storing inference request and response data. *

          * * @param dataStorageConfig * The Amazon S3 location and configuration for storing inference request and response data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataStorageConfig(InferenceExperimentDataStorageConfig dataStorageConfig); /** *

          * The Amazon S3 location and configuration for storing inference request and response data. *

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

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

          * The configuration of ShadowMode inference experiment type, which shows the production variant * that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a * percentage of the inference requests. For the shadow variant it also shows the percentage of requests that * Amazon SageMaker replicates. *

          * * @param shadowModeConfig * The configuration of ShadowMode inference experiment type, which shows the production * variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker * replicates a percentage of the inference requests. For the shadow variant it also shows the percentage * of requests that Amazon SageMaker replicates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder shadowModeConfig(ShadowModeConfig shadowModeConfig); /** *

          * The configuration of ShadowMode inference experiment type, which shows the production variant * that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a * percentage of the inference requests. For the shadow variant it also shows the percentage of requests that * Amazon SageMaker replicates. *

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

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

          * The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses to * encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. For more * information, see CreateInferenceExperiment. *

          * * @param kmsKey * The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker * uses to encrypt data on the storage volume attached to the ML compute instance that hosts the * endpoint. For more information, see CreateInferenceExperiment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKey(String kmsKey); } static final class BuilderImpl extends SageMakerResponse.BuilderImpl implements Builder { private String arn; private String name; private String type; private InferenceExperimentSchedule schedule; private String status; private String statusReason; private String description; private Instant creationTime; private Instant completionTime; private Instant lastModifiedTime; private String roleArn; private EndpointMetadata endpointMetadata; private List modelVariants = DefaultSdkAutoConstructList.getInstance(); private InferenceExperimentDataStorageConfig dataStorageConfig; private ShadowModeConfig shadowModeConfig; private String kmsKey; private BuilderImpl() { } private BuilderImpl(DescribeInferenceExperimentResponse model) { super(model); arn(model.arn); name(model.name); type(model.type); schedule(model.schedule); status(model.status); statusReason(model.statusReason); description(model.description); creationTime(model.creationTime); completionTime(model.completionTime); lastModifiedTime(model.lastModifiedTime); roleArn(model.roleArn); endpointMetadata(model.endpointMetadata); modelVariants(model.modelVariants); dataStorageConfig(model.dataStorageConfig); shadowModeConfig(model.shadowModeConfig); kmsKey(model.kmsKey); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(InferenceExperimentType type) { this.type(type == null ? null : type.toString()); return this; } public final InferenceExperimentSchedule.Builder getSchedule() { return schedule != null ? schedule.toBuilder() : null; } public final void setSchedule(InferenceExperimentSchedule.BuilderImpl schedule) { this.schedule = schedule != null ? schedule.build() : null; } @Override public final Builder schedule(InferenceExperimentSchedule schedule) { this.schedule = schedule; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(InferenceExperimentStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusReason() { return statusReason; } public final void setStatusReason(String statusReason) { this.statusReason = statusReason; } @Override public final Builder statusReason(String statusReason) { this.statusReason = statusReason; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getCompletionTime() { return completionTime; } public final void setCompletionTime(Instant completionTime) { this.completionTime = completionTime; } @Override public final Builder completionTime(Instant completionTime) { this.completionTime = completionTime; return this; } public final Instant getLastModifiedTime() { return lastModifiedTime; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } @Override public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final EndpointMetadata.Builder getEndpointMetadata() { return endpointMetadata != null ? endpointMetadata.toBuilder() : null; } public final void setEndpointMetadata(EndpointMetadata.BuilderImpl endpointMetadata) { this.endpointMetadata = endpointMetadata != null ? endpointMetadata.build() : null; } @Override public final Builder endpointMetadata(EndpointMetadata endpointMetadata) { this.endpointMetadata = endpointMetadata; return this; } public final List getModelVariants() { List result = ModelVariantConfigSummaryListCopier .copyToBuilder(this.modelVariants); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setModelVariants(Collection modelVariants) { this.modelVariants = ModelVariantConfigSummaryListCopier.copyFromBuilder(modelVariants); } @Override public final Builder modelVariants(Collection modelVariants) { this.modelVariants = ModelVariantConfigSummaryListCopier.copy(modelVariants); return this; } @Override @SafeVarargs public final Builder modelVariants(ModelVariantConfigSummary... modelVariants) { modelVariants(Arrays.asList(modelVariants)); return this; } @Override @SafeVarargs public final Builder modelVariants(Consumer... modelVariants) { modelVariants(Stream.of(modelVariants).map(c -> ModelVariantConfigSummary.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final InferenceExperimentDataStorageConfig.Builder getDataStorageConfig() { return dataStorageConfig != null ? dataStorageConfig.toBuilder() : null; } public final void setDataStorageConfig(InferenceExperimentDataStorageConfig.BuilderImpl dataStorageConfig) { this.dataStorageConfig = dataStorageConfig != null ? dataStorageConfig.build() : null; } @Override public final Builder dataStorageConfig(InferenceExperimentDataStorageConfig dataStorageConfig) { this.dataStorageConfig = dataStorageConfig; return this; } public final ShadowModeConfig.Builder getShadowModeConfig() { return shadowModeConfig != null ? shadowModeConfig.toBuilder() : null; } public final void setShadowModeConfig(ShadowModeConfig.BuilderImpl shadowModeConfig) { this.shadowModeConfig = shadowModeConfig != null ? shadowModeConfig.build() : null; } @Override public final Builder shadowModeConfig(ShadowModeConfig shadowModeConfig) { this.shadowModeConfig = shadowModeConfig; return this; } public final String getKmsKey() { return kmsKey; } public final void setKmsKey(String kmsKey) { this.kmsKey = kmsKey; } @Override public final Builder kmsKey(String kmsKey) { this.kmsKey = kmsKey; return this; } @Override public DescribeInferenceExperimentResponse build() { return new DescribeInferenceExperimentResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy