
software.amazon.awssdk.services.sagemaker.model.DescribeImageVersionResponse 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.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
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.LocationTrait;
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 DescribeImageVersionResponse extends SageMakerResponse implements
ToCopyableBuilder {
private static final SdkField BASE_IMAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BaseImage").getter(getter(DescribeImageVersionResponse::baseImage)).setter(setter(Builder::baseImage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseImage").build()).build();
private static final SdkField CONTAINER_IMAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ContainerImage").getter(getter(DescribeImageVersionResponse::containerImage))
.setter(setter(Builder::containerImage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContainerImage").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeImageVersionResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailureReason").getter(getter(DescribeImageVersionResponse::failureReason))
.setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build();
private static final SdkField IMAGE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ImageArn").getter(getter(DescribeImageVersionResponse::imageArn)).setter(setter(Builder::imageArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageArn").build()).build();
private static final SdkField IMAGE_VERSION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ImageVersionArn").getter(getter(DescribeImageVersionResponse::imageVersionArn))
.setter(setter(Builder::imageVersionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageVersionArn").build()).build();
private static final SdkField IMAGE_VERSION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ImageVersionStatus").getter(getter(DescribeImageVersionResponse::imageVersionStatusAsString))
.setter(setter(Builder::imageVersionStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageVersionStatus").build())
.build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(DescribeImageVersionResponse::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Version").getter(getter(DescribeImageVersionResponse::version)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Version").build()).build();
private static final SdkField VENDOR_GUIDANCE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VendorGuidance").getter(getter(DescribeImageVersionResponse::vendorGuidanceAsString))
.setter(setter(Builder::vendorGuidance))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VendorGuidance").build()).build();
private static final SdkField JOB_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("JobType").getter(getter(DescribeImageVersionResponse::jobTypeAsString)).setter(setter(Builder::jobType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobType").build()).build();
private static final SdkField ML_FRAMEWORK_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MLFramework").getter(getter(DescribeImageVersionResponse::mlFramework))
.setter(setter(Builder::mlFramework))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MLFramework").build()).build();
private static final SdkField PROGRAMMING_LANG_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProgrammingLang").getter(getter(DescribeImageVersionResponse::programmingLang))
.setter(setter(Builder::programmingLang))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProgrammingLang").build()).build();
private static final SdkField PROCESSOR_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Processor").getter(getter(DescribeImageVersionResponse::processorAsString))
.setter(setter(Builder::processor))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Processor").build()).build();
private static final SdkField HOROVOD_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("Horovod").getter(getter(DescribeImageVersionResponse::horovod)).setter(setter(Builder::horovod))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Horovod").build()).build();
private static final SdkField RELEASE_NOTES_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReleaseNotes").getter(getter(DescribeImageVersionResponse::releaseNotes))
.setter(setter(Builder::releaseNotes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReleaseNotes").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASE_IMAGE_FIELD,
CONTAINER_IMAGE_FIELD, CREATION_TIME_FIELD, FAILURE_REASON_FIELD, IMAGE_ARN_FIELD, IMAGE_VERSION_ARN_FIELD,
IMAGE_VERSION_STATUS_FIELD, LAST_MODIFIED_TIME_FIELD, VERSION_FIELD, VENDOR_GUIDANCE_FIELD, JOB_TYPE_FIELD,
ML_FRAMEWORK_FIELD, PROGRAMMING_LANG_FIELD, PROCESSOR_FIELD, HOROVOD_FIELD, RELEASE_NOTES_FIELD));
private final String baseImage;
private final String containerImage;
private final Instant creationTime;
private final String failureReason;
private final String imageArn;
private final String imageVersionArn;
private final String imageVersionStatus;
private final Instant lastModifiedTime;
private final Integer version;
private final String vendorGuidance;
private final String jobType;
private final String mlFramework;
private final String programmingLang;
private final String processor;
private final Boolean horovod;
private final String releaseNotes;
private DescribeImageVersionResponse(BuilderImpl builder) {
super(builder);
this.baseImage = builder.baseImage;
this.containerImage = builder.containerImage;
this.creationTime = builder.creationTime;
this.failureReason = builder.failureReason;
this.imageArn = builder.imageArn;
this.imageVersionArn = builder.imageVersionArn;
this.imageVersionStatus = builder.imageVersionStatus;
this.lastModifiedTime = builder.lastModifiedTime;
this.version = builder.version;
this.vendorGuidance = builder.vendorGuidance;
this.jobType = builder.jobType;
this.mlFramework = builder.mlFramework;
this.programmingLang = builder.programmingLang;
this.processor = builder.processor;
this.horovod = builder.horovod;
this.releaseNotes = builder.releaseNotes;
}
/**
*
* The registry path of the container image on which this image version is based.
*
*
* @return The registry path of the container image on which this image version is based.
*/
public final String baseImage() {
return baseImage;
}
/**
*
* The registry path of the container image that contains this image version.
*
*
* @return The registry path of the container image that contains this image version.
*/
public final String containerImage() {
return containerImage;
}
/**
*
* When the version was created.
*
*
* @return When the version was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* When a create or delete operation fails, the reason for the failure.
*
*
* @return When a create or delete operation fails, the reason for the failure.
*/
public final String failureReason() {
return failureReason;
}
/**
*
* The ARN of the image the version is based on.
*
*
* @return The ARN of the image the version is based on.
*/
public final String imageArn() {
return imageArn;
}
/**
*
* The ARN of the version.
*
*
* @return The ARN of the version.
*/
public final String imageVersionArn() {
return imageVersionArn;
}
/**
*
* The status of the version.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #imageVersionStatus} will return {@link ImageVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #imageVersionStatusAsString}.
*
*
* @return The status of the version.
* @see ImageVersionStatus
*/
public final ImageVersionStatus imageVersionStatus() {
return ImageVersionStatus.fromValue(imageVersionStatus);
}
/**
*
* The status of the version.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #imageVersionStatus} will return {@link ImageVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #imageVersionStatusAsString}.
*
*
* @return The status of the version.
* @see ImageVersionStatus
*/
public final String imageVersionStatusAsString() {
return imageVersionStatus;
}
/**
*
* When the version was last modified.
*
*
* @return When the version was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* The version number.
*
*
* @return The version number.
*/
public final Integer version() {
return version;
}
/**
*
* The stability of the image version specified by the maintainer.
*
*
* -
*
* NOT_PROVIDED
: The maintainers did not provide a status for image version stability.
*
*
* -
*
* STABLE
: The image version is stable.
*
*
* -
*
* TO_BE_ARCHIVED
: The image version is set to be archived. Custom image versions that are set to be
* archived are automatically archived after three months.
*
*
* -
*
* ARCHIVED
: The image version is archived. Archived image versions are not searchable and are no
* longer actively supported.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #vendorGuidance}
* will return {@link VendorGuidance#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #vendorGuidanceAsString}.
*
*
* @return The stability of the image version specified by the maintainer.
*
* -
*
* NOT_PROVIDED
: The maintainers did not provide a status for image version stability.
*
*
* -
*
* STABLE
: The image version is stable.
*
*
* -
*
* TO_BE_ARCHIVED
: The image version is set to be archived. Custom image versions that are set
* to be archived are automatically archived after three months.
*
*
* -
*
* ARCHIVED
: The image version is archived. Archived image versions are not searchable and are
* no longer actively supported.
*
*
* @see VendorGuidance
*/
public final VendorGuidance vendorGuidance() {
return VendorGuidance.fromValue(vendorGuidance);
}
/**
*
* The stability of the image version specified by the maintainer.
*
*
* -
*
* NOT_PROVIDED
: The maintainers did not provide a status for image version stability.
*
*
* -
*
* STABLE
: The image version is stable.
*
*
* -
*
* TO_BE_ARCHIVED
: The image version is set to be archived. Custom image versions that are set to be
* archived are automatically archived after three months.
*
*
* -
*
* ARCHIVED
: The image version is archived. Archived image versions are not searchable and are no
* longer actively supported.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #vendorGuidance}
* will return {@link VendorGuidance#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #vendorGuidanceAsString}.
*
*
* @return The stability of the image version specified by the maintainer.
*
* -
*
* NOT_PROVIDED
: The maintainers did not provide a status for image version stability.
*
*
* -
*
* STABLE
: The image version is stable.
*
*
* -
*
* TO_BE_ARCHIVED
: The image version is set to be archived. Custom image versions that are set
* to be archived are automatically archived after three months.
*
*
* -
*
* ARCHIVED
: The image version is archived. Archived image versions are not searchable and are
* no longer actively supported.
*
*
* @see VendorGuidance
*/
public final String vendorGuidanceAsString() {
return vendorGuidance;
}
/**
*
* Indicates SageMaker job type compatibility.
*
*
* -
*
* TRAINING
: The image version is compatible with SageMaker training jobs.
*
*
* -
*
* INFERENCE
: The image version is compatible with SageMaker inference jobs.
*
*
* -
*
* NOTEBOOK_KERNEL
: The image version is compatible with SageMaker notebook kernels.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #jobType} will
* return {@link JobType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #jobTypeAsString}.
*
*
* @return Indicates SageMaker job type compatibility.
*
* -
*
* TRAINING
: The image version is compatible with SageMaker training jobs.
*
*
* -
*
* INFERENCE
: The image version is compatible with SageMaker inference jobs.
*
*
* -
*
* NOTEBOOK_KERNEL
: The image version is compatible with SageMaker notebook kernels.
*
*
* @see JobType
*/
public final JobType jobType() {
return JobType.fromValue(jobType);
}
/**
*
* Indicates SageMaker job type compatibility.
*
*
* -
*
* TRAINING
: The image version is compatible with SageMaker training jobs.
*
*
* -
*
* INFERENCE
: The image version is compatible with SageMaker inference jobs.
*
*
* -
*
* NOTEBOOK_KERNEL
: The image version is compatible with SageMaker notebook kernels.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #jobType} will
* return {@link JobType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #jobTypeAsString}.
*
*
* @return Indicates SageMaker job type compatibility.
*
* -
*
* TRAINING
: The image version is compatible with SageMaker training jobs.
*
*
* -
*
* INFERENCE
: The image version is compatible with SageMaker inference jobs.
*
*
* -
*
* NOTEBOOK_KERNEL
: The image version is compatible with SageMaker notebook kernels.
*
*
* @see JobType
*/
public final String jobTypeAsString() {
return jobType;
}
/**
*
* The machine learning framework vended in the image version.
*
*
* @return The machine learning framework vended in the image version.
*/
public final String mlFramework() {
return mlFramework;
}
/**
*
* The supported programming language and its version.
*
*
* @return The supported programming language and its version.
*/
public final String programmingLang() {
return programmingLang;
}
/**
*
* Indicates CPU or GPU compatibility.
*
*
* -
*
* CPU
: The image version is compatible with CPU.
*
*
* -
*
* GPU
: The image version is compatible with GPU.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #processor} will
* return {@link Processor#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #processorAsString}.
*
*
* @return Indicates CPU or GPU compatibility.
*
* -
*
* CPU
: The image version is compatible with CPU.
*
*
* -
*
* GPU
: The image version is compatible with GPU.
*
*
* @see Processor
*/
public final Processor processor() {
return Processor.fromValue(processor);
}
/**
*
* Indicates CPU or GPU compatibility.
*
*
* -
*
* CPU
: The image version is compatible with CPU.
*
*
* -
*
* GPU
: The image version is compatible with GPU.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #processor} will
* return {@link Processor#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #processorAsString}.
*
*
* @return Indicates CPU or GPU compatibility.
*
* -
*
* CPU
: The image version is compatible with CPU.
*
*
* -
*
* GPU
: The image version is compatible with GPU.
*
*
* @see Processor
*/
public final String processorAsString() {
return processor;
}
/**
*
* Indicates Horovod compatibility.
*
*
* @return Indicates Horovod compatibility.
*/
public final Boolean horovod() {
return horovod;
}
/**
*
* The maintainer description of the image version.
*
*
* @return The maintainer description of the image version.
*/
public final String releaseNotes() {
return releaseNotes;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(baseImage());
hashCode = 31 * hashCode + Objects.hashCode(containerImage());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(imageArn());
hashCode = 31 * hashCode + Objects.hashCode(imageVersionArn());
hashCode = 31 * hashCode + Objects.hashCode(imageVersionStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(version());
hashCode = 31 * hashCode + Objects.hashCode(vendorGuidanceAsString());
hashCode = 31 * hashCode + Objects.hashCode(jobTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(mlFramework());
hashCode = 31 * hashCode + Objects.hashCode(programmingLang());
hashCode = 31 * hashCode + Objects.hashCode(processorAsString());
hashCode = 31 * hashCode + Objects.hashCode(horovod());
hashCode = 31 * hashCode + Objects.hashCode(releaseNotes());
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 DescribeImageVersionResponse)) {
return false;
}
DescribeImageVersionResponse other = (DescribeImageVersionResponse) obj;
return Objects.equals(baseImage(), other.baseImage()) && Objects.equals(containerImage(), other.containerImage())
&& Objects.equals(creationTime(), other.creationTime()) && Objects.equals(failureReason(), other.failureReason())
&& Objects.equals(imageArn(), other.imageArn()) && Objects.equals(imageVersionArn(), other.imageVersionArn())
&& Objects.equals(imageVersionStatusAsString(), other.imageVersionStatusAsString())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(version(), other.version())
&& Objects.equals(vendorGuidanceAsString(), other.vendorGuidanceAsString())
&& Objects.equals(jobTypeAsString(), other.jobTypeAsString())
&& Objects.equals(mlFramework(), other.mlFramework())
&& Objects.equals(programmingLang(), other.programmingLang())
&& Objects.equals(processorAsString(), other.processorAsString()) && Objects.equals(horovod(), other.horovod())
&& Objects.equals(releaseNotes(), other.releaseNotes());
}
/**
* 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("DescribeImageVersionResponse").add("BaseImage", baseImage())
.add("ContainerImage", containerImage()).add("CreationTime", creationTime())
.add("FailureReason", failureReason()).add("ImageArn", imageArn()).add("ImageVersionArn", imageVersionArn())
.add("ImageVersionStatus", imageVersionStatusAsString()).add("LastModifiedTime", lastModifiedTime())
.add("Version", version()).add("VendorGuidance", vendorGuidanceAsString()).add("JobType", jobTypeAsString())
.add("MLFramework", mlFramework()).add("ProgrammingLang", programmingLang())
.add("Processor", processorAsString()).add("Horovod", horovod()).add("ReleaseNotes", releaseNotes()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BaseImage":
return Optional.ofNullable(clazz.cast(baseImage()));
case "ContainerImage":
return Optional.ofNullable(clazz.cast(containerImage()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "FailureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "ImageArn":
return Optional.ofNullable(clazz.cast(imageArn()));
case "ImageVersionArn":
return Optional.ofNullable(clazz.cast(imageVersionArn()));
case "ImageVersionStatus":
return Optional.ofNullable(clazz.cast(imageVersionStatusAsString()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "Version":
return Optional.ofNullable(clazz.cast(version()));
case "VendorGuidance":
return Optional.ofNullable(clazz.cast(vendorGuidanceAsString()));
case "JobType":
return Optional.ofNullable(clazz.cast(jobTypeAsString()));
case "MLFramework":
return Optional.ofNullable(clazz.cast(mlFramework()));
case "ProgrammingLang":
return Optional.ofNullable(clazz.cast(programmingLang()));
case "Processor":
return Optional.ofNullable(clazz.cast(processorAsString()));
case "Horovod":
return Optional.ofNullable(clazz.cast(horovod()));
case "ReleaseNotes":
return Optional.ofNullable(clazz.cast(releaseNotes()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function