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

software.amazon.awssdk.services.sagemaker.model.PipelineExecutionStep 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.29.39
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.beans.Transient;
import java.io.Serializable;
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;

/**
 * 

* An execution of a step in a pipeline. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PipelineExecutionStep implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField STEP_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StepName").getter(getter(PipelineExecutionStep::stepName)).setter(setter(Builder::stepName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StepName").build()).build(); private static final SdkField STEP_DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StepDisplayName").getter(getter(PipelineExecutionStep::stepDisplayName)) .setter(setter(Builder::stepDisplayName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StepDisplayName").build()).build(); private static final SdkField STEP_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StepDescription").getter(getter(PipelineExecutionStep::stepDescription)) .setter(setter(Builder::stepDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StepDescription").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(PipelineExecutionStep::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EndTime").getter(getter(PipelineExecutionStep::endTime)).setter(setter(Builder::endTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final SdkField STEP_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StepStatus").getter(getter(PipelineExecutionStep::stepStatusAsString)) .setter(setter(Builder::stepStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StepStatus").build()).build(); private static final SdkField CACHE_HIT_RESULT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("CacheHitResult") .getter(getter(PipelineExecutionStep::cacheHitResult)).setter(setter(Builder::cacheHitResult)) .constructor(CacheHitResult::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheHitResult").build()).build(); private static final SdkField ATTEMPT_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("AttemptCount").getter(getter(PipelineExecutionStep::attemptCount)).setter(setter(Builder::attemptCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttemptCount").build()).build(); private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FailureReason").getter(getter(PipelineExecutionStep::failureReason)) .setter(setter(Builder::failureReason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build(); private static final SdkField METADATA_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Metadata") .getter(getter(PipelineExecutionStep::metadata)).setter(setter(Builder::metadata)) .constructor(PipelineExecutionStepMetadata::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Metadata").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STEP_NAME_FIELD, STEP_DISPLAY_NAME_FIELD, STEP_DESCRIPTION_FIELD, START_TIME_FIELD, END_TIME_FIELD, STEP_STATUS_FIELD, CACHE_HIT_RESULT_FIELD, ATTEMPT_COUNT_FIELD, FAILURE_REASON_FIELD, METADATA_FIELD)); private static final long serialVersionUID = 1L; private final String stepName; private final String stepDisplayName; private final String stepDescription; private final Instant startTime; private final Instant endTime; private final String stepStatus; private final CacheHitResult cacheHitResult; private final Integer attemptCount; private final String failureReason; private final PipelineExecutionStepMetadata metadata; private PipelineExecutionStep(BuilderImpl builder) { this.stepName = builder.stepName; this.stepDisplayName = builder.stepDisplayName; this.stepDescription = builder.stepDescription; this.startTime = builder.startTime; this.endTime = builder.endTime; this.stepStatus = builder.stepStatus; this.cacheHitResult = builder.cacheHitResult; this.attemptCount = builder.attemptCount; this.failureReason = builder.failureReason; this.metadata = builder.metadata; } /** *

* The name of the step that is executed. *

* * @return The name of the step that is executed. */ public final String stepName() { return stepName; } /** *

* The display name of the step. *

* * @return The display name of the step. */ public final String stepDisplayName() { return stepDisplayName; } /** *

* The description of the step. *

* * @return The description of the step. */ public final String stepDescription() { return stepDescription; } /** *

* The time that the step started executing. *

* * @return The time that the step started executing. */ public final Instant startTime() { return startTime; } /** *

* The time that the step stopped executing. *

* * @return The time that the step stopped executing. */ public final Instant endTime() { return endTime; } /** *

* The status of the step execution. *

*

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

* * @return The status of the step execution. * @see StepStatus */ public final StepStatus stepStatus() { return StepStatus.fromValue(stepStatus); } /** *

* The status of the step execution. *

*

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

* * @return The status of the step execution. * @see StepStatus */ public final String stepStatusAsString() { return stepStatus; } /** *

* If this pipeline execution step was cached, details on the cache hit. *

* * @return If this pipeline execution step was cached, details on the cache hit. */ public final CacheHitResult cacheHitResult() { return cacheHitResult; } /** *

* The current attempt of the execution step. For more information, see Retry Policy for Amazon SageMaker Pipelines steps. *

* * @return The current attempt of the execution step. For more information, see Retry Policy for Amazon SageMaker Pipelines steps. */ public final Integer attemptCount() { return attemptCount; } /** *

* The reason why the step failed execution. This is only returned if the step failed its execution. *

* * @return The reason why the step failed execution. This is only returned if the step failed its execution. */ public final String failureReason() { return failureReason; } /** *

* Metadata for the step execution. *

* * @return Metadata for the step execution. */ public final PipelineExecutionStepMetadata metadata() { return metadata; } @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(stepName()); hashCode = 31 * hashCode + Objects.hashCode(stepDisplayName()); hashCode = 31 * hashCode + Objects.hashCode(stepDescription()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(stepStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(cacheHitResult()); hashCode = 31 * hashCode + Objects.hashCode(attemptCount()); hashCode = 31 * hashCode + Objects.hashCode(failureReason()); hashCode = 31 * hashCode + Objects.hashCode(metadata()); 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 PipelineExecutionStep)) { return false; } PipelineExecutionStep other = (PipelineExecutionStep) obj; return Objects.equals(stepName(), other.stepName()) && Objects.equals(stepDisplayName(), other.stepDisplayName()) && Objects.equals(stepDescription(), other.stepDescription()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(stepStatusAsString(), other.stepStatusAsString()) && Objects.equals(cacheHitResult(), other.cacheHitResult()) && Objects.equals(attemptCount(), other.attemptCount()) && Objects.equals(failureReason(), other.failureReason()) && Objects.equals(metadata(), other.metadata()); } /** * 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("PipelineExecutionStep").add("StepName", stepName()).add("StepDisplayName", stepDisplayName()) .add("StepDescription", stepDescription()).add("StartTime", startTime()).add("EndTime", endTime()) .add("StepStatus", stepStatusAsString()).add("CacheHitResult", cacheHitResult()) .add("AttemptCount", attemptCount()).add("FailureReason", failureReason()).add("Metadata", metadata()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "StepName": return Optional.ofNullable(clazz.cast(stepName())); case "StepDisplayName": return Optional.ofNullable(clazz.cast(stepDisplayName())); case "StepDescription": return Optional.ofNullable(clazz.cast(stepDescription())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "StepStatus": return Optional.ofNullable(clazz.cast(stepStatusAsString())); case "CacheHitResult": return Optional.ofNullable(clazz.cast(cacheHitResult())); case "AttemptCount": return Optional.ofNullable(clazz.cast(attemptCount())); case "FailureReason": return Optional.ofNullable(clazz.cast(failureReason())); case "Metadata": return Optional.ofNullable(clazz.cast(metadata())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((PipelineExecutionStep) 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 step that is executed. *

* * @param stepName * The name of the step that is executed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stepName(String stepName); /** *

* The display name of the step. *

* * @param stepDisplayName * The display name of the step. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stepDisplayName(String stepDisplayName); /** *

* The description of the step. *

* * @param stepDescription * The description of the step. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stepDescription(String stepDescription); /** *

* The time that the step started executing. *

* * @param startTime * The time that the step started executing. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The time that the step stopped executing. *

* * @param endTime * The time that the step stopped executing. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* The status of the step execution. *

* * @param stepStatus * The status of the step execution. * @see StepStatus * @return Returns a reference to this object so that method calls can be chained together. * @see StepStatus */ Builder stepStatus(String stepStatus); /** *

* The status of the step execution. *

* * @param stepStatus * The status of the step execution. * @see StepStatus * @return Returns a reference to this object so that method calls can be chained together. * @see StepStatus */ Builder stepStatus(StepStatus stepStatus); /** *

* If this pipeline execution step was cached, details on the cache hit. *

* * @param cacheHitResult * If this pipeline execution step was cached, details on the cache hit. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheHitResult(CacheHitResult cacheHitResult); /** *

* If this pipeline execution step was cached, details on the cache hit. *

* This is a convenience that creates an instance of the {@link CacheHitResult.Builder} avoiding the need to * create one manually via {@link CacheHitResult#builder()}. * * When the {@link Consumer} completes, {@link CacheHitResult.Builder#build()} is called immediately and its * result is passed to {@link #cacheHitResult(CacheHitResult)}. * * @param cacheHitResult * a consumer that will call methods on {@link CacheHitResult.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #cacheHitResult(CacheHitResult) */ default Builder cacheHitResult(Consumer cacheHitResult) { return cacheHitResult(CacheHitResult.builder().applyMutation(cacheHitResult).build()); } /** *

* The current attempt of the execution step. For more information, see Retry Policy for Amazon SageMaker Pipelines steps. *

* * @param attemptCount * The current attempt of the execution step. For more information, see Retry Policy for Amazon SageMaker Pipelines steps. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attemptCount(Integer attemptCount); /** *

* The reason why the step failed execution. This is only returned if the step failed its execution. *

* * @param failureReason * The reason why the step failed execution. This is only returned if the step failed its execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReason(String failureReason); /** *

* Metadata for the step execution. *

* * @param metadata * Metadata for the step execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metadata(PipelineExecutionStepMetadata metadata); /** *

* Metadata for the step execution. *

* This is a convenience that creates an instance of the {@link PipelineExecutionStepMetadata.Builder} avoiding * the need to create one manually via {@link PipelineExecutionStepMetadata#builder()}. * * When the {@link Consumer} completes, {@link PipelineExecutionStepMetadata.Builder#build()} is called * immediately and its result is passed to {@link #metadata(PipelineExecutionStepMetadata)}. * * @param metadata * a consumer that will call methods on {@link PipelineExecutionStepMetadata.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #metadata(PipelineExecutionStepMetadata) */ default Builder metadata(Consumer metadata) { return metadata(PipelineExecutionStepMetadata.builder().applyMutation(metadata).build()); } } static final class BuilderImpl implements Builder { private String stepName; private String stepDisplayName; private String stepDescription; private Instant startTime; private Instant endTime; private String stepStatus; private CacheHitResult cacheHitResult; private Integer attemptCount; private String failureReason; private PipelineExecutionStepMetadata metadata; private BuilderImpl() { } private BuilderImpl(PipelineExecutionStep model) { stepName(model.stepName); stepDisplayName(model.stepDisplayName); stepDescription(model.stepDescription); startTime(model.startTime); endTime(model.endTime); stepStatus(model.stepStatus); cacheHitResult(model.cacheHitResult); attemptCount(model.attemptCount); failureReason(model.failureReason); metadata(model.metadata); } public final String getStepName() { return stepName; } public final void setStepName(String stepName) { this.stepName = stepName; } @Override @Transient public final Builder stepName(String stepName) { this.stepName = stepName; return this; } public final String getStepDisplayName() { return stepDisplayName; } public final void setStepDisplayName(String stepDisplayName) { this.stepDisplayName = stepDisplayName; } @Override @Transient public final Builder stepDisplayName(String stepDisplayName) { this.stepDisplayName = stepDisplayName; return this; } public final String getStepDescription() { return stepDescription; } public final void setStepDescription(String stepDescription) { this.stepDescription = stepDescription; } @Override @Transient public final Builder stepDescription(String stepDescription) { this.stepDescription = stepDescription; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override @Transient public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override @Transient public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final String getStepStatus() { return stepStatus; } public final void setStepStatus(String stepStatus) { this.stepStatus = stepStatus; } @Override @Transient public final Builder stepStatus(String stepStatus) { this.stepStatus = stepStatus; return this; } @Override @Transient public final Builder stepStatus(StepStatus stepStatus) { this.stepStatus(stepStatus == null ? null : stepStatus.toString()); return this; } public final CacheHitResult.Builder getCacheHitResult() { return cacheHitResult != null ? cacheHitResult.toBuilder() : null; } public final void setCacheHitResult(CacheHitResult.BuilderImpl cacheHitResult) { this.cacheHitResult = cacheHitResult != null ? cacheHitResult.build() : null; } @Override @Transient public final Builder cacheHitResult(CacheHitResult cacheHitResult) { this.cacheHitResult = cacheHitResult; return this; } public final Integer getAttemptCount() { return attemptCount; } public final void setAttemptCount(Integer attemptCount) { this.attemptCount = attemptCount; } @Override @Transient public final Builder attemptCount(Integer attemptCount) { this.attemptCount = attemptCount; return this; } public final String getFailureReason() { return failureReason; } public final void setFailureReason(String failureReason) { this.failureReason = failureReason; } @Override @Transient public final Builder failureReason(String failureReason) { this.failureReason = failureReason; return this; } public final PipelineExecutionStepMetadata.Builder getMetadata() { return metadata != null ? metadata.toBuilder() : null; } public final void setMetadata(PipelineExecutionStepMetadata.BuilderImpl metadata) { this.metadata = metadata != null ? metadata.build() : null; } @Override @Transient public final Builder metadata(PipelineExecutionStepMetadata metadata) { this.metadata = metadata; return this; } @Override public PipelineExecutionStep build() { return new PipelineExecutionStep(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy