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