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

software.amazon.awssdk.services.swf.model.PollForDecisionTaskRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SWF module holds the client classes that are used for communicating with Amazon Simple Workflow Service

There is a newer version: 2.29.15
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.swf.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.awscore.AwsRequestOverrideConfiguration;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class PollForDecisionTaskRequest extends SwfRequest implements
        ToCopyableBuilder {
    private static final SdkField DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("domain")
            .getter(getter(PollForDecisionTaskRequest::domain)).setter(setter(Builder::domain))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domain").build()).build();

    private static final SdkField TASK_LIST_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("taskList").getter(getter(PollForDecisionTaskRequest::taskList)).setter(setter(Builder::taskList))
            .constructor(TaskList::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskList").build()).build();

    private static final SdkField IDENTITY_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("identity").getter(getter(PollForDecisionTaskRequest::identity)).setter(setter(Builder::identity))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("identity").build()).build();

    private static final SdkField NEXT_PAGE_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("nextPageToken").getter(getter(PollForDecisionTaskRequest::nextPageToken))
            .setter(setter(Builder::nextPageToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nextPageToken").build()).build();

    private static final SdkField MAXIMUM_PAGE_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("maximumPageSize").getter(getter(PollForDecisionTaskRequest::maximumPageSize))
            .setter(setter(Builder::maximumPageSize))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("maximumPageSize").build()).build();

    private static final SdkField REVERSE_ORDER_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("reverseOrder").getter(getter(PollForDecisionTaskRequest::reverseOrder))
            .setter(setter(Builder::reverseOrder))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reverseOrder").build()).build();

    private static final SdkField START_AT_PREVIOUS_STARTED_EVENT_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("startAtPreviousStartedEvent")
            .getter(getter(PollForDecisionTaskRequest::startAtPreviousStartedEvent))
            .setter(setter(Builder::startAtPreviousStartedEvent))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startAtPreviousStartedEvent")
                    .build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_FIELD, TASK_LIST_FIELD,
            IDENTITY_FIELD, NEXT_PAGE_TOKEN_FIELD, MAXIMUM_PAGE_SIZE_FIELD, REVERSE_ORDER_FIELD,
            START_AT_PREVIOUS_STARTED_EVENT_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("domain", DOMAIN_FIELD);
                    put("taskList", TASK_LIST_FIELD);
                    put("identity", IDENTITY_FIELD);
                    put("nextPageToken", NEXT_PAGE_TOKEN_FIELD);
                    put("maximumPageSize", MAXIMUM_PAGE_SIZE_FIELD);
                    put("reverseOrder", REVERSE_ORDER_FIELD);
                    put("startAtPreviousStartedEvent", START_AT_PREVIOUS_STARTED_EVENT_FIELD);
                }
            });

    private final String domain;

    private final TaskList taskList;

    private final String identity;

    private final String nextPageToken;

    private final Integer maximumPageSize;

    private final Boolean reverseOrder;

    private final Boolean startAtPreviousStartedEvent;

    private PollForDecisionTaskRequest(BuilderImpl builder) {
        super(builder);
        this.domain = builder.domain;
        this.taskList = builder.taskList;
        this.identity = builder.identity;
        this.nextPageToken = builder.nextPageToken;
        this.maximumPageSize = builder.maximumPageSize;
        this.reverseOrder = builder.reverseOrder;
        this.startAtPreviousStartedEvent = builder.startAtPreviousStartedEvent;
    }

    /**
     * 

* The name of the domain containing the task lists to poll. *

* * @return The name of the domain containing the task lists to poll. */ public final String domain() { return domain; } /** *

* Specifies the task list to poll for decision tasks. *

*

* The specified string must not contain a : (colon), / (slash), | (vertical * bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must * not be the literal string arn. *

* * @return Specifies the task list to poll for decision tasks.

*

* The specified string must not contain a : (colon), / (slash), | * (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). * Also, it must not be the literal string arn. */ public final TaskList taskList() { return taskList; } /** *

* Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow * history. This enables diagnostic tracing when problems arise. The form of this identity is user defined. *

* * @return Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the * workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user * defined. */ public final String identity() { return identity; } /** *

* If NextPageToken is returned there are more results available. The value of * NextPageToken is a unique pagination token for each page. Make the call again using the returned * token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 * hours. Using an expired pagination token will return a 400 error: " * Specified token has exceeded its maximum lifetime". *

*

* The configured maximumPageSize determines how many results can be returned in a single call. *

* *

* The nextPageToken returned by this action cannot be used with GetWorkflowExecutionHistory to * get the next page. You must call PollForDecisionTask again (with the nextPageToken) to * retrieve the next page of history records. Calling PollForDecisionTask with a nextPageToken * doesn't return a new decision task. *

*
* * @return If NextPageToken is returned there are more results available. The value of * NextPageToken is a unique pagination token for each page. Make the call again using the * returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token * expires after 24 hours. Using an expired pagination token will return a 400 error: " * Specified token has exceeded its maximum lifetime".

*

* The configured maximumPageSize determines how many results can be returned in a single call. *

* *

* The nextPageToken returned by this action cannot be used with * GetWorkflowExecutionHistory to get the next page. You must call PollForDecisionTask again * (with the nextPageToken) to retrieve the next page of history records. Calling * PollForDecisionTask with a nextPageToken doesn't return a new decision task. *

*/ public final String nextPageToken() { return nextPageToken; } /** *

* The maximum number of results that are returned per call. Use nextPageToken to obtain further pages * of results. *

*

* This is an upper limit only; the actual number of results returned per call may be fewer than the specified * maximum. *

* * @return The maximum number of results that are returned per call. Use nextPageToken to obtain * further pages of results.

*

* This is an upper limit only; the actual number of results returned per call may be fewer than the * specified maximum. */ public final Integer maximumPageSize() { return maximumPageSize; } /** *

* When set to true, returns the events in reverse order. By default the results are returned in * ascending order of the eventTimestamp of the events. *

* * @return When set to true, returns the events in reverse order. By default the results are returned * in ascending order of the eventTimestamp of the events. */ public final Boolean reverseOrder() { return reverseOrder; } /** *

* When set to true, returns the events with eventTimestamp greater than or equal to * eventTimestamp of the most recent DecisionTaskStarted event. By default, this parameter * is set to false. *

* * @return When set to true, returns the events with eventTimestamp greater than or equal * to eventTimestamp of the most recent DecisionTaskStarted event. By default, * this parameter is set to false. */ public final Boolean startAtPreviousStartedEvent() { return startAtPreviousStartedEvent; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(domain()); hashCode = 31 * hashCode + Objects.hashCode(taskList()); hashCode = 31 * hashCode + Objects.hashCode(identity()); hashCode = 31 * hashCode + Objects.hashCode(nextPageToken()); hashCode = 31 * hashCode + Objects.hashCode(maximumPageSize()); hashCode = 31 * hashCode + Objects.hashCode(reverseOrder()); hashCode = 31 * hashCode + Objects.hashCode(startAtPreviousStartedEvent()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof PollForDecisionTaskRequest)) { return false; } PollForDecisionTaskRequest other = (PollForDecisionTaskRequest) obj; return Objects.equals(domain(), other.domain()) && Objects.equals(taskList(), other.taskList()) && Objects.equals(identity(), other.identity()) && Objects.equals(nextPageToken(), other.nextPageToken()) && Objects.equals(maximumPageSize(), other.maximumPageSize()) && Objects.equals(reverseOrder(), other.reverseOrder()) && Objects.equals(startAtPreviousStartedEvent(), other.startAtPreviousStartedEvent()); } /** * 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("PollForDecisionTaskRequest").add("Domain", domain()).add("TaskList", taskList()) .add("Identity", identity()).add("NextPageToken", nextPageToken()).add("MaximumPageSize", maximumPageSize()) .add("ReverseOrder", reverseOrder()).add("StartAtPreviousStartedEvent", startAtPreviousStartedEvent()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "domain": return Optional.ofNullable(clazz.cast(domain())); case "taskList": return Optional.ofNullable(clazz.cast(taskList())); case "identity": return Optional.ofNullable(clazz.cast(identity())); case "nextPageToken": return Optional.ofNullable(clazz.cast(nextPageToken())); case "maximumPageSize": return Optional.ofNullable(clazz.cast(maximumPageSize())); case "reverseOrder": return Optional.ofNullable(clazz.cast(reverseOrder())); case "startAtPreviousStartedEvent": return Optional.ofNullable(clazz.cast(startAtPreviousStartedEvent())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((PollForDecisionTaskRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SwfRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the domain containing the task lists to poll. *

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

* Specifies the task list to poll for decision tasks. *

*

* The specified string must not contain a : (colon), / (slash), | * (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it * must not be the literal string arn. *

* * @param taskList * Specifies the task list to poll for decision tasks.

*

* The specified string must not contain a : (colon), / (slash), | * (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). * Also, it must not be the literal string arn. * @return Returns a reference to this object so that method calls can be chained together. */ Builder taskList(TaskList taskList); /** *

* Specifies the task list to poll for decision tasks. *

*

* The specified string must not contain a : (colon), / (slash), | * (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it * must not be the literal string arn. *

* This is a convenience method that creates an instance of the {@link TaskList.Builder} avoiding the need to * create one manually via {@link TaskList#builder()}. * *

* When the {@link Consumer} completes, {@link TaskList.Builder#build()} is called immediately and its result is * passed to {@link #taskList(TaskList)}. * * @param taskList * a consumer that will call methods on {@link TaskList.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #taskList(TaskList) */ default Builder taskList(Consumer taskList) { return taskList(TaskList.builder().applyMutation(taskList).build()); } /** *

* Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the * workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user * defined. *

* * @param identity * Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the * workflow history. This enables diagnostic tracing when problems arise. The form of this identity is * user defined. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identity(String identity); /** *

* If NextPageToken is returned there are more results available. The value of * NextPageToken is a unique pagination token for each page. Make the call again using the returned * token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 * hours. Using an expired pagination token will return a 400 error: " * Specified token has exceeded its maximum lifetime". *

*

* The configured maximumPageSize determines how many results can be returned in a single call. *

* *

* The nextPageToken returned by this action cannot be used with GetWorkflowExecutionHistory * to get the next page. You must call PollForDecisionTask again (with the nextPageToken) to * retrieve the next page of history records. Calling PollForDecisionTask with a * nextPageToken doesn't return a new decision task. *

*
* * @param nextPageToken * If NextPageToken is returned there are more results available. The value of * NextPageToken is a unique pagination token for each page. Make the call again using the * returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token * expires after 24 hours. Using an expired pagination token will return a 400 error: " * Specified token has exceeded its maximum lifetime".

*

* The configured maximumPageSize determines how many results can be returned in a single * call. *

* *

* The nextPageToken returned by this action cannot be used with * GetWorkflowExecutionHistory to get the next page. You must call PollForDecisionTask * again (with the nextPageToken) to retrieve the next page of history records. Calling * PollForDecisionTask with a nextPageToken doesn't return a new decision task. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder nextPageToken(String nextPageToken); /** *

* The maximum number of results that are returned per call. Use nextPageToken to obtain further * pages of results. *

*

* This is an upper limit only; the actual number of results returned per call may be fewer than the specified * maximum. *

* * @param maximumPageSize * The maximum number of results that are returned per call. Use nextPageToken to obtain * further pages of results.

*

* This is an upper limit only; the actual number of results returned per call may be fewer than the * specified maximum. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maximumPageSize(Integer maximumPageSize); /** *

* When set to true, returns the events in reverse order. By default the results are returned in * ascending order of the eventTimestamp of the events. *

* * @param reverseOrder * When set to true, returns the events in reverse order. By default the results are * returned in ascending order of the eventTimestamp of the events. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reverseOrder(Boolean reverseOrder); /** *

* When set to true, returns the events with eventTimestamp greater than or equal to * eventTimestamp of the most recent DecisionTaskStarted event. By default, this * parameter is set to false. *

* * @param startAtPreviousStartedEvent * When set to true, returns the events with eventTimestamp greater than or * equal to eventTimestamp of the most recent DecisionTaskStarted event. By * default, this parameter is set to false. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startAtPreviousStartedEvent(Boolean startAtPreviousStartedEvent); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SwfRequest.BuilderImpl implements Builder { private String domain; private TaskList taskList; private String identity; private String nextPageToken; private Integer maximumPageSize; private Boolean reverseOrder; private Boolean startAtPreviousStartedEvent; private BuilderImpl() { } private BuilderImpl(PollForDecisionTaskRequest model) { super(model); domain(model.domain); taskList(model.taskList); identity(model.identity); nextPageToken(model.nextPageToken); maximumPageSize(model.maximumPageSize); reverseOrder(model.reverseOrder); startAtPreviousStartedEvent(model.startAtPreviousStartedEvent); } public final String getDomain() { return domain; } public final void setDomain(String domain) { this.domain = domain; } @Override public final Builder domain(String domain) { this.domain = domain; return this; } public final TaskList.Builder getTaskList() { return taskList != null ? taskList.toBuilder() : null; } public final void setTaskList(TaskList.BuilderImpl taskList) { this.taskList = taskList != null ? taskList.build() : null; } @Override public final Builder taskList(TaskList taskList) { this.taskList = taskList; return this; } public final String getIdentity() { return identity; } public final void setIdentity(String identity) { this.identity = identity; } @Override public final Builder identity(String identity) { this.identity = identity; return this; } public final String getNextPageToken() { return nextPageToken; } public final void setNextPageToken(String nextPageToken) { this.nextPageToken = nextPageToken; } @Override public final Builder nextPageToken(String nextPageToken) { this.nextPageToken = nextPageToken; return this; } public final Integer getMaximumPageSize() { return maximumPageSize; } public final void setMaximumPageSize(Integer maximumPageSize) { this.maximumPageSize = maximumPageSize; } @Override public final Builder maximumPageSize(Integer maximumPageSize) { this.maximumPageSize = maximumPageSize; return this; } public final Boolean getReverseOrder() { return reverseOrder; } public final void setReverseOrder(Boolean reverseOrder) { this.reverseOrder = reverseOrder; } @Override public final Builder reverseOrder(Boolean reverseOrder) { this.reverseOrder = reverseOrder; return this; } public final Boolean getStartAtPreviousStartedEvent() { return startAtPreviousStartedEvent; } public final void setStartAtPreviousStartedEvent(Boolean startAtPreviousStartedEvent) { this.startAtPreviousStartedEvent = startAtPreviousStartedEvent; } @Override public final Builder startAtPreviousStartedEvent(Boolean startAtPreviousStartedEvent) { this.startAtPreviousStartedEvent = startAtPreviousStartedEvent; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public PollForDecisionTaskRequest build() { return new PollForDecisionTaskRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy