
software.amazon.awssdk.services.sagemaker.model.InferenceSpecification 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.io.Serializable;
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;
/**
*
* Defines how to perform inference generation after a training job is run.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class InferenceSpecification implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField> CONTAINERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Containers")
.getter(getter(InferenceSpecification::containers))
.setter(setter(Builder::containers))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Containers").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ModelPackageContainerDefinition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SUPPORTED_TRANSFORM_INSTANCE_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedTransformInstanceTypes")
.getter(getter(InferenceSpecification::supportedTransformInstanceTypesAsStrings))
.setter(setter(Builder::supportedTransformInstanceTypesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedTransformInstanceTypes")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SUPPORTED_REALTIME_INFERENCE_INSTANCE_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedRealtimeInferenceInstanceTypes")
.getter(getter(InferenceSpecification::supportedRealtimeInferenceInstanceTypesAsStrings))
.setter(setter(Builder::supportedRealtimeInferenceInstanceTypesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("SupportedRealtimeInferenceInstanceTypes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SUPPORTED_CONTENT_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedContentTypes")
.getter(getter(InferenceSpecification::supportedContentTypes))
.setter(setter(Builder::supportedContentTypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedContentTypes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SUPPORTED_RESPONSE_MIME_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedResponseMIMETypes")
.getter(getter(InferenceSpecification::supportedResponseMIMETypes))
.setter(setter(Builder::supportedResponseMIMETypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedResponseMIMETypes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONTAINERS_FIELD,
SUPPORTED_TRANSFORM_INSTANCE_TYPES_FIELD, SUPPORTED_REALTIME_INFERENCE_INSTANCE_TYPES_FIELD,
SUPPORTED_CONTENT_TYPES_FIELD, SUPPORTED_RESPONSE_MIME_TYPES_FIELD));
private static final long serialVersionUID = 1L;
private final List containers;
private final List supportedTransformInstanceTypes;
private final List supportedRealtimeInferenceInstanceTypes;
private final List supportedContentTypes;
private final List supportedResponseMIMETypes;
private InferenceSpecification(BuilderImpl builder) {
this.containers = builder.containers;
this.supportedTransformInstanceTypes = builder.supportedTransformInstanceTypes;
this.supportedRealtimeInferenceInstanceTypes = builder.supportedRealtimeInferenceInstanceTypes;
this.supportedContentTypes = builder.supportedContentTypes;
this.supportedResponseMIMETypes = builder.supportedResponseMIMETypes;
}
/**
* Returns true if the Containers property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasContainers() {
return containers != null && !(containers instanceof SdkAutoConstructList);
}
/**
*
* The Amazon ECR registry path of the Docker image that contains the inference code.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasContainers()} to see if a value was sent in this field.
*
*
* @return The Amazon ECR registry path of the Docker image that contains the inference code.
*/
public final List containers() {
return containers;
}
/**
*
* A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSupportedTransformInstanceTypes()} to see if a value was sent in this field.
*
*
* @return A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
* This parameter is required for unversioned models, and optional for versioned models.
*/
public final List supportedTransformInstanceTypes() {
return TransformInstanceTypesCopier.copyStringToEnum(supportedTransformInstanceTypes);
}
/**
* Returns true if the SupportedTransformInstanceTypes property was specified by the sender (it may be empty), or
* false if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender
* is the AWS service.
*/
public final boolean hasSupportedTransformInstanceTypes() {
return supportedTransformInstanceTypes != null && !(supportedTransformInstanceTypes instanceof SdkAutoConstructList);
}
/**
*
* A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSupportedTransformInstanceTypes()} to see if a value was sent in this field.
*
*
* @return A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
* This parameter is required for unversioned models, and optional for versioned models.
*/
public final List supportedTransformInstanceTypesAsStrings() {
return supportedTransformInstanceTypes;
}
/**
*
* A list of the instance types that are used to generate inferences in real-time.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSupportedRealtimeInferenceInstanceTypes()} to see if a value was sent in this field.
*
*
* @return A list of the instance types that are used to generate inferences in real-time.
*
* This parameter is required for unversioned models, and optional for versioned models.
*/
public final List supportedRealtimeInferenceInstanceTypes() {
return RealtimeInferenceInstanceTypesCopier.copyStringToEnum(supportedRealtimeInferenceInstanceTypes);
}
/**
* Returns true if the SupportedRealtimeInferenceInstanceTypes property was specified by the sender (it may be
* empty), or false if the sender did not specify the value (it will be empty). For responses returned by the SDK,
* the sender is the AWS service.
*/
public final boolean hasSupportedRealtimeInferenceInstanceTypes() {
return supportedRealtimeInferenceInstanceTypes != null
&& !(supportedRealtimeInferenceInstanceTypes instanceof SdkAutoConstructList);
}
/**
*
* A list of the instance types that are used to generate inferences in real-time.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSupportedRealtimeInferenceInstanceTypes()} to see if a value was sent in this field.
*
*
* @return A list of the instance types that are used to generate inferences in real-time.
*
* This parameter is required for unversioned models, and optional for versioned models.
*/
public final List supportedRealtimeInferenceInstanceTypesAsStrings() {
return supportedRealtimeInferenceInstanceTypes;
}
/**
* Returns true if the SupportedContentTypes property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasSupportedContentTypes() {
return supportedContentTypes != null && !(supportedContentTypes instanceof SdkAutoConstructList);
}
/**
*
* The supported MIME types for the input data.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSupportedContentTypes()} to see if a value was sent in this field.
*
*
* @return The supported MIME types for the input data.
*/
public final List supportedContentTypes() {
return supportedContentTypes;
}
/**
* Returns true if the SupportedResponseMIMETypes property was specified by the sender (it may be empty), or false
* if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the
* AWS service.
*/
public final boolean hasSupportedResponseMIMETypes() {
return supportedResponseMIMETypes != null && !(supportedResponseMIMETypes instanceof SdkAutoConstructList);
}
/**
*
* The supported MIME types for the output data.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSupportedResponseMIMETypes()} to see if a value was sent in this field.
*
*
* @return The supported MIME types for the output data.
*/
public final List supportedResponseMIMETypes() {
return supportedResponseMIMETypes;
}
@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 + Objects.hashCode(hasContainers() ? containers() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasSupportedTransformInstanceTypes() ? supportedTransformInstanceTypesAsStrings() : null);
hashCode = 31
* hashCode
+ Objects
.hashCode(hasSupportedRealtimeInferenceInstanceTypes() ? supportedRealtimeInferenceInstanceTypesAsStrings()
: null);
hashCode = 31 * hashCode + Objects.hashCode(hasSupportedContentTypes() ? supportedContentTypes() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSupportedResponseMIMETypes() ? supportedResponseMIMETypes() : null);
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 InferenceSpecification)) {
return false;
}
InferenceSpecification other = (InferenceSpecification) obj;
return hasContainers() == other.hasContainers()
&& Objects.equals(containers(), other.containers())
&& hasSupportedTransformInstanceTypes() == other.hasSupportedTransformInstanceTypes()
&& Objects.equals(supportedTransformInstanceTypesAsStrings(), other.supportedTransformInstanceTypesAsStrings())
&& hasSupportedRealtimeInferenceInstanceTypes() == other.hasSupportedRealtimeInferenceInstanceTypes()
&& Objects.equals(supportedRealtimeInferenceInstanceTypesAsStrings(),
other.supportedRealtimeInferenceInstanceTypesAsStrings())
&& hasSupportedContentTypes() == other.hasSupportedContentTypes()
&& Objects.equals(supportedContentTypes(), other.supportedContentTypes())
&& hasSupportedResponseMIMETypes() == other.hasSupportedResponseMIMETypes()
&& Objects.equals(supportedResponseMIMETypes(), other.supportedResponseMIMETypes());
}
/**
* 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("InferenceSpecification")
.add("Containers", hasContainers() ? containers() : null)
.add("SupportedTransformInstanceTypes",
hasSupportedTransformInstanceTypes() ? supportedTransformInstanceTypesAsStrings() : null)
.add("SupportedRealtimeInferenceInstanceTypes",
hasSupportedRealtimeInferenceInstanceTypes() ? supportedRealtimeInferenceInstanceTypesAsStrings() : null)
.add("SupportedContentTypes", hasSupportedContentTypes() ? supportedContentTypes() : null)
.add("SupportedResponseMIMETypes", hasSupportedResponseMIMETypes() ? supportedResponseMIMETypes() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Containers":
return Optional.ofNullable(clazz.cast(containers()));
case "SupportedTransformInstanceTypes":
return Optional.ofNullable(clazz.cast(supportedTransformInstanceTypesAsStrings()));
case "SupportedRealtimeInferenceInstanceTypes":
return Optional.ofNullable(clazz.cast(supportedRealtimeInferenceInstanceTypesAsStrings()));
case "SupportedContentTypes":
return Optional.ofNullable(clazz.cast(supportedContentTypes()));
case "SupportedResponseMIMETypes":
return Optional.ofNullable(clazz.cast(supportedResponseMIMETypes()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedTransformInstanceTypesWithStrings(Collection supportedTransformInstanceTypes);
/**
*
* A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedTransformInstanceTypes
* A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedTransformInstanceTypesWithStrings(String... supportedTransformInstanceTypes);
/**
*
* A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedTransformInstanceTypes
* A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedTransformInstanceTypes(Collection supportedTransformInstanceTypes);
/**
*
* A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedTransformInstanceTypes
* A list of the instance types on which a transformation job can be run or on which an endpoint can be
* deployed.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedTransformInstanceTypes(TransformInstanceType... supportedTransformInstanceTypes);
/**
*
* A list of the instance types that are used to generate inferences in real-time.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedRealtimeInferenceInstanceTypes
* A list of the instance types that are used to generate inferences in real-time.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedRealtimeInferenceInstanceTypesWithStrings(Collection supportedRealtimeInferenceInstanceTypes);
/**
*
* A list of the instance types that are used to generate inferences in real-time.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedRealtimeInferenceInstanceTypes
* A list of the instance types that are used to generate inferences in real-time.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedRealtimeInferenceInstanceTypesWithStrings(String... supportedRealtimeInferenceInstanceTypes);
/**
*
* A list of the instance types that are used to generate inferences in real-time.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedRealtimeInferenceInstanceTypes
* A list of the instance types that are used to generate inferences in real-time.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedRealtimeInferenceInstanceTypes(
Collection supportedRealtimeInferenceInstanceTypes);
/**
*
* A list of the instance types that are used to generate inferences in real-time.
*
*
* This parameter is required for unversioned models, and optional for versioned models.
*
*
* @param supportedRealtimeInferenceInstanceTypes
* A list of the instance types that are used to generate inferences in real-time.
*
* This parameter is required for unversioned models, and optional for versioned models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedRealtimeInferenceInstanceTypes(ProductionVariantInstanceType... supportedRealtimeInferenceInstanceTypes);
/**
*
* The supported MIME types for the input data.
*
*
* @param supportedContentTypes
* The supported MIME types for the input data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedContentTypes(Collection supportedContentTypes);
/**
*
* The supported MIME types for the input data.
*
*
* @param supportedContentTypes
* The supported MIME types for the input data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedContentTypes(String... supportedContentTypes);
/**
*
* The supported MIME types for the output data.
*
*
* @param supportedResponseMIMETypes
* The supported MIME types for the output data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedResponseMIMETypes(Collection supportedResponseMIMETypes);
/**
*
* The supported MIME types for the output data.
*
*
* @param supportedResponseMIMETypes
* The supported MIME types for the output data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedResponseMIMETypes(String... supportedResponseMIMETypes);
}
static final class BuilderImpl implements Builder {
private List containers = DefaultSdkAutoConstructList.getInstance();
private List supportedTransformInstanceTypes = DefaultSdkAutoConstructList.getInstance();
private List supportedRealtimeInferenceInstanceTypes = DefaultSdkAutoConstructList.getInstance();
private List supportedContentTypes = DefaultSdkAutoConstructList.getInstance();
private List supportedResponseMIMETypes = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(InferenceSpecification model) {
containers(model.containers);
supportedTransformInstanceTypesWithStrings(model.supportedTransformInstanceTypes);
supportedRealtimeInferenceInstanceTypesWithStrings(model.supportedRealtimeInferenceInstanceTypes);
supportedContentTypes(model.supportedContentTypes);
supportedResponseMIMETypes(model.supportedResponseMIMETypes);
}
public final List getContainers() {
List result = ModelPackageContainerDefinitionListCopier
.copyToBuilder(this.containers);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
@Override
public final Builder containers(Collection containers) {
this.containers = ModelPackageContainerDefinitionListCopier.copy(containers);
return this;
}
@Override
@SafeVarargs
public final Builder containers(ModelPackageContainerDefinition... containers) {
containers(Arrays.asList(containers));
return this;
}
@Override
@SafeVarargs
public final Builder containers(Consumer... containers) {
containers(Stream.of(containers).map(c -> ModelPackageContainerDefinition.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setContainers(Collection containers) {
this.containers = ModelPackageContainerDefinitionListCopier.copyFromBuilder(containers);
}
public final Collection getSupportedTransformInstanceTypes() {
if (supportedTransformInstanceTypes instanceof SdkAutoConstructList) {
return null;
}
return supportedTransformInstanceTypes;
}
@Override
public final Builder supportedTransformInstanceTypesWithStrings(Collection supportedTransformInstanceTypes) {
this.supportedTransformInstanceTypes = TransformInstanceTypesCopier.copy(supportedTransformInstanceTypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedTransformInstanceTypesWithStrings(String... supportedTransformInstanceTypes) {
supportedTransformInstanceTypesWithStrings(Arrays.asList(supportedTransformInstanceTypes));
return this;
}
@Override
public final Builder supportedTransformInstanceTypes(Collection supportedTransformInstanceTypes) {
this.supportedTransformInstanceTypes = TransformInstanceTypesCopier.copyEnumToString(supportedTransformInstanceTypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedTransformInstanceTypes(TransformInstanceType... supportedTransformInstanceTypes) {
supportedTransformInstanceTypes(Arrays.asList(supportedTransformInstanceTypes));
return this;
}
public final void setSupportedTransformInstanceTypes(Collection supportedTransformInstanceTypes) {
this.supportedTransformInstanceTypes = TransformInstanceTypesCopier.copy(supportedTransformInstanceTypes);
}
public final Collection getSupportedRealtimeInferenceInstanceTypes() {
if (supportedRealtimeInferenceInstanceTypes instanceof SdkAutoConstructList) {
return null;
}
return supportedRealtimeInferenceInstanceTypes;
}
@Override
public final Builder supportedRealtimeInferenceInstanceTypesWithStrings(
Collection supportedRealtimeInferenceInstanceTypes) {
this.supportedRealtimeInferenceInstanceTypes = RealtimeInferenceInstanceTypesCopier
.copy(supportedRealtimeInferenceInstanceTypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedRealtimeInferenceInstanceTypesWithStrings(String... supportedRealtimeInferenceInstanceTypes) {
supportedRealtimeInferenceInstanceTypesWithStrings(Arrays.asList(supportedRealtimeInferenceInstanceTypes));
return this;
}
@Override
public final Builder supportedRealtimeInferenceInstanceTypes(
Collection supportedRealtimeInferenceInstanceTypes) {
this.supportedRealtimeInferenceInstanceTypes = RealtimeInferenceInstanceTypesCopier
.copyEnumToString(supportedRealtimeInferenceInstanceTypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedRealtimeInferenceInstanceTypes(
ProductionVariantInstanceType... supportedRealtimeInferenceInstanceTypes) {
supportedRealtimeInferenceInstanceTypes(Arrays.asList(supportedRealtimeInferenceInstanceTypes));
return this;
}
public final void setSupportedRealtimeInferenceInstanceTypes(Collection supportedRealtimeInferenceInstanceTypes) {
this.supportedRealtimeInferenceInstanceTypes = RealtimeInferenceInstanceTypesCopier
.copy(supportedRealtimeInferenceInstanceTypes);
}
public final Collection getSupportedContentTypes() {
if (supportedContentTypes instanceof SdkAutoConstructList) {
return null;
}
return supportedContentTypes;
}
@Override
public final Builder supportedContentTypes(Collection supportedContentTypes) {
this.supportedContentTypes = ContentTypesCopier.copy(supportedContentTypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedContentTypes(String... supportedContentTypes) {
supportedContentTypes(Arrays.asList(supportedContentTypes));
return this;
}
public final void setSupportedContentTypes(Collection supportedContentTypes) {
this.supportedContentTypes = ContentTypesCopier.copy(supportedContentTypes);
}
public final Collection getSupportedResponseMIMETypes() {
if (supportedResponseMIMETypes instanceof SdkAutoConstructList) {
return null;
}
return supportedResponseMIMETypes;
}
@Override
public final Builder supportedResponseMIMETypes(Collection supportedResponseMIMETypes) {
this.supportedResponseMIMETypes = ResponseMIMETypesCopier.copy(supportedResponseMIMETypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedResponseMIMETypes(String... supportedResponseMIMETypes) {
supportedResponseMIMETypes(Arrays.asList(supportedResponseMIMETypes));
return this;
}
public final void setSupportedResponseMIMETypes(Collection supportedResponseMIMETypes) {
this.supportedResponseMIMETypes = ResponseMIMETypesCopier.copy(supportedResponseMIMETypes);
}
@Override
public InferenceSpecification build() {
return new InferenceSpecification(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}