software.amazon.awssdk.services.sfn.model.ExecutionListItem Maven / Gradle / Ivy
Show all versions of sfn 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.sfn.model;
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.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;
/**
*
* Contains details about an execution.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExecutionListItem implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField EXECUTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("executionArn").getter(getter(ExecutionListItem::executionArn)).setter(setter(Builder::executionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executionArn").build()).build();
private static final SdkField STATE_MACHINE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("stateMachineArn").getter(getter(ExecutionListItem::stateMachineArn))
.setter(setter(Builder::stateMachineArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stateMachineArn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(ExecutionListItem::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(ExecutionListItem::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField START_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("startDate").getter(getter(ExecutionListItem::startDate)).setter(setter(Builder::startDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startDate").build()).build();
private static final SdkField STOP_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("stopDate").getter(getter(ExecutionListItem::stopDate)).setter(setter(Builder::stopDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stopDate").build()).build();
private static final SdkField MAP_RUN_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("mapRunArn").getter(getter(ExecutionListItem::mapRunArn)).setter(setter(Builder::mapRunArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mapRunArn").build()).build();
private static final SdkField ITEM_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("itemCount").getter(getter(ExecutionListItem::itemCount)).setter(setter(Builder::itemCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("itemCount").build()).build();
private static final SdkField STATE_MACHINE_VERSION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("stateMachineVersionArn").getter(getter(ExecutionListItem::stateMachineVersionArn))
.setter(setter(Builder::stateMachineVersionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stateMachineVersionArn").build())
.build();
private static final SdkField STATE_MACHINE_ALIAS_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("stateMachineAliasArn").getter(getter(ExecutionListItem::stateMachineAliasArn))
.setter(setter(Builder::stateMachineAliasArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stateMachineAliasArn").build())
.build();
private static final SdkField REDRIVE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("redriveCount").getter(getter(ExecutionListItem::redriveCount)).setter(setter(Builder::redriveCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("redriveCount").build()).build();
private static final SdkField REDRIVE_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("redriveDate").getter(getter(ExecutionListItem::redriveDate)).setter(setter(Builder::redriveDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("redriveDate").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EXECUTION_ARN_FIELD,
STATE_MACHINE_ARN_FIELD, NAME_FIELD, STATUS_FIELD, START_DATE_FIELD, STOP_DATE_FIELD, MAP_RUN_ARN_FIELD,
ITEM_COUNT_FIELD, STATE_MACHINE_VERSION_ARN_FIELD, STATE_MACHINE_ALIAS_ARN_FIELD, REDRIVE_COUNT_FIELD,
REDRIVE_DATE_FIELD));
private static final long serialVersionUID = 1L;
private final String executionArn;
private final String stateMachineArn;
private final String name;
private final String status;
private final Instant startDate;
private final Instant stopDate;
private final String mapRunArn;
private final Integer itemCount;
private final String stateMachineVersionArn;
private final String stateMachineAliasArn;
private final Integer redriveCount;
private final Instant redriveDate;
private ExecutionListItem(BuilderImpl builder) {
this.executionArn = builder.executionArn;
this.stateMachineArn = builder.stateMachineArn;
this.name = builder.name;
this.status = builder.status;
this.startDate = builder.startDate;
this.stopDate = builder.stopDate;
this.mapRunArn = builder.mapRunArn;
this.itemCount = builder.itemCount;
this.stateMachineVersionArn = builder.stateMachineVersionArn;
this.stateMachineAliasArn = builder.stateMachineAliasArn;
this.redriveCount = builder.redriveCount;
this.redriveDate = builder.redriveDate;
}
/**
*
* The Amazon Resource Name (ARN) that identifies the execution.
*
*
* @return The Amazon Resource Name (ARN) that identifies the execution.
*/
public final String executionArn() {
return executionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the state machine that ran the execution.
*
*
* @return The Amazon Resource Name (ARN) of the state machine that ran the execution.
*/
public final String stateMachineArn() {
return stateMachineArn;
}
/**
*
* The name of the execution.
*
*
* A name must not contain:
*
*
* -
*
* white space
*
*
* -
*
* brackets < > { } [ ]
*
*
* -
*
* wildcard characters ? *
*
*
* -
*
* special characters " # % \ ^ | ~ ` $ & , ; : /
*
*
* -
*
* control characters (U+0000-001F
, U+007F-009F
)
*
*
*
*
* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.
*
*
* @return The name of the execution.
*
* A name must not contain:
*
*
* -
*
* white space
*
*
* -
*
* brackets < > { } [ ]
*
*
* -
*
* wildcard characters ? *
*
*
* -
*
* special characters " # % \ ^ | ~ ` $ & , ; : /
*
*
* -
*
* control characters (U+0000-001F
, U+007F-009F
)
*
*
*
*
* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.
*/
public final String name() {
return name;
}
/**
*
* The current status of the execution.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ExecutionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of the execution.
* @see ExecutionStatus
*/
public final ExecutionStatus status() {
return ExecutionStatus.fromValue(status);
}
/**
*
* The current status of the execution.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ExecutionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of the execution.
* @see ExecutionStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The date the execution started.
*
*
* @return The date the execution started.
*/
public final Instant startDate() {
return startDate;
}
/**
*
* If the execution already ended, the date the execution stopped.
*
*
* @return If the execution already ended, the date the execution stopped.
*/
public final Instant stopDate() {
return stopDate;
}
/**
*
* The Amazon Resource Name (ARN) of a Map Run. This field is returned only if mapRunArn
was specified
* in the ListExecutions
API action. If stateMachineArn
was specified in
* ListExecutions
, the mapRunArn
isn't returned.
*
*
* @return The Amazon Resource Name (ARN) of a Map Run. This field is returned only if mapRunArn
was
* specified in the ListExecutions
API action. If stateMachineArn
was specified in
* ListExecutions
, the mapRunArn
isn't returned.
*/
public final String mapRunArn() {
return mapRunArn;
}
/**
*
* The total number of items processed in a child workflow execution. This field is returned only if
* mapRunArn
was specified in the ListExecutions
API action. If
* stateMachineArn
was specified in ListExecutions
, the itemCount
field isn't
* returned.
*
*
* @return The total number of items processed in a child workflow execution. This field is returned only if
* mapRunArn
was specified in the ListExecutions
API action. If
* stateMachineArn
was specified in ListExecutions
, the itemCount
* field isn't returned.
*/
public final Integer itemCount() {
return itemCount;
}
/**
*
* The Amazon Resource Name (ARN) of the state machine version associated with the execution.
*
*
* If the state machine execution was started with an unqualified ARN, it returns null.
*
*
* If the execution was started using a stateMachineAliasArn
, both the
* stateMachineAliasArn
and stateMachineVersionArn
parameters contain the respective
* values.
*
*
* @return The Amazon Resource Name (ARN) of the state machine version associated with the execution.
*
* If the state machine execution was started with an unqualified ARN, it returns null.
*
*
* If the execution was started using a stateMachineAliasArn
, both the
* stateMachineAliasArn
and stateMachineVersionArn
parameters contain the
* respective values.
*/
public final String stateMachineVersionArn() {
return stateMachineVersionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the state machine alias used to start an execution.
*
*
* If the state machine execution was started with an unqualified ARN or a version ARN, it returns null.
*
*
* @return The Amazon Resource Name (ARN) of the state machine alias used to start an execution.
*
* If the state machine execution was started with an unqualified ARN or a version ARN, it returns null.
*/
public final String stateMachineAliasArn() {
return stateMachineAliasArn;
}
/**
*
* The number of times you've redriven an execution. If you have not yet redriven an execution, the
* redriveCount
is 0. This count is only updated when you successfully redrive an execution.
*
*
* @return The number of times you've redriven an execution. If you have not yet redriven an execution, the
* redriveCount
is 0. This count is only updated when you successfully redrive an execution.
*/
public final Integer redriveCount() {
return redriveCount;
}
/**
*
* The date the execution was last redriven.
*
*
* @return The date the execution was last redriven.
*/
public final Instant redriveDate() {
return redriveDate;
}
@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(executionArn());
hashCode = 31 * hashCode + Objects.hashCode(stateMachineArn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(startDate());
hashCode = 31 * hashCode + Objects.hashCode(stopDate());
hashCode = 31 * hashCode + Objects.hashCode(mapRunArn());
hashCode = 31 * hashCode + Objects.hashCode(itemCount());
hashCode = 31 * hashCode + Objects.hashCode(stateMachineVersionArn());
hashCode = 31 * hashCode + Objects.hashCode(stateMachineAliasArn());
hashCode = 31 * hashCode + Objects.hashCode(redriveCount());
hashCode = 31 * hashCode + Objects.hashCode(redriveDate());
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 ExecutionListItem)) {
return false;
}
ExecutionListItem other = (ExecutionListItem) obj;
return Objects.equals(executionArn(), other.executionArn()) && Objects.equals(stateMachineArn(), other.stateMachineArn())
&& Objects.equals(name(), other.name()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(startDate(), other.startDate()) && Objects.equals(stopDate(), other.stopDate())
&& Objects.equals(mapRunArn(), other.mapRunArn()) && Objects.equals(itemCount(), other.itemCount())
&& Objects.equals(stateMachineVersionArn(), other.stateMachineVersionArn())
&& Objects.equals(stateMachineAliasArn(), other.stateMachineAliasArn())
&& Objects.equals(redriveCount(), other.redriveCount()) && Objects.equals(redriveDate(), other.redriveDate());
}
/**
* 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("ExecutionListItem").add("ExecutionArn", executionArn())
.add("StateMachineArn", stateMachineArn()).add("Name", name()).add("Status", statusAsString())
.add("StartDate", startDate()).add("StopDate", stopDate()).add("MapRunArn", mapRunArn())
.add("ItemCount", itemCount()).add("StateMachineVersionArn", stateMachineVersionArn())
.add("StateMachineAliasArn", stateMachineAliasArn()).add("RedriveCount", redriveCount())
.add("RedriveDate", redriveDate()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "executionArn":
return Optional.ofNullable(clazz.cast(executionArn()));
case "stateMachineArn":
return Optional.ofNullable(clazz.cast(stateMachineArn()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "startDate":
return Optional.ofNullable(clazz.cast(startDate()));
case "stopDate":
return Optional.ofNullable(clazz.cast(stopDate()));
case "mapRunArn":
return Optional.ofNullable(clazz.cast(mapRunArn()));
case "itemCount":
return Optional.ofNullable(clazz.cast(itemCount()));
case "stateMachineVersionArn":
return Optional.ofNullable(clazz.cast(stateMachineVersionArn()));
case "stateMachineAliasArn":
return Optional.ofNullable(clazz.cast(stateMachineAliasArn()));
case "redriveCount":
return Optional.ofNullable(clazz.cast(redriveCount()));
case "redriveDate":
return Optional.ofNullable(clazz.cast(redriveDate()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function