software.amazon.awssdk.services.sagemaker.model.DescribeCompilationJobResponse Maven / Gradle / Ivy
Show all versions of sagemaker Show documentation
/*
* 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.Consumer;
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 DescribeCompilationJobResponse extends SageMakerResponse implements
ToCopyableBuilder {
private static final SdkField COMPILATION_JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CompilationJobName").getter(getter(DescribeCompilationJobResponse::compilationJobName))
.setter(setter(Builder::compilationJobName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompilationJobName").build())
.build();
private static final SdkField COMPILATION_JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CompilationJobArn").getter(getter(DescribeCompilationJobResponse::compilationJobArn))
.setter(setter(Builder::compilationJobArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompilationJobArn").build()).build();
private static final SdkField COMPILATION_JOB_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CompilationJobStatus").getter(getter(DescribeCompilationJobResponse::compilationJobStatusAsString))
.setter(setter(Builder::compilationJobStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompilationJobStatus").build())
.build();
private static final SdkField COMPILATION_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CompilationStartTime").getter(getter(DescribeCompilationJobResponse::compilationStartTime))
.setter(setter(Builder::compilationStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompilationStartTime").build())
.build();
private static final SdkField COMPILATION_END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CompilationEndTime").getter(getter(DescribeCompilationJobResponse::compilationEndTime))
.setter(setter(Builder::compilationEndTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompilationEndTime").build())
.build();
private static final SdkField STOPPING_CONDITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("StoppingCondition")
.getter(getter(DescribeCompilationJobResponse::stoppingCondition)).setter(setter(Builder::stoppingCondition))
.constructor(StoppingCondition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StoppingCondition").build()).build();
private static final SdkField INFERENCE_IMAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("InferenceImage").getter(getter(DescribeCompilationJobResponse::inferenceImage))
.setter(setter(Builder::inferenceImage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InferenceImage").build()).build();
private static final SdkField MODEL_PACKAGE_VERSION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ModelPackageVersionArn").getter(getter(DescribeCompilationJobResponse::modelPackageVersionArn))
.setter(setter(Builder::modelPackageVersionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelPackageVersionArn").build())
.build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeCompilationJobResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(DescribeCompilationJobResponse::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailureReason").getter(getter(DescribeCompilationJobResponse::failureReason))
.setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build();
private static final SdkField MODEL_ARTIFACTS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ModelArtifacts")
.getter(getter(DescribeCompilationJobResponse::modelArtifacts)).setter(setter(Builder::modelArtifacts))
.constructor(ModelArtifacts::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelArtifacts").build()).build();
private static final SdkField MODEL_DIGESTS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("ModelDigests").getter(getter(DescribeCompilationJobResponse::modelDigests))
.setter(setter(Builder::modelDigests)).constructor(ModelDigests::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelDigests").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(DescribeCompilationJobResponse::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final SdkField INPUT_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("InputConfig").getter(getter(DescribeCompilationJobResponse::inputConfig))
.setter(setter(Builder::inputConfig)).constructor(InputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputConfig").build()).build();
private static final SdkField OUTPUT_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("OutputConfig").getter(getter(DescribeCompilationJobResponse::outputConfig))
.setter(setter(Builder::outputConfig)).constructor(OutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputConfig").build()).build();
private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("VpcConfig").getter(getter(DescribeCompilationJobResponse::vpcConfig)).setter(setter(Builder::vpcConfig))
.constructor(NeoVpcConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfig").build()).build();
private static final SdkField DERIVED_INFORMATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DerivedInformation")
.getter(getter(DescribeCompilationJobResponse::derivedInformation)).setter(setter(Builder::derivedInformation))
.constructor(DerivedInformation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DerivedInformation").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(COMPILATION_JOB_NAME_FIELD,
COMPILATION_JOB_ARN_FIELD, COMPILATION_JOB_STATUS_FIELD, COMPILATION_START_TIME_FIELD, COMPILATION_END_TIME_FIELD,
STOPPING_CONDITION_FIELD, INFERENCE_IMAGE_FIELD, MODEL_PACKAGE_VERSION_ARN_FIELD, CREATION_TIME_FIELD,
LAST_MODIFIED_TIME_FIELD, FAILURE_REASON_FIELD, MODEL_ARTIFACTS_FIELD, MODEL_DIGESTS_FIELD, ROLE_ARN_FIELD,
INPUT_CONFIG_FIELD, OUTPUT_CONFIG_FIELD, VPC_CONFIG_FIELD, DERIVED_INFORMATION_FIELD));
private final String compilationJobName;
private final String compilationJobArn;
private final String compilationJobStatus;
private final Instant compilationStartTime;
private final Instant compilationEndTime;
private final StoppingCondition stoppingCondition;
private final String inferenceImage;
private final String modelPackageVersionArn;
private final Instant creationTime;
private final Instant lastModifiedTime;
private final String failureReason;
private final ModelArtifacts modelArtifacts;
private final ModelDigests modelDigests;
private final String roleArn;
private final InputConfig inputConfig;
private final OutputConfig outputConfig;
private final NeoVpcConfig vpcConfig;
private final DerivedInformation derivedInformation;
private DescribeCompilationJobResponse(BuilderImpl builder) {
super(builder);
this.compilationJobName = builder.compilationJobName;
this.compilationJobArn = builder.compilationJobArn;
this.compilationJobStatus = builder.compilationJobStatus;
this.compilationStartTime = builder.compilationStartTime;
this.compilationEndTime = builder.compilationEndTime;
this.stoppingCondition = builder.stoppingCondition;
this.inferenceImage = builder.inferenceImage;
this.modelPackageVersionArn = builder.modelPackageVersionArn;
this.creationTime = builder.creationTime;
this.lastModifiedTime = builder.lastModifiedTime;
this.failureReason = builder.failureReason;
this.modelArtifacts = builder.modelArtifacts;
this.modelDigests = builder.modelDigests;
this.roleArn = builder.roleArn;
this.inputConfig = builder.inputConfig;
this.outputConfig = builder.outputConfig;
this.vpcConfig = builder.vpcConfig;
this.derivedInformation = builder.derivedInformation;
}
/**
*
* The name of the model compilation job.
*
*
* @return The name of the model compilation job.
*/
public final String compilationJobName() {
return compilationJobName;
}
/**
*
* The Amazon Resource Name (ARN) of the model compilation job.
*
*
* @return The Amazon Resource Name (ARN) of the model compilation job.
*/
public final String compilationJobArn() {
return compilationJobArn;
}
/**
*
* The status of the model compilation job.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #compilationJobStatus} will return {@link CompilationJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #compilationJobStatusAsString}.
*
*
* @return The status of the model compilation job.
* @see CompilationJobStatus
*/
public final CompilationJobStatus compilationJobStatus() {
return CompilationJobStatus.fromValue(compilationJobStatus);
}
/**
*
* The status of the model compilation job.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #compilationJobStatus} will return {@link CompilationJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #compilationJobStatusAsString}.
*
*
* @return The status of the model compilation job.
* @see CompilationJobStatus
*/
public final String compilationJobStatusAsString() {
return compilationJobStatus;
}
/**
*
* The time when the model compilation job started the CompilationJob
instances.
*
*
* You are billed for the time between this timestamp and the timestamp in the CompilationEndTime
* field. In Amazon CloudWatch Logs, the start time might be later than this time. That's because it takes time to
* download the compilation job, which depends on the size of the compilation job container.
*
*
* @return The time when the model compilation job started the CompilationJob
instances.
*
* You are billed for the time between this timestamp and the timestamp in the
* CompilationEndTime
field. In Amazon CloudWatch Logs, the start time might be later than this
* time. That's because it takes time to download the compilation job, which depends on the size of the
* compilation job container.
*/
public final Instant compilationStartTime() {
return compilationStartTime;
}
/**
*
* The time when the model compilation job on a compilation job instance ended. For a successful or stopped job,
* this is when the job's model artifacts have finished uploading. For a failed job, this is when Amazon SageMaker
* detected that the job failed.
*
*
* @return The time when the model compilation job on a compilation job instance ended. For a successful or stopped
* job, this is when the job's model artifacts have finished uploading. For a failed job, this is when
* Amazon SageMaker detected that the job failed.
*/
public final Instant compilationEndTime() {
return compilationEndTime;
}
/**
*
* Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon
* SageMaker ends the compilation job. Use this API to cap model training costs.
*
*
* @return Specifies a limit to how long a model compilation job can run. When the job reaches the time limit,
* Amazon SageMaker ends the compilation job. Use this API to cap model training costs.
*/
public final StoppingCondition stoppingCondition() {
return stoppingCondition;
}
/**
*
* The inference image to use when compiling a model. Specify an image only if the target device is a cloud
* instance.
*
*
* @return The inference image to use when compiling a model. Specify an image only if the target device is a cloud
* instance.
*/
public final String inferenceImage() {
return inferenceImage;
}
/**
*
* The Amazon Resource Name (ARN) of the versioned model package that was provided to SageMaker Neo when you
* initiated a compilation job.
*
*
* @return The Amazon Resource Name (ARN) of the versioned model package that was provided to SageMaker Neo when you
* initiated a compilation job.
*/
public final String modelPackageVersionArn() {
return modelPackageVersionArn;
}
/**
*
* The time that the model compilation job was created.
*
*
* @return The time that the model compilation job was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The time that the status of the model compilation job was last modified.
*
*
* @return The time that the status of the model compilation job was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* If a model compilation job failed, the reason it failed.
*
*
* @return If a model compilation job failed, the reason it failed.
*/
public final String failureReason() {
return failureReason;
}
/**
*
* Information about the location in Amazon S3 that has been configured for storing the model artifacts used in the
* compilation job.
*
*
* @return Information about the location in Amazon S3 that has been configured for storing the model artifacts used
* in the compilation job.
*/
public final ModelArtifacts modelArtifacts() {
return modelArtifacts;
}
/**
*
* Provides a BLAKE2 hash value that identifies the compiled model artifacts in Amazon S3.
*
*
* @return Provides a BLAKE2 hash value that identifies the compiled model artifacts in Amazon S3.
*/
public final ModelDigests modelDigests() {
return modelDigests;
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker assumes to perform the model compilation job.
*
*
* @return The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker assumes to perform the model
* compilation job.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* Information about the location in Amazon S3 of the input model artifacts, the name and shape of the expected data
* inputs, and the framework in which the model was trained.
*
*
* @return Information about the location in Amazon S3 of the input model artifacts, the name and shape of the
* expected data inputs, and the framework in which the model was trained.
*/
public final InputConfig inputConfig() {
return inputConfig;
}
/**
*
* Information about the output location for the compiled model and the target device that the model runs on.
*
*
* @return Information about the output location for the compiled model and the target device that the model runs
* on.
*/
public final OutputConfig outputConfig() {
return outputConfig;
}
/**
*
* A VpcConfig object
* that specifies the VPC that you want your compilation job to connect to. Control access to your models by
* configuring the VPC. For more information, see Protect Compilation Jobs by Using an Amazon
* Virtual Private Cloud.
*
*
* @return A VpcConfig
* object that specifies the VPC that you want your compilation job to connect to. Control access to your
* models by configuring the VPC. For more information, see Protect Compilation Jobs by Using an
* Amazon Virtual Private Cloud.
*/
public final NeoVpcConfig vpcConfig() {
return vpcConfig;
}
/**
*
* Information that SageMaker Neo automatically derived about the model.
*
*
* @return Information that SageMaker Neo automatically derived about the model.
*/
public final DerivedInformation derivedInformation() {
return derivedInformation;
}
@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(compilationJobName());
hashCode = 31 * hashCode + Objects.hashCode(compilationJobArn());
hashCode = 31 * hashCode + Objects.hashCode(compilationJobStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(compilationStartTime());
hashCode = 31 * hashCode + Objects.hashCode(compilationEndTime());
hashCode = 31 * hashCode + Objects.hashCode(stoppingCondition());
hashCode = 31 * hashCode + Objects.hashCode(inferenceImage());
hashCode = 31 * hashCode + Objects.hashCode(modelPackageVersionArn());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(modelArtifacts());
hashCode = 31 * hashCode + Objects.hashCode(modelDigests());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(inputConfig());
hashCode = 31 * hashCode + Objects.hashCode(outputConfig());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfig());
hashCode = 31 * hashCode + Objects.hashCode(derivedInformation());
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 DescribeCompilationJobResponse)) {
return false;
}
DescribeCompilationJobResponse other = (DescribeCompilationJobResponse) obj;
return Objects.equals(compilationJobName(), other.compilationJobName())
&& Objects.equals(compilationJobArn(), other.compilationJobArn())
&& Objects.equals(compilationJobStatusAsString(), other.compilationJobStatusAsString())
&& Objects.equals(compilationStartTime(), other.compilationStartTime())
&& Objects.equals(compilationEndTime(), other.compilationEndTime())
&& Objects.equals(stoppingCondition(), other.stoppingCondition())
&& Objects.equals(inferenceImage(), other.inferenceImage())
&& Objects.equals(modelPackageVersionArn(), other.modelPackageVersionArn())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(failureReason(), other.failureReason())
&& Objects.equals(modelArtifacts(), other.modelArtifacts())
&& Objects.equals(modelDigests(), other.modelDigests()) && Objects.equals(roleArn(), other.roleArn())
&& Objects.equals(inputConfig(), other.inputConfig()) && Objects.equals(outputConfig(), other.outputConfig())
&& Objects.equals(vpcConfig(), other.vpcConfig())
&& Objects.equals(derivedInformation(), other.derivedInformation());
}
/**
* 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("DescribeCompilationJobResponse").add("CompilationJobName", compilationJobName())
.add("CompilationJobArn", compilationJobArn()).add("CompilationJobStatus", compilationJobStatusAsString())
.add("CompilationStartTime", compilationStartTime()).add("CompilationEndTime", compilationEndTime())
.add("StoppingCondition", stoppingCondition()).add("InferenceImage", inferenceImage())
.add("ModelPackageVersionArn", modelPackageVersionArn()).add("CreationTime", creationTime())
.add("LastModifiedTime", lastModifiedTime()).add("FailureReason", failureReason())
.add("ModelArtifacts", modelArtifacts()).add("ModelDigests", modelDigests()).add("RoleArn", roleArn())
.add("InputConfig", inputConfig()).add("OutputConfig", outputConfig()).add("VpcConfig", vpcConfig())
.add("DerivedInformation", derivedInformation()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CompilationJobName":
return Optional.ofNullable(clazz.cast(compilationJobName()));
case "CompilationJobArn":
return Optional.ofNullable(clazz.cast(compilationJobArn()));
case "CompilationJobStatus":
return Optional.ofNullable(clazz.cast(compilationJobStatusAsString()));
case "CompilationStartTime":
return Optional.ofNullable(clazz.cast(compilationStartTime()));
case "CompilationEndTime":
return Optional.ofNullable(clazz.cast(compilationEndTime()));
case "StoppingCondition":
return Optional.ofNullable(clazz.cast(stoppingCondition()));
case "InferenceImage":
return Optional.ofNullable(clazz.cast(inferenceImage()));
case "ModelPackageVersionArn":
return Optional.ofNullable(clazz.cast(modelPackageVersionArn()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "FailureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "ModelArtifacts":
return Optional.ofNullable(clazz.cast(modelArtifacts()));
case "ModelDigests":
return Optional.ofNullable(clazz.cast(modelDigests()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "InputConfig":
return Optional.ofNullable(clazz.cast(inputConfig()));
case "OutputConfig":
return Optional.ofNullable(clazz.cast(outputConfig()));
case "VpcConfig":
return Optional.ofNullable(clazz.cast(vpcConfig()));
case "DerivedInformation":
return Optional.ofNullable(clazz.cast(derivedInformation()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function