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

software.amazon.awssdk.services.sagemaker.model.ActionSummary 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.30.1
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;

/**
 * 

* Lists the properties of an action. An action represents an action or activity. Some examples are a workflow * step and a model deployment. Generally, an action involves at least one input artifact or output artifact. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ActionSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionArn").getter(getter(ActionSummary::actionArn)).setter(setter(Builder::actionArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionArn").build()).build(); private static final SdkField ACTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionName").getter(getter(ActionSummary::actionName)).setter(setter(Builder::actionName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionName").build()).build(); private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Source").getter(getter(ActionSummary::source)).setter(setter(Builder::source)) .constructor(ActionSource::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build(); private static final SdkField ACTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionType").getter(getter(ActionSummary::actionType)).setter(setter(Builder::actionType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionType").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ActionSummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTime").getter(getter(ActionSummary::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(ActionSummary::lastModifiedTime)) .setter(setter(Builder::lastModifiedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_ARN_FIELD, ACTION_NAME_FIELD, SOURCE_FIELD, ACTION_TYPE_FIELD, STATUS_FIELD, CREATION_TIME_FIELD, LAST_MODIFIED_TIME_FIELD)); private static final long serialVersionUID = 1L; private final String actionArn; private final String actionName; private final ActionSource source; private final String actionType; private final String status; private final Instant creationTime; private final Instant lastModifiedTime; private ActionSummary(BuilderImpl builder) { this.actionArn = builder.actionArn; this.actionName = builder.actionName; this.source = builder.source; this.actionType = builder.actionType; this.status = builder.status; this.creationTime = builder.creationTime; this.lastModifiedTime = builder.lastModifiedTime; } /** *

* The Amazon Resource Name (ARN) of the action. *

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

* The name of the action. *

* * @return The name of the action. */ public final String actionName() { return actionName; } /** *

* The source of the action. *

* * @return The source of the action. */ public final ActionSource source() { return source; } /** *

* The type of the action. *

* * @return The type of the action. */ public final String actionType() { return actionType; } /** *

* The status of the action. *

*

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

* * @return The status of the action. * @see ActionStatus */ public final ActionStatus status() { return ActionStatus.fromValue(status); } /** *

* The status of the action. *

*

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

* * @return The status of the action. * @see ActionStatus */ public final String statusAsString() { return status; } /** *

* When the action was created. *

* * @return When the action was created. */ public final Instant creationTime() { return creationTime; } /** *

* When the action was last modified. *

* * @return When the action was last modified. */ public final Instant lastModifiedTime() { return lastModifiedTime; } @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(actionArn()); hashCode = 31 * hashCode + Objects.hashCode(actionName()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(actionType()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); 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 ActionSummary)) { return false; } ActionSummary other = (ActionSummary) obj; return Objects.equals(actionArn(), other.actionArn()) && Objects.equals(actionName(), other.actionName()) && Objects.equals(source(), other.source()) && Objects.equals(actionType(), other.actionType()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()); } /** * 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("ActionSummary").add("ActionArn", actionArn()).add("ActionName", actionName()) .add("Source", source()).add("ActionType", actionType()).add("Status", statusAsString()) .add("CreationTime", creationTime()).add("LastModifiedTime", lastModifiedTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ActionArn": return Optional.ofNullable(clazz.cast(actionArn())); case "ActionName": return Optional.ofNullable(clazz.cast(actionName())); case "Source": return Optional.ofNullable(clazz.cast(source())); case "ActionType": return Optional.ofNullable(clazz.cast(actionType())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ActionSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the action. *

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

* The name of the action. *

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

* The source of the action. *

* * @param source * The source of the action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(ActionSource source); /** *

* The source of the action. *

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

* The type of the action. *

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

* The status of the action. *

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

* The status of the action. *

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

* When the action was created. *

* * @param creationTime * When the action was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* When the action was last modified. *

* * @param lastModifiedTime * When the action was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTime(Instant lastModifiedTime); } static final class BuilderImpl implements Builder { private String actionArn; private String actionName; private ActionSource source; private String actionType; private String status; private Instant creationTime; private Instant lastModifiedTime; private BuilderImpl() { } private BuilderImpl(ActionSummary model) { actionArn(model.actionArn); actionName(model.actionName); source(model.source); actionType(model.actionType); status(model.status); creationTime(model.creationTime); lastModifiedTime(model.lastModifiedTime); } public final String getActionArn() { return actionArn; } public final void setActionArn(String actionArn) { this.actionArn = actionArn; } @Override @Transient public final Builder actionArn(String actionArn) { this.actionArn = actionArn; return this; } public final String getActionName() { return actionName; } public final void setActionName(String actionName) { this.actionName = actionName; } @Override @Transient public final Builder actionName(String actionName) { this.actionName = actionName; return this; } public final ActionSource.Builder getSource() { return source != null ? source.toBuilder() : null; } public final void setSource(ActionSource.BuilderImpl source) { this.source = source != null ? source.build() : null; } @Override @Transient public final Builder source(ActionSource source) { this.source = source; return this; } public final String getActionType() { return actionType; } public final void setActionType(String actionType) { this.actionType = actionType; } @Override @Transient public final Builder actionType(String actionType) { this.actionType = actionType; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override @Transient public final Builder status(String status) { this.status = status; return this; } @Override @Transient public final Builder status(ActionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override @Transient public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getLastModifiedTime() { return lastModifiedTime; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } @Override @Transient public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; return this; } @Override public ActionSummary build() { return new ActionSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy