software.amazon.awssdk.services.swf.model.CountOpenWorkflowExecutionsRequest Maven / Gradle / Ivy
Show all versions of swf 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.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 CountOpenWorkflowExecutionsRequest extends SwfRequest implements
ToCopyableBuilder {
private static final SdkField DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("domain")
.getter(getter(CountOpenWorkflowExecutionsRequest::domain)).setter(setter(Builder::domain))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domain").build()).build();
private static final SdkField START_TIME_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("startTimeFilter")
.getter(getter(CountOpenWorkflowExecutionsRequest::startTimeFilter)).setter(setter(Builder::startTimeFilter))
.constructor(ExecutionTimeFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTimeFilter").build()).build();
private static final SdkField TYPE_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("typeFilter")
.getter(getter(CountOpenWorkflowExecutionsRequest::typeFilter)).setter(setter(Builder::typeFilter))
.constructor(WorkflowTypeFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("typeFilter").build()).build();
private static final SdkField TAG_FILTER_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("tagFilter").getter(getter(CountOpenWorkflowExecutionsRequest::tagFilter))
.setter(setter(Builder::tagFilter)).constructor(TagFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tagFilter").build()).build();
private static final SdkField EXECUTION_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("executionFilter")
.getter(getter(CountOpenWorkflowExecutionsRequest::executionFilter)).setter(setter(Builder::executionFilter))
.constructor(WorkflowExecutionFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executionFilter").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_FIELD,
START_TIME_FILTER_FIELD, TYPE_FILTER_FIELD, TAG_FILTER_FIELD, EXECUTION_FILTER_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("domain", DOMAIN_FIELD);
put("startTimeFilter", START_TIME_FILTER_FIELD);
put("typeFilter", TYPE_FILTER_FIELD);
put("tagFilter", TAG_FILTER_FIELD);
put("executionFilter", EXECUTION_FILTER_FIELD);
}
});
private final String domain;
private final ExecutionTimeFilter startTimeFilter;
private final WorkflowTypeFilter typeFilter;
private final TagFilter tagFilter;
private final WorkflowExecutionFilter executionFilter;
private CountOpenWorkflowExecutionsRequest(BuilderImpl builder) {
super(builder);
this.domain = builder.domain;
this.startTimeFilter = builder.startTimeFilter;
this.typeFilter = builder.typeFilter;
this.tagFilter = builder.tagFilter;
this.executionFilter = builder.executionFilter;
}
/**
*
* The name of the domain containing the workflow executions to count.
*
*
* @return The name of the domain containing the workflow executions to count.
*/
public final String domain() {
return domain;
}
/**
*
* Specifies the start time criteria that workflow executions must meet in order to be counted.
*
*
* @return Specifies the start time criteria that workflow executions must meet in order to be counted.
*/
public final ExecutionTimeFilter startTimeFilter() {
return startTimeFilter;
}
/**
*
* Specifies the type of the workflow executions to be counted.
*
*
*
* executionFilter
, typeFilter
and tagFilter
are mutually exclusive. You can
* specify at most one of these in a request.
*
*
*
* @return Specifies the type of the workflow executions to be counted.
*
* executionFilter
, typeFilter
and tagFilter
are mutually exclusive.
* You can specify at most one of these in a request.
*
*/
public final WorkflowTypeFilter typeFilter() {
return typeFilter;
}
/**
*
* If specified, only executions that have a tag that matches the filter are counted.
*
*
*
* executionFilter
, typeFilter
and tagFilter
are mutually exclusive. You can
* specify at most one of these in a request.
*
*
*
* @return If specified, only executions that have a tag that matches the filter are counted.
*
* executionFilter
, typeFilter
and tagFilter
are mutually exclusive.
* You can specify at most one of these in a request.
*
*/
public final TagFilter tagFilter() {
return tagFilter;
}
/**
*
* If specified, only workflow executions matching the WorkflowId
in the filter are counted.
*
*
*
* executionFilter
, typeFilter
and tagFilter
are mutually exclusive. You can
* specify at most one of these in a request.
*
*
*
* @return If specified, only workflow executions matching the WorkflowId
in the filter are
* counted.
*
* executionFilter
, typeFilter
and tagFilter
are mutually exclusive.
* You can specify at most one of these in a request.
*
*/
public final WorkflowExecutionFilter executionFilter() {
return executionFilter;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(domain());
hashCode = 31 * hashCode + Objects.hashCode(startTimeFilter());
hashCode = 31 * hashCode + Objects.hashCode(typeFilter());
hashCode = 31 * hashCode + Objects.hashCode(tagFilter());
hashCode = 31 * hashCode + Objects.hashCode(executionFilter());
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 CountOpenWorkflowExecutionsRequest)) {
return false;
}
CountOpenWorkflowExecutionsRequest other = (CountOpenWorkflowExecutionsRequest) obj;
return Objects.equals(domain(), other.domain()) && Objects.equals(startTimeFilter(), other.startTimeFilter())
&& Objects.equals(typeFilter(), other.typeFilter()) && Objects.equals(tagFilter(), other.tagFilter())
&& Objects.equals(executionFilter(), other.executionFilter());
}
/**
* 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("CountOpenWorkflowExecutionsRequest").add("Domain", domain())
.add("StartTimeFilter", startTimeFilter()).add("TypeFilter", typeFilter()).add("TagFilter", tagFilter())
.add("ExecutionFilter", executionFilter()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "domain":
return Optional.ofNullable(clazz.cast(domain()));
case "startTimeFilter":
return Optional.ofNullable(clazz.cast(startTimeFilter()));
case "typeFilter":
return Optional.ofNullable(clazz.cast(typeFilter()));
case "tagFilter":
return Optional.ofNullable(clazz.cast(tagFilter()));
case "executionFilter":
return Optional.ofNullable(clazz.cast(executionFilter()));
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