Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.sagemaker.model.ModelQualityAppSpecification 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
/*
* 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.Map;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Container image configuration object for the monitoring job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ModelQualityAppSpecification implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField IMAGE_URI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ImageUri").getter(getter(ModelQualityAppSpecification::imageUri)).setter(setter(Builder::imageUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageUri").build()).build();
private static final SdkField> CONTAINER_ENTRYPOINT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ContainerEntrypoint")
.getter(getter(ModelQualityAppSpecification::containerEntrypoint))
.setter(setter(Builder::containerEntrypoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContainerEntrypoint").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> CONTAINER_ARGUMENTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ContainerArguments")
.getter(getter(ModelQualityAppSpecification::containerArguments))
.setter(setter(Builder::containerArguments))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContainerArguments").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 RECORD_PREPROCESSOR_SOURCE_URI_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("RecordPreprocessorSourceUri")
.getter(getter(ModelQualityAppSpecification::recordPreprocessorSourceUri))
.setter(setter(Builder::recordPreprocessorSourceUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecordPreprocessorSourceUri")
.build()).build();
private static final SdkField POST_ANALYTICS_PROCESSOR_SOURCE_URI_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("PostAnalyticsProcessorSourceUri")
.getter(getter(ModelQualityAppSpecification::postAnalyticsProcessorSourceUri))
.setter(setter(Builder::postAnalyticsProcessorSourceUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PostAnalyticsProcessorSourceUri")
.build()).build();
private static final SdkField PROBLEM_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProblemType").getter(getter(ModelQualityAppSpecification::problemTypeAsString))
.setter(setter(Builder::problemType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProblemType").build()).build();
private static final SdkField> ENVIRONMENT_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Environment")
.getter(getter(ModelQualityAppSpecification::environment))
.setter(setter(Builder::environment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Environment").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IMAGE_URI_FIELD,
CONTAINER_ENTRYPOINT_FIELD, CONTAINER_ARGUMENTS_FIELD, RECORD_PREPROCESSOR_SOURCE_URI_FIELD,
POST_ANALYTICS_PROCESSOR_SOURCE_URI_FIELD, PROBLEM_TYPE_FIELD, ENVIRONMENT_FIELD));
private static final long serialVersionUID = 1L;
private final String imageUri;
private final List containerEntrypoint;
private final List containerArguments;
private final String recordPreprocessorSourceUri;
private final String postAnalyticsProcessorSourceUri;
private final String problemType;
private final Map environment;
private ModelQualityAppSpecification(BuilderImpl builder) {
this.imageUri = builder.imageUri;
this.containerEntrypoint = builder.containerEntrypoint;
this.containerArguments = builder.containerArguments;
this.recordPreprocessorSourceUri = builder.recordPreprocessorSourceUri;
this.postAnalyticsProcessorSourceUri = builder.postAnalyticsProcessorSourceUri;
this.problemType = builder.problemType;
this.environment = builder.environment;
}
/**
*
* The address of the container image that the monitoring job runs.
*
*
* @return The address of the container image that the monitoring job runs.
*/
public final String imageUri() {
return imageUri;
}
/**
* Returns true if the ContainerEntrypoint 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 hasContainerEntrypoint() {
return containerEntrypoint != null && !(containerEntrypoint instanceof SdkAutoConstructList);
}
/**
*
* Specifies the entrypoint for a container that the monitoring job runs.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasContainerEntrypoint()} to see if a value was sent in this field.
*
*
* @return Specifies the entrypoint for a container that the monitoring job runs.
*/
public final List containerEntrypoint() {
return containerEntrypoint;
}
/**
* Returns true if the ContainerArguments 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 hasContainerArguments() {
return containerArguments != null && !(containerArguments instanceof SdkAutoConstructList);
}
/**
*
* An array of arguments for the container used to run the monitoring job.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasContainerArguments()} to see if a value was sent in this field.
*
*
* @return An array of arguments for the container used to run the monitoring job.
*/
public final List containerArguments() {
return containerArguments;
}
/**
*
* An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode the payload
* and convert it into a flatted json so that the built-in container can use the converted data. Applicable only for
* the built-in (first party) containers.
*
*
* @return An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode the
* payload and convert it into a flatted json so that the built-in container can use the converted data.
* Applicable only for the built-in (first party) containers.
*/
public final String recordPreprocessorSourceUri() {
return recordPreprocessorSourceUri;
}
/**
*
* An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the built-in
* (first party) containers.
*
*
* @return An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the
* built-in (first party) containers.
*/
public final String postAnalyticsProcessorSourceUri() {
return postAnalyticsProcessorSourceUri;
}
/**
*
* The machine learning problem type of the model that the monitoring job monitors.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #problemType} will
* return {@link MonitoringProblemType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #problemTypeAsString}.
*
*
* @return The machine learning problem type of the model that the monitoring job monitors.
* @see MonitoringProblemType
*/
public final MonitoringProblemType problemType() {
return MonitoringProblemType.fromValue(problemType);
}
/**
*
* The machine learning problem type of the model that the monitoring job monitors.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #problemType} will
* return {@link MonitoringProblemType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #problemTypeAsString}.
*
*
* @return The machine learning problem type of the model that the monitoring job monitors.
* @see MonitoringProblemType
*/
public final String problemTypeAsString() {
return problemType;
}
/**
* Returns true if the Environment 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 hasEnvironment() {
return environment != null && !(environment instanceof SdkAutoConstructMap);
}
/**
*
* Sets the environment variables in the container that the monitoring job runs.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasEnvironment()} to see if a value was sent in this field.
*
*
* @return Sets the environment variables in the container that the monitoring job runs.
*/
public final Map environment() {
return environment;
}
@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(imageUri());
hashCode = 31 * hashCode + Objects.hashCode(hasContainerEntrypoint() ? containerEntrypoint() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasContainerArguments() ? containerArguments() : null);
hashCode = 31 * hashCode + Objects.hashCode(recordPreprocessorSourceUri());
hashCode = 31 * hashCode + Objects.hashCode(postAnalyticsProcessorSourceUri());
hashCode = 31 * hashCode + Objects.hashCode(problemTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasEnvironment() ? environment() : 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 ModelQualityAppSpecification)) {
return false;
}
ModelQualityAppSpecification other = (ModelQualityAppSpecification) obj;
return Objects.equals(imageUri(), other.imageUri()) && hasContainerEntrypoint() == other.hasContainerEntrypoint()
&& Objects.equals(containerEntrypoint(), other.containerEntrypoint())
&& hasContainerArguments() == other.hasContainerArguments()
&& Objects.equals(containerArguments(), other.containerArguments())
&& Objects.equals(recordPreprocessorSourceUri(), other.recordPreprocessorSourceUri())
&& Objects.equals(postAnalyticsProcessorSourceUri(), other.postAnalyticsProcessorSourceUri())
&& Objects.equals(problemTypeAsString(), other.problemTypeAsString())
&& hasEnvironment() == other.hasEnvironment() && Objects.equals(environment(), other.environment());
}
/**
* 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("ModelQualityAppSpecification").add("ImageUri", imageUri())
.add("ContainerEntrypoint", hasContainerEntrypoint() ? containerEntrypoint() : null)
.add("ContainerArguments", hasContainerArguments() ? containerArguments() : null)
.add("RecordPreprocessorSourceUri", recordPreprocessorSourceUri())
.add("PostAnalyticsProcessorSourceUri", postAnalyticsProcessorSourceUri())
.add("ProblemType", problemTypeAsString()).add("Environment", hasEnvironment() ? environment() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ImageUri":
return Optional.ofNullable(clazz.cast(imageUri()));
case "ContainerEntrypoint":
return Optional.ofNullable(clazz.cast(containerEntrypoint()));
case "ContainerArguments":
return Optional.ofNullable(clazz.cast(containerArguments()));
case "RecordPreprocessorSourceUri":
return Optional.ofNullable(clazz.cast(recordPreprocessorSourceUri()));
case "PostAnalyticsProcessorSourceUri":
return Optional.ofNullable(clazz.cast(postAnalyticsProcessorSourceUri()));
case "ProblemType":
return Optional.ofNullable(clazz.cast(problemTypeAsString()));
case "Environment":
return Optional.ofNullable(clazz.cast(environment()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((ModelQualityAppSpecification) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The address of the container image that the monitoring job runs.
*
*
* @param imageUri
* The address of the container image that the monitoring job runs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder imageUri(String imageUri);
/**
*
* Specifies the entrypoint for a container that the monitoring job runs.
*
*
* @param containerEntrypoint
* Specifies the entrypoint for a container that the monitoring job runs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder containerEntrypoint(Collection containerEntrypoint);
/**
*
* Specifies the entrypoint for a container that the monitoring job runs.
*
*
* @param containerEntrypoint
* Specifies the entrypoint for a container that the monitoring job runs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder containerEntrypoint(String... containerEntrypoint);
/**
*
* An array of arguments for the container used to run the monitoring job.
*
*
* @param containerArguments
* An array of arguments for the container used to run the monitoring job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder containerArguments(Collection containerArguments);
/**
*
* An array of arguments for the container used to run the monitoring job.
*
*
* @param containerArguments
* An array of arguments for the container used to run the monitoring job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder containerArguments(String... containerArguments);
/**
*
* An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode the
* payload and convert it into a flatted json so that the built-in container can use the converted data.
* Applicable only for the built-in (first party) containers.
*
*
* @param recordPreprocessorSourceUri
* An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode
* the payload and convert it into a flatted json so that the built-in container can use the converted
* data. Applicable only for the built-in (first party) containers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recordPreprocessorSourceUri(String recordPreprocessorSourceUri);
/**
*
* An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the
* built-in (first party) containers.
*
*
* @param postAnalyticsProcessorSourceUri
* An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the
* built-in (first party) containers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder postAnalyticsProcessorSourceUri(String postAnalyticsProcessorSourceUri);
/**
*
* The machine learning problem type of the model that the monitoring job monitors.
*
*
* @param problemType
* The machine learning problem type of the model that the monitoring job monitors.
* @see MonitoringProblemType
* @return Returns a reference to this object so that method calls can be chained together.
* @see MonitoringProblemType
*/
Builder problemType(String problemType);
/**
*
* The machine learning problem type of the model that the monitoring job monitors.
*
*
* @param problemType
* The machine learning problem type of the model that the monitoring job monitors.
* @see MonitoringProblemType
* @return Returns a reference to this object so that method calls can be chained together.
* @see MonitoringProblemType
*/
Builder problemType(MonitoringProblemType problemType);
/**
*
* Sets the environment variables in the container that the monitoring job runs.
*
*
* @param environment
* Sets the environment variables in the container that the monitoring job runs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder environment(Map environment);
}
static final class BuilderImpl implements Builder {
private String imageUri;
private List containerEntrypoint = DefaultSdkAutoConstructList.getInstance();
private List containerArguments = DefaultSdkAutoConstructList.getInstance();
private String recordPreprocessorSourceUri;
private String postAnalyticsProcessorSourceUri;
private String problemType;
private Map environment = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(ModelQualityAppSpecification model) {
imageUri(model.imageUri);
containerEntrypoint(model.containerEntrypoint);
containerArguments(model.containerArguments);
recordPreprocessorSourceUri(model.recordPreprocessorSourceUri);
postAnalyticsProcessorSourceUri(model.postAnalyticsProcessorSourceUri);
problemType(model.problemType);
environment(model.environment);
}
public final String getImageUri() {
return imageUri;
}
@Override
public final Builder imageUri(String imageUri) {
this.imageUri = imageUri;
return this;
}
public final void setImageUri(String imageUri) {
this.imageUri = imageUri;
}
public final Collection getContainerEntrypoint() {
if (containerEntrypoint instanceof SdkAutoConstructList) {
return null;
}
return containerEntrypoint;
}
@Override
public final Builder containerEntrypoint(Collection containerEntrypoint) {
this.containerEntrypoint = ContainerEntrypointCopier.copy(containerEntrypoint);
return this;
}
@Override
@SafeVarargs
public final Builder containerEntrypoint(String... containerEntrypoint) {
containerEntrypoint(Arrays.asList(containerEntrypoint));
return this;
}
public final void setContainerEntrypoint(Collection containerEntrypoint) {
this.containerEntrypoint = ContainerEntrypointCopier.copy(containerEntrypoint);
}
public final Collection getContainerArguments() {
if (containerArguments instanceof SdkAutoConstructList) {
return null;
}
return containerArguments;
}
@Override
public final Builder containerArguments(Collection containerArguments) {
this.containerArguments = MonitoringContainerArgumentsCopier.copy(containerArguments);
return this;
}
@Override
@SafeVarargs
public final Builder containerArguments(String... containerArguments) {
containerArguments(Arrays.asList(containerArguments));
return this;
}
public final void setContainerArguments(Collection containerArguments) {
this.containerArguments = MonitoringContainerArgumentsCopier.copy(containerArguments);
}
public final String getRecordPreprocessorSourceUri() {
return recordPreprocessorSourceUri;
}
@Override
public final Builder recordPreprocessorSourceUri(String recordPreprocessorSourceUri) {
this.recordPreprocessorSourceUri = recordPreprocessorSourceUri;
return this;
}
public final void setRecordPreprocessorSourceUri(String recordPreprocessorSourceUri) {
this.recordPreprocessorSourceUri = recordPreprocessorSourceUri;
}
public final String getPostAnalyticsProcessorSourceUri() {
return postAnalyticsProcessorSourceUri;
}
@Override
public final Builder postAnalyticsProcessorSourceUri(String postAnalyticsProcessorSourceUri) {
this.postAnalyticsProcessorSourceUri = postAnalyticsProcessorSourceUri;
return this;
}
public final void setPostAnalyticsProcessorSourceUri(String postAnalyticsProcessorSourceUri) {
this.postAnalyticsProcessorSourceUri = postAnalyticsProcessorSourceUri;
}
public final String getProblemType() {
return problemType;
}
@Override
public final Builder problemType(String problemType) {
this.problemType = problemType;
return this;
}
@Override
public final Builder problemType(MonitoringProblemType problemType) {
this.problemType(problemType == null ? null : problemType.toString());
return this;
}
public final void setProblemType(String problemType) {
this.problemType = problemType;
}
public final Map getEnvironment() {
if (environment instanceof SdkAutoConstructMap) {
return null;
}
return environment;
}
@Override
public final Builder environment(Map environment) {
this.environment = MonitoringEnvironmentMapCopier.copy(environment);
return this;
}
public final void setEnvironment(Map environment) {
this.environment = MonitoringEnvironmentMapCopier.copy(environment);
}
@Override
public ModelQualityAppSpecification build() {
return new ModelQualityAppSpecification(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}