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

software.amazon.awssdk.services.sagemaker.model.TrainingJobSummary 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.31.2
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.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.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;

/**
 * 

* Provides summary information about a training job. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TrainingJobSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TRAINING_JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobName").getter(getter(TrainingJobSummary::trainingJobName)) .setter(setter(Builder::trainingJobName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobName").build()).build(); private static final SdkField TRAINING_JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobArn").getter(getter(TrainingJobSummary::trainingJobArn)) .setter(setter(Builder::trainingJobArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobArn").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTime").getter(getter(TrainingJobSummary::creationTime)).setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build(); private static final SdkField TRAINING_END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("TrainingEndTime").getter(getter(TrainingJobSummary::trainingEndTime)) .setter(setter(Builder::trainingEndTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingEndTime").build()).build(); private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("LastModifiedTime").getter(getter(TrainingJobSummary::lastModifiedTime)) .setter(setter(Builder::lastModifiedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build(); private static final SdkField TRAINING_JOB_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobStatus").getter(getter(TrainingJobSummary::trainingJobStatusAsString)) .setter(setter(Builder::trainingJobStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobStatus").build()).build(); private static final SdkField SECONDARY_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SecondaryStatus").getter(getter(TrainingJobSummary::secondaryStatusAsString)) .setter(setter(Builder::secondaryStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecondaryStatus").build()).build(); private static final SdkField WARM_POOL_STATUS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("WarmPoolStatus") .getter(getter(TrainingJobSummary::warmPoolStatus)).setter(setter(Builder::warmPoolStatus)) .constructor(WarmPoolStatus::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WarmPoolStatus").build()).build(); private static final SdkField TRAINING_PLAN_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingPlanArn").getter(getter(TrainingJobSummary::trainingPlanArn)) .setter(setter(Builder::trainingPlanArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingPlanArn").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TRAINING_JOB_NAME_FIELD, TRAINING_JOB_ARN_FIELD, CREATION_TIME_FIELD, TRAINING_END_TIME_FIELD, LAST_MODIFIED_TIME_FIELD, TRAINING_JOB_STATUS_FIELD, SECONDARY_STATUS_FIELD, WARM_POOL_STATUS_FIELD, TRAINING_PLAN_ARN_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String trainingJobName; private final String trainingJobArn; private final Instant creationTime; private final Instant trainingEndTime; private final Instant lastModifiedTime; private final String trainingJobStatus; private final String secondaryStatus; private final WarmPoolStatus warmPoolStatus; private final String trainingPlanArn; private TrainingJobSummary(BuilderImpl builder) { this.trainingJobName = builder.trainingJobName; this.trainingJobArn = builder.trainingJobArn; this.creationTime = builder.creationTime; this.trainingEndTime = builder.trainingEndTime; this.lastModifiedTime = builder.lastModifiedTime; this.trainingJobStatus = builder.trainingJobStatus; this.secondaryStatus = builder.secondaryStatus; this.warmPoolStatus = builder.warmPoolStatus; this.trainingPlanArn = builder.trainingPlanArn; } /** *

* The name of the training job that you want a summary for. *

* * @return The name of the training job that you want a summary for. */ public final String trainingJobName() { return trainingJobName; } /** *

* The Amazon Resource Name (ARN) of the training job. *

* * @return The Amazon Resource Name (ARN) of the training job. */ public final String trainingJobArn() { return trainingJobArn; } /** *

* A timestamp that shows when the training job was created. *

* * @return A timestamp that shows when the training job was created. */ public final Instant creationTime() { return creationTime; } /** *

* A timestamp that shows when the training job ended. This field is set only if the training job has one of the * terminal statuses (Completed, Failed, or Stopped). *

* * @return A timestamp that shows when the training job ended. This field is set only if the training job has one of * the terminal statuses (Completed, Failed, or Stopped). */ public final Instant trainingEndTime() { return trainingEndTime; } /** *

* Timestamp when the training job was last modified. *

* * @return Timestamp when the training job was last modified. */ public final Instant lastModifiedTime() { return lastModifiedTime; } /** *

* The status of the training job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #trainingJobStatus} * will return {@link TrainingJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #trainingJobStatusAsString}. *

* * @return The status of the training job. * @see TrainingJobStatus */ public final TrainingJobStatus trainingJobStatus() { return TrainingJobStatus.fromValue(trainingJobStatus); } /** *

* The status of the training job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #trainingJobStatus} * will return {@link TrainingJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #trainingJobStatusAsString}. *

* * @return The status of the training job. * @see TrainingJobStatus */ public final String trainingJobStatusAsString() { return trainingJobStatus; } /** *

* The secondary status of the training job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #secondaryStatus} * will return {@link SecondaryStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #secondaryStatusAsString}. *

* * @return The secondary status of the training job. * @see SecondaryStatus */ public final SecondaryStatus secondaryStatus() { return SecondaryStatus.fromValue(secondaryStatus); } /** *

* The secondary status of the training job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #secondaryStatus} * will return {@link SecondaryStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #secondaryStatusAsString}. *

* * @return The secondary status of the training job. * @see SecondaryStatus */ public final String secondaryStatusAsString() { return secondaryStatus; } /** *

* The status of the warm pool associated with the training job. *

* * @return The status of the warm pool associated with the training job. */ public final WarmPoolStatus warmPoolStatus() { return warmPoolStatus; } /** *

* The Amazon Resource Name (ARN); of the training plan associated with this training job. *

*

* For more information about how to reserve GPU capacity for your SageMaker HyperPod clusters using Amazon * SageMaker Training Plan, see * CreateTrainingPlan * . *

* * @return The Amazon Resource Name (ARN); of the training plan associated with this training job.

*

* For more information about how to reserve GPU capacity for your SageMaker HyperPod clusters using Amazon * SageMaker Training Plan, see * CreateTrainingPlan . */ public final String trainingPlanArn() { return trainingPlanArn; } @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(trainingJobName()); hashCode = 31 * hashCode + Objects.hashCode(trainingJobArn()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingEndTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingJobStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(secondaryStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(warmPoolStatus()); hashCode = 31 * hashCode + Objects.hashCode(trainingPlanArn()); 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 TrainingJobSummary)) { return false; } TrainingJobSummary other = (TrainingJobSummary) obj; return Objects.equals(trainingJobName(), other.trainingJobName()) && Objects.equals(trainingJobArn(), other.trainingJobArn()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(trainingEndTime(), other.trainingEndTime()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(trainingJobStatusAsString(), other.trainingJobStatusAsString()) && Objects.equals(secondaryStatusAsString(), other.secondaryStatusAsString()) && Objects.equals(warmPoolStatus(), other.warmPoolStatus()) && Objects.equals(trainingPlanArn(), other.trainingPlanArn()); } /** * 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("TrainingJobSummary").add("TrainingJobName", trainingJobName()) .add("TrainingJobArn", trainingJobArn()).add("CreationTime", creationTime()) .add("TrainingEndTime", trainingEndTime()).add("LastModifiedTime", lastModifiedTime()) .add("TrainingJobStatus", trainingJobStatusAsString()).add("SecondaryStatus", secondaryStatusAsString()) .add("WarmPoolStatus", warmPoolStatus()).add("TrainingPlanArn", trainingPlanArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TrainingJobName": return Optional.ofNullable(clazz.cast(trainingJobName())); case "TrainingJobArn": return Optional.ofNullable(clazz.cast(trainingJobArn())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "TrainingEndTime": return Optional.ofNullable(clazz.cast(trainingEndTime())); case "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); case "TrainingJobStatus": return Optional.ofNullable(clazz.cast(trainingJobStatusAsString())); case "SecondaryStatus": return Optional.ofNullable(clazz.cast(secondaryStatusAsString())); case "WarmPoolStatus": return Optional.ofNullable(clazz.cast(warmPoolStatus())); case "TrainingPlanArn": return Optional.ofNullable(clazz.cast(trainingPlanArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("TrainingJobName", TRAINING_JOB_NAME_FIELD); map.put("TrainingJobArn", TRAINING_JOB_ARN_FIELD); map.put("CreationTime", CREATION_TIME_FIELD); map.put("TrainingEndTime", TRAINING_END_TIME_FIELD); map.put("LastModifiedTime", LAST_MODIFIED_TIME_FIELD); map.put("TrainingJobStatus", TRAINING_JOB_STATUS_FIELD); map.put("SecondaryStatus", SECONDARY_STATUS_FIELD); map.put("WarmPoolStatus", WARM_POOL_STATUS_FIELD); map.put("TrainingPlanArn", TRAINING_PLAN_ARN_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((TrainingJobSummary) 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 training job that you want a summary for. *

* * @param trainingJobName * The name of the training job that you want a summary for. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingJobName(String trainingJobName); /** *

* The Amazon Resource Name (ARN) of the training job. *

* * @param trainingJobArn * The Amazon Resource Name (ARN) of the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingJobArn(String trainingJobArn); /** *

* A timestamp that shows when the training job was created. *

* * @param creationTime * A timestamp that shows when the training job was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* A timestamp that shows when the training job ended. This field is set only if the training job has one of the * terminal statuses (Completed, Failed, or Stopped). *

* * @param trainingEndTime * A timestamp that shows when the training job ended. This field is set only if the training job has one * of the terminal statuses (Completed, Failed, or Stopped). * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingEndTime(Instant trainingEndTime); /** *

* Timestamp when the training job was last modified. *

* * @param lastModifiedTime * Timestamp when the training job was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTime(Instant lastModifiedTime); /** *

* The status of the training job. *

* * @param trainingJobStatus * The status of the training job. * @see TrainingJobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TrainingJobStatus */ Builder trainingJobStatus(String trainingJobStatus); /** *

* The status of the training job. *

* * @param trainingJobStatus * The status of the training job. * @see TrainingJobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TrainingJobStatus */ Builder trainingJobStatus(TrainingJobStatus trainingJobStatus); /** *

* The secondary status of the training job. *

* * @param secondaryStatus * The secondary status of the training job. * @see SecondaryStatus * @return Returns a reference to this object so that method calls can be chained together. * @see SecondaryStatus */ Builder secondaryStatus(String secondaryStatus); /** *

* The secondary status of the training job. *

* * @param secondaryStatus * The secondary status of the training job. * @see SecondaryStatus * @return Returns a reference to this object so that method calls can be chained together. * @see SecondaryStatus */ Builder secondaryStatus(SecondaryStatus secondaryStatus); /** *

* The status of the warm pool associated with the training job. *

* * @param warmPoolStatus * The status of the warm pool associated with the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder warmPoolStatus(WarmPoolStatus warmPoolStatus); /** *

* The status of the warm pool associated with the training job. *

* This is a convenience method that creates an instance of the {@link WarmPoolStatus.Builder} avoiding the need * to create one manually via {@link WarmPoolStatus#builder()}. * *

* When the {@link Consumer} completes, {@link WarmPoolStatus.Builder#build()} is called immediately and its * result is passed to {@link #warmPoolStatus(WarmPoolStatus)}. * * @param warmPoolStatus * a consumer that will call methods on {@link WarmPoolStatus.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #warmPoolStatus(WarmPoolStatus) */ default Builder warmPoolStatus(Consumer warmPoolStatus) { return warmPoolStatus(WarmPoolStatus.builder().applyMutation(warmPoolStatus).build()); } /** *

* The Amazon Resource Name (ARN); of the training plan associated with this training job. *

*

* For more information about how to reserve GPU capacity for your SageMaker HyperPod clusters using Amazon * SageMaker Training Plan, see * CreateTrainingPlan * . *

* * @param trainingPlanArn * The Amazon Resource Name (ARN); of the training plan associated with this training job.

*

* For more information about how to reserve GPU capacity for your SageMaker HyperPod clusters using * Amazon SageMaker Training Plan, see * CreateTrainingPlan . * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingPlanArn(String trainingPlanArn); } static final class BuilderImpl implements Builder { private String trainingJobName; private String trainingJobArn; private Instant creationTime; private Instant trainingEndTime; private Instant lastModifiedTime; private String trainingJobStatus; private String secondaryStatus; private WarmPoolStatus warmPoolStatus; private String trainingPlanArn; private BuilderImpl() { } private BuilderImpl(TrainingJobSummary model) { trainingJobName(model.trainingJobName); trainingJobArn(model.trainingJobArn); creationTime(model.creationTime); trainingEndTime(model.trainingEndTime); lastModifiedTime(model.lastModifiedTime); trainingJobStatus(model.trainingJobStatus); secondaryStatus(model.secondaryStatus); warmPoolStatus(model.warmPoolStatus); trainingPlanArn(model.trainingPlanArn); } public final String getTrainingJobName() { return trainingJobName; } public final void setTrainingJobName(String trainingJobName) { this.trainingJobName = trainingJobName; } @Override public final Builder trainingJobName(String trainingJobName) { this.trainingJobName = trainingJobName; return this; } public final String getTrainingJobArn() { return trainingJobArn; } public final void setTrainingJobArn(String trainingJobArn) { this.trainingJobArn = trainingJobArn; } @Override public final Builder trainingJobArn(String trainingJobArn) { this.trainingJobArn = trainingJobArn; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getTrainingEndTime() { return trainingEndTime; } public final void setTrainingEndTime(Instant trainingEndTime) { this.trainingEndTime = trainingEndTime; } @Override public final Builder trainingEndTime(Instant trainingEndTime) { this.trainingEndTime = trainingEndTime; return this; } public final Instant getLastModifiedTime() { return lastModifiedTime; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } @Override public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; return this; } public final String getTrainingJobStatus() { return trainingJobStatus; } public final void setTrainingJobStatus(String trainingJobStatus) { this.trainingJobStatus = trainingJobStatus; } @Override public final Builder trainingJobStatus(String trainingJobStatus) { this.trainingJobStatus = trainingJobStatus; return this; } @Override public final Builder trainingJobStatus(TrainingJobStatus trainingJobStatus) { this.trainingJobStatus(trainingJobStatus == null ? null : trainingJobStatus.toString()); return this; } public final String getSecondaryStatus() { return secondaryStatus; } public final void setSecondaryStatus(String secondaryStatus) { this.secondaryStatus = secondaryStatus; } @Override public final Builder secondaryStatus(String secondaryStatus) { this.secondaryStatus = secondaryStatus; return this; } @Override public final Builder secondaryStatus(SecondaryStatus secondaryStatus) { this.secondaryStatus(secondaryStatus == null ? null : secondaryStatus.toString()); return this; } public final WarmPoolStatus.Builder getWarmPoolStatus() { return warmPoolStatus != null ? warmPoolStatus.toBuilder() : null; } public final void setWarmPoolStatus(WarmPoolStatus.BuilderImpl warmPoolStatus) { this.warmPoolStatus = warmPoolStatus != null ? warmPoolStatus.build() : null; } @Override public final Builder warmPoolStatus(WarmPoolStatus warmPoolStatus) { this.warmPoolStatus = warmPoolStatus; return this; } public final String getTrainingPlanArn() { return trainingPlanArn; } public final void setTrainingPlanArn(String trainingPlanArn) { this.trainingPlanArn = trainingPlanArn; } @Override public final Builder trainingPlanArn(String trainingPlanArn) { this.trainingPlanArn = trainingPlanArn; return this; } @Override public TrainingJobSummary build() { return new TrainingJobSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy