
software.amazon.awssdk.services.swf.model.Decision Maven / Gradle / Ivy
/*
* 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.swf.model;
import java.io.Serializable;
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;
/**
*
* Specifies a decision made by the decider. A decision can be one of these types:
*
*
* -
*
* CancelTimer
– Cancels a previously started timer and records a TimerCanceled
event in the
* history.
*
*
* -
*
* CancelWorkflowExecution
– Closes the workflow execution and records a
* WorkflowExecutionCanceled
event in the history.
*
*
* -
*
* CompleteWorkflowExecution
– Closes the workflow execution and records a
* WorkflowExecutionCompleted
event in the history .
*
*
* -
*
* ContinueAsNewWorkflowExecution
– Closes the workflow execution and starts a new workflow execution of
* the same type using the same workflow ID and a unique run Id. A WorkflowExecutionContinuedAsNew
event is
* recorded in the history.
*
*
* -
*
* FailWorkflowExecution
– Closes the workflow execution and records a WorkflowExecutionFailed
* event in the history.
*
*
* -
*
* RecordMarker
– Records a MarkerRecorded
event in the history. Markers can be used for
* adding custom information in the history for instance to let deciders know that they don't need to look at the
* history beyond the marker event.
*
*
* -
*
* RequestCancelActivityTask
– Attempts to cancel a previously scheduled activity task. If the activity
* task was scheduled but has not been assigned to a worker, then it is canceled. If the activity task was already
* assigned to a worker, then the worker is informed that cancellation has been requested in the response to
* RecordActivityTaskHeartbeat.
*
*
* -
*
* RequestCancelExternalWorkflowExecution
– Requests that a request be made to cancel the specified
* external workflow execution and records a RequestCancelExternalWorkflowExecutionInitiated
event in the
* history.
*
*
* -
*
* ScheduleActivityTask
– Schedules an activity task.
*
*
* -
*
* SignalExternalWorkflowExecution
– Requests a signal to be delivered to the specified external workflow
* execution and records a SignalExternalWorkflowExecutionInitiated
event in the history.
*
*
* -
*
* StartChildWorkflowExecution
– Requests that a child workflow execution be started and records a
* StartChildWorkflowExecutionInitiated
event in the history. The child workflow execution is a separate
* workflow execution with its own history.
*
*
* -
*
* StartTimer
– Starts a timer for this workflow execution and records a TimerStarted
event in
* the history. This timer fires after the specified delay and record a TimerFired
event.
*
*
*
*
* Access Control
*
*
* If you grant permission to use RespondDecisionTaskCompleted
, you can use IAM policies to express
* permissions for the list of decisions returned by this action as if they were members of the API. Treating decisions
* as a pseudo API maintains a uniform conceptual model and helps keep policies readable. For details and example IAM
* policies, see Using IAM to
* Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
*
*
* Decision Failure
*
*
* Decisions can fail for several reasons
*
*
* -
*
* The ordering of decisions should follow a logical flow. Some decisions might not make sense in the current context of
* the workflow execution and therefore fails.
*
*
* -
*
* A limit on your account was reached.
*
*
* -
*
* The decision lacks sufficient permissions.
*
*
*
*
* One of the following events might be added to the history to indicate an error. The event attribute's
* cause
parameter indicates the cause. If cause
is set to
* OPERATION_NOT_PERMITTED
, the decision failed because it lacked sufficient permissions. For details and
* example IAM policies, see Using IAM to Manage Access to
* Amazon SWF Workflows in the Amazon SWF Developer Guide.
*
*
* -
*
* ScheduleActivityTaskFailed
– A ScheduleActivityTask
decision failed. This could happen if
* the activity type specified in the decision isn't registered, is in a deprecated state, or the decision isn't
* properly configured.
*
*
* -
*
* RequestCancelActivityTaskFailed
– A RequestCancelActivityTask
decision failed. This could
* happen if there is no open activity task with the specified activityId.
*
*
* -
*
* StartTimerFailed
– A StartTimer
decision failed. This could happen if there is another open
* timer with the same timerId.
*
*
* -
*
* CancelTimerFailed
– A CancelTimer
decision failed. This could happen if there is no open
* timer with the specified timerId.
*
*
* -
*
* StartChildWorkflowExecutionFailed
– A StartChildWorkflowExecution
decision failed. This
* could happen if the workflow type specified isn't registered, is deprecated, or the decision isn't properly
* configured.
*
*
* -
*
* SignalExternalWorkflowExecutionFailed
– A SignalExternalWorkflowExecution
decision failed.
* This could happen if the workflowID
specified in the decision was incorrect.
*
*
* -
*
* RequestCancelExternalWorkflowExecutionFailed
– A RequestCancelExternalWorkflowExecution
* decision failed. This could happen if the workflowID
specified in the decision was incorrect.
*
*
* -
*
* CancelWorkflowExecutionFailed
– A CancelWorkflowExecution
decision failed. This could
* happen if there is an unhandled decision task pending in the workflow execution.
*
*
* -
*
* CompleteWorkflowExecutionFailed
– A CompleteWorkflowExecution
decision failed. This could
* happen if there is an unhandled decision task pending in the workflow execution.
*
*
* -
*
* ContinueAsNewWorkflowExecutionFailed
– A ContinueAsNewWorkflowExecution
decision failed.
* This could happen if there is an unhandled decision task pending in the workflow execution or the
* ContinueAsNewWorkflowExecution decision was not configured correctly.
*
*
* -
*
* FailWorkflowExecutionFailed
– A FailWorkflowExecution
decision failed. This could happen if
* there is an unhandled decision task pending in the workflow execution.
*
*
*
*
* The preceding error events might occur due to an error in the decider logic, which might put the workflow execution
* in an unstable state The cause field in the event structure for the error event indicates the cause of the error.
*
*
*
* A workflow execution may be closed by the decider by returning one of the following decisions when completing a
* decision task: CompleteWorkflowExecution
, FailWorkflowExecution
,
* CancelWorkflowExecution
and ContinueAsNewWorkflowExecution
. An
* UnhandledDecision
fault is returned if a workflow closing decision is specified and a signal or activity
* event had been added to the history while the decision task was being performed by the decider. Unlike the above
* situations which are logic issues, this fault is always possible because of race conditions in a distributed system.
* The right action here is to call RespondDecisionTaskCompleted without any decisions. This would result in
* another decision task with these new events included in the history. The decider should handle the new events and may
* decide to close the workflow execution.
*
*
*
* How to Code a Decision
*
*
* You code a decision by first setting the decision type field to one of the above decision values, and then set the
* corresponding attributes field shown below:
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
* RequestCancelExternalWorkflowExecutionDecisionAttributes
*
*
* -
*
*
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Decision implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField DECISION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Decision::decisionTypeAsString)).setter(setter(Builder::decisionType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("decisionType").build()).build();
private static final SdkField SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::scheduleActivityTaskDecisionAttributes))
.setter(setter(Builder::scheduleActivityTaskDecisionAttributes))
.constructor(ScheduleActivityTaskDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("scheduleActivityTaskDecisionAttributes").build()).build();
private static final SdkField REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::requestCancelActivityTaskDecisionAttributes))
.setter(setter(Builder::requestCancelActivityTaskDecisionAttributes))
.constructor(RequestCancelActivityTaskDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("requestCancelActivityTaskDecisionAttributes").build()).build();
private static final SdkField COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::completeWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::completeWorkflowExecutionDecisionAttributes))
.constructor(CompleteWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("completeWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::failWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::failWorkflowExecutionDecisionAttributes))
.constructor(FailWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("failWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::cancelWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::cancelWorkflowExecutionDecisionAttributes))
.constructor(CancelWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("cancelWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::continueAsNewWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::continueAsNewWorkflowExecutionDecisionAttributes))
.constructor(ContinueAsNewWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("continueAsNewWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField RECORD_MARKER_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::recordMarkerDecisionAttributes))
.setter(setter(Builder::recordMarkerDecisionAttributes))
.constructor(RecordMarkerDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recordMarkerDecisionAttributes")
.build()).build();
private static final SdkField START_TIMER_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::startTimerDecisionAttributes))
.setter(setter(Builder::startTimerDecisionAttributes))
.constructor(StartTimerDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTimerDecisionAttributes")
.build()).build();
private static final SdkField CANCEL_TIMER_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::cancelTimerDecisionAttributes))
.setter(setter(Builder::cancelTimerDecisionAttributes))
.constructor(CancelTimerDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cancelTimerDecisionAttributes")
.build()).build();
private static final SdkField SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::signalExternalWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::signalExternalWorkflowExecutionDecisionAttributes))
.constructor(SignalExternalWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("signalExternalWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::requestCancelExternalWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::requestCancelExternalWorkflowExecutionDecisionAttributes))
.constructor(RequestCancelExternalWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("requestCancelExternalWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::startChildWorkflowExecutionDecisionAttributes))
.setter(setter(Builder::startChildWorkflowExecutionDecisionAttributes))
.constructor(StartChildWorkflowExecutionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("startChildWorkflowExecutionDecisionAttributes").build()).build();
private static final SdkField SCHEDULE_LAMBDA_FUNCTION_DECISION_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Decision::scheduleLambdaFunctionDecisionAttributes))
.setter(setter(Builder::scheduleLambdaFunctionDecisionAttributes))
.constructor(ScheduleLambdaFunctionDecisionAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("scheduleLambdaFunctionDecisionAttributes").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DECISION_TYPE_FIELD,
SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD, REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD,
COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD, FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD,
CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD, CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD,
RECORD_MARKER_DECISION_ATTRIBUTES_FIELD, START_TIMER_DECISION_ATTRIBUTES_FIELD,
CANCEL_TIMER_DECISION_ATTRIBUTES_FIELD, SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD,
REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD,
START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD, SCHEDULE_LAMBDA_FUNCTION_DECISION_ATTRIBUTES_FIELD));
private static final long serialVersionUID = 1L;
private final String decisionType;
private final ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes;
private final RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes;
private final CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes;
private final FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes;
private final CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes;
private final ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes;
private final RecordMarkerDecisionAttributes recordMarkerDecisionAttributes;
private final StartTimerDecisionAttributes startTimerDecisionAttributes;
private final CancelTimerDecisionAttributes cancelTimerDecisionAttributes;
private final SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes;
private final RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes;
private final StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes;
private final ScheduleLambdaFunctionDecisionAttributes scheduleLambdaFunctionDecisionAttributes;
private Decision(BuilderImpl builder) {
this.decisionType = builder.decisionType;
this.scheduleActivityTaskDecisionAttributes = builder.scheduleActivityTaskDecisionAttributes;
this.requestCancelActivityTaskDecisionAttributes = builder.requestCancelActivityTaskDecisionAttributes;
this.completeWorkflowExecutionDecisionAttributes = builder.completeWorkflowExecutionDecisionAttributes;
this.failWorkflowExecutionDecisionAttributes = builder.failWorkflowExecutionDecisionAttributes;
this.cancelWorkflowExecutionDecisionAttributes = builder.cancelWorkflowExecutionDecisionAttributes;
this.continueAsNewWorkflowExecutionDecisionAttributes = builder.continueAsNewWorkflowExecutionDecisionAttributes;
this.recordMarkerDecisionAttributes = builder.recordMarkerDecisionAttributes;
this.startTimerDecisionAttributes = builder.startTimerDecisionAttributes;
this.cancelTimerDecisionAttributes = builder.cancelTimerDecisionAttributes;
this.signalExternalWorkflowExecutionDecisionAttributes = builder.signalExternalWorkflowExecutionDecisionAttributes;
this.requestCancelExternalWorkflowExecutionDecisionAttributes = builder.requestCancelExternalWorkflowExecutionDecisionAttributes;
this.startChildWorkflowExecutionDecisionAttributes = builder.startChildWorkflowExecutionDecisionAttributes;
this.scheduleLambdaFunctionDecisionAttributes = builder.scheduleLambdaFunctionDecisionAttributes;
}
/**
*
* Specifies the type of the decision.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #decisionType} will
* return {@link DecisionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #decisionTypeAsString}.
*
*
* @return Specifies the type of the decision.
* @see DecisionType
*/
public DecisionType decisionType() {
return DecisionType.fromValue(decisionType);
}
/**
*
* Specifies the type of the decision.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #decisionType} will
* return {@link DecisionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #decisionTypeAsString}.
*
*
* @return Specifies the type of the decision.
* @see DecisionType
*/
public String decisionTypeAsString() {
return decisionType;
}
/**
*
* Provides the details of the ScheduleActivityTask
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the ScheduleActivityTask
decision. It isn't set for other decision
* types.
*/
public ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes() {
return scheduleActivityTaskDecisionAttributes;
}
/**
*
* Provides the details of the RequestCancelActivityTask
decision. It isn't set for other decision
* types.
*
*
* @return Provides the details of the RequestCancelActivityTask
decision. It isn't set for other
* decision types.
*/
public RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes() {
return requestCancelActivityTaskDecisionAttributes;
}
/**
*
* Provides the details of the CompleteWorkflowExecution
decision. It isn't set for other decision
* types.
*
*
* @return Provides the details of the CompleteWorkflowExecution
decision. It isn't set for other
* decision types.
*/
public CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes() {
return completeWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the FailWorkflowExecution
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the FailWorkflowExecution
decision. It isn't set for other decision
* types.
*/
public FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes() {
return failWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the CancelWorkflowExecution
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the CancelWorkflowExecution
decision. It isn't set for other
* decision types.
*/
public CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes() {
return cancelWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the ContinueAsNewWorkflowExecution
decision. It isn't set for other decision
* types.
*
*
* @return Provides the details of the ContinueAsNewWorkflowExecution
decision. It isn't set for other
* decision types.
*/
public ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes() {
return continueAsNewWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the RecordMarker
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the RecordMarker
decision. It isn't set for other decision types.
*/
public RecordMarkerDecisionAttributes recordMarkerDecisionAttributes() {
return recordMarkerDecisionAttributes;
}
/**
*
* Provides the details of the StartTimer
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the StartTimer
decision. It isn't set for other decision types.
*/
public StartTimerDecisionAttributes startTimerDecisionAttributes() {
return startTimerDecisionAttributes;
}
/**
*
* Provides the details of the CancelTimer
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the CancelTimer
decision. It isn't set for other decision types.
*/
public CancelTimerDecisionAttributes cancelTimerDecisionAttributes() {
return cancelTimerDecisionAttributes;
}
/**
*
* Provides the details of the SignalExternalWorkflowExecution
decision. It isn't set for other
* decision types.
*
*
* @return Provides the details of the SignalExternalWorkflowExecution
decision. It isn't set for other
* decision types.
*/
public SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes() {
return signalExternalWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the RequestCancelExternalWorkflowExecution
decision. It isn't set for other
* decision types.
*
*
* @return Provides the details of the RequestCancelExternalWorkflowExecution
decision. It isn't set
* for other decision types.
*/
public RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes() {
return requestCancelExternalWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the StartChildWorkflowExecution
decision. It isn't set for other decision
* types.
*
*
* @return Provides the details of the StartChildWorkflowExecution
decision. It isn't set for other
* decision types.
*/
public StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes() {
return startChildWorkflowExecutionDecisionAttributes;
}
/**
*
* Provides the details of the ScheduleLambdaFunction
decision. It isn't set for other decision types.
*
*
* @return Provides the details of the ScheduleLambdaFunction
decision. It isn't set for other decision
* types.
*/
public ScheduleLambdaFunctionDecisionAttributes scheduleLambdaFunctionDecisionAttributes() {
return scheduleLambdaFunctionDecisionAttributes;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(decisionTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(scheduleActivityTaskDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(requestCancelActivityTaskDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(completeWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(failWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(cancelWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(continueAsNewWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(recordMarkerDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(startTimerDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(cancelTimerDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(signalExternalWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(requestCancelExternalWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(startChildWorkflowExecutionDecisionAttributes());
hashCode = 31 * hashCode + Objects.hashCode(scheduleLambdaFunctionDecisionAttributes());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Decision)) {
return false;
}
Decision other = (Decision) obj;
return Objects.equals(decisionTypeAsString(), other.decisionTypeAsString())
&& Objects.equals(scheduleActivityTaskDecisionAttributes(), other.scheduleActivityTaskDecisionAttributes())
&& Objects.equals(requestCancelActivityTaskDecisionAttributes(),
other.requestCancelActivityTaskDecisionAttributes())
&& Objects.equals(completeWorkflowExecutionDecisionAttributes(),
other.completeWorkflowExecutionDecisionAttributes())
&& Objects.equals(failWorkflowExecutionDecisionAttributes(), other.failWorkflowExecutionDecisionAttributes())
&& Objects.equals(cancelWorkflowExecutionDecisionAttributes(), other.cancelWorkflowExecutionDecisionAttributes())
&& Objects.equals(continueAsNewWorkflowExecutionDecisionAttributes(),
other.continueAsNewWorkflowExecutionDecisionAttributes())
&& Objects.equals(recordMarkerDecisionAttributes(), other.recordMarkerDecisionAttributes())
&& Objects.equals(startTimerDecisionAttributes(), other.startTimerDecisionAttributes())
&& Objects.equals(cancelTimerDecisionAttributes(), other.cancelTimerDecisionAttributes())
&& Objects.equals(signalExternalWorkflowExecutionDecisionAttributes(),
other.signalExternalWorkflowExecutionDecisionAttributes())
&& Objects.equals(requestCancelExternalWorkflowExecutionDecisionAttributes(),
other.requestCancelExternalWorkflowExecutionDecisionAttributes())
&& Objects.equals(startChildWorkflowExecutionDecisionAttributes(),
other.startChildWorkflowExecutionDecisionAttributes())
&& Objects.equals(scheduleLambdaFunctionDecisionAttributes(), other.scheduleLambdaFunctionDecisionAttributes());
}
/**
* 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 String toString() {
return ToString
.builder("Decision")
.add("DecisionType", decisionTypeAsString())
.add("ScheduleActivityTaskDecisionAttributes", scheduleActivityTaskDecisionAttributes())
.add("RequestCancelActivityTaskDecisionAttributes", requestCancelActivityTaskDecisionAttributes())
.add("CompleteWorkflowExecutionDecisionAttributes", completeWorkflowExecutionDecisionAttributes())
.add("FailWorkflowExecutionDecisionAttributes", failWorkflowExecutionDecisionAttributes())
.add("CancelWorkflowExecutionDecisionAttributes", cancelWorkflowExecutionDecisionAttributes())
.add("ContinueAsNewWorkflowExecutionDecisionAttributes", continueAsNewWorkflowExecutionDecisionAttributes())
.add("RecordMarkerDecisionAttributes", recordMarkerDecisionAttributes())
.add("StartTimerDecisionAttributes", startTimerDecisionAttributes())
.add("CancelTimerDecisionAttributes", cancelTimerDecisionAttributes())
.add("SignalExternalWorkflowExecutionDecisionAttributes", signalExternalWorkflowExecutionDecisionAttributes())
.add("RequestCancelExternalWorkflowExecutionDecisionAttributes",
requestCancelExternalWorkflowExecutionDecisionAttributes())
.add("StartChildWorkflowExecutionDecisionAttributes", startChildWorkflowExecutionDecisionAttributes())
.add("ScheduleLambdaFunctionDecisionAttributes", scheduleLambdaFunctionDecisionAttributes()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "decisionType":
return Optional.ofNullable(clazz.cast(decisionTypeAsString()));
case "scheduleActivityTaskDecisionAttributes":
return Optional.ofNullable(clazz.cast(scheduleActivityTaskDecisionAttributes()));
case "requestCancelActivityTaskDecisionAttributes":
return Optional.ofNullable(clazz.cast(requestCancelActivityTaskDecisionAttributes()));
case "completeWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(completeWorkflowExecutionDecisionAttributes()));
case "failWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(failWorkflowExecutionDecisionAttributes()));
case "cancelWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(cancelWorkflowExecutionDecisionAttributes()));
case "continueAsNewWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(continueAsNewWorkflowExecutionDecisionAttributes()));
case "recordMarkerDecisionAttributes":
return Optional.ofNullable(clazz.cast(recordMarkerDecisionAttributes()));
case "startTimerDecisionAttributes":
return Optional.ofNullable(clazz.cast(startTimerDecisionAttributes()));
case "cancelTimerDecisionAttributes":
return Optional.ofNullable(clazz.cast(cancelTimerDecisionAttributes()));
case "signalExternalWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(signalExternalWorkflowExecutionDecisionAttributes()));
case "requestCancelExternalWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(requestCancelExternalWorkflowExecutionDecisionAttributes()));
case "startChildWorkflowExecutionDecisionAttributes":
return Optional.ofNullable(clazz.cast(startChildWorkflowExecutionDecisionAttributes()));
case "scheduleLambdaFunctionDecisionAttributes":
return Optional.ofNullable(clazz.cast(scheduleLambdaFunctionDecisionAttributes()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function