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

software.amazon.awssdk.services.sagemaker.model.CustomImage 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.io.Serializable;
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;

/**
 * 

* A custom SageMaker image. For more information, see Bring your own SageMaker image. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CustomImage implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField IMAGE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ImageName").getter(getter(CustomImage::imageName)).setter(setter(Builder::imageName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageName").build()).build(); private static final SdkField IMAGE_VERSION_NUMBER_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("ImageVersionNumber").getter(getter(CustomImage::imageVersionNumber)) .setter(setter(Builder::imageVersionNumber)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageVersionNumber").build()) .build(); private static final SdkField APP_IMAGE_CONFIG_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AppImageConfigName").getter(getter(CustomImage::appImageConfigName)) .setter(setter(Builder::appImageConfigName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppImageConfigName").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IMAGE_NAME_FIELD, IMAGE_VERSION_NUMBER_FIELD, APP_IMAGE_CONFIG_NAME_FIELD)); private static final long serialVersionUID = 1L; private final String imageName; private final Integer imageVersionNumber; private final String appImageConfigName; private CustomImage(BuilderImpl builder) { this.imageName = builder.imageName; this.imageVersionNumber = builder.imageVersionNumber; this.appImageConfigName = builder.appImageConfigName; } /** *

* The name of the CustomImage. Must be unique to your account. *

* * @return The name of the CustomImage. Must be unique to your account. */ public final String imageName() { return imageName; } /** *

* The version number of the CustomImage. *

* * @return The version number of the CustomImage. */ public final Integer imageVersionNumber() { return imageVersionNumber; } /** *

* The name of the AppImageConfig. *

* * @return The name of the AppImageConfig. */ public final String appImageConfigName() { return appImageConfigName; } @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 + Objects.hashCode(imageName()); hashCode = 31 * hashCode + Objects.hashCode(imageVersionNumber()); hashCode = 31 * hashCode + Objects.hashCode(appImageConfigName()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CustomImage)) { return false; } CustomImage other = (CustomImage) obj; return Objects.equals(imageName(), other.imageName()) && Objects.equals(imageVersionNumber(), other.imageVersionNumber()) && Objects.equals(appImageConfigName(), other.appImageConfigName()); } /** * 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("CustomImage").add("ImageName", imageName()).add("ImageVersionNumber", imageVersionNumber()) .add("AppImageConfigName", appImageConfigName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ImageName": return Optional.ofNullable(clazz.cast(imageName())); case "ImageVersionNumber": return Optional.ofNullable(clazz.cast(imageVersionNumber())); case "AppImageConfigName": return Optional.ofNullable(clazz.cast(appImageConfigName())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CustomImage) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the CustomImage. Must be unique to your account. *

* * @param imageName * The name of the CustomImage. Must be unique to your account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageName(String imageName); /** *

* The version number of the CustomImage. *

* * @param imageVersionNumber * The version number of the CustomImage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageVersionNumber(Integer imageVersionNumber); /** *

* The name of the AppImageConfig. *

* * @param appImageConfigName * The name of the AppImageConfig. * @return Returns a reference to this object so that method calls can be chained together. */ Builder appImageConfigName(String appImageConfigName); } static final class BuilderImpl implements Builder { private String imageName; private Integer imageVersionNumber; private String appImageConfigName; private BuilderImpl() { } private BuilderImpl(CustomImage model) { imageName(model.imageName); imageVersionNumber(model.imageVersionNumber); appImageConfigName(model.appImageConfigName); } public final String getImageName() { return imageName; } public final void setImageName(String imageName) { this.imageName = imageName; } @Override public final Builder imageName(String imageName) { this.imageName = imageName; return this; } public final Integer getImageVersionNumber() { return imageVersionNumber; } public final void setImageVersionNumber(Integer imageVersionNumber) { this.imageVersionNumber = imageVersionNumber; } @Override public final Builder imageVersionNumber(Integer imageVersionNumber) { this.imageVersionNumber = imageVersionNumber; return this; } public final String getAppImageConfigName() { return appImageConfigName; } public final void setAppImageConfigName(String appImageConfigName) { this.appImageConfigName = appImageConfigName; } @Override public final Builder appImageConfigName(String appImageConfigName) { this.appImageConfigName = appImageConfigName; return this; } @Override public CustomImage build() { return new CustomImage(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy