
software.amazon.awssdk.services.swf.model.CountClosedWorkflowExecutionsRequest 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.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.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 CountClosedWorkflowExecutionsRequest extends SwfRequest implements
ToCopyableBuilder {
private static final SdkField DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("domain")
.getter(getter(CountClosedWorkflowExecutionsRequest::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(CountClosedWorkflowExecutionsRequest::startTimeFilter)).setter(setter(Builder::startTimeFilter))
.constructor(ExecutionTimeFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTimeFilter").build()).build();
private static final SdkField CLOSE_TIME_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("closeTimeFilter")
.getter(getter(CountClosedWorkflowExecutionsRequest::closeTimeFilter)).setter(setter(Builder::closeTimeFilter))
.constructor(ExecutionTimeFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("closeTimeFilter").build()).build();
private static final SdkField EXECUTION_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("executionFilter")
.getter(getter(CountClosedWorkflowExecutionsRequest::executionFilter)).setter(setter(Builder::executionFilter))
.constructor(WorkflowExecutionFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executionFilter").build()).build();
private static final SdkField TYPE_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("typeFilter")
.getter(getter(CountClosedWorkflowExecutionsRequest::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(CountClosedWorkflowExecutionsRequest::tagFilter))
.setter(setter(Builder::tagFilter)).constructor(TagFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tagFilter").build()).build();
private static final SdkField CLOSE_STATUS_FILTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("closeStatusFilter")
.getter(getter(CountClosedWorkflowExecutionsRequest::closeStatusFilter)).setter(setter(Builder::closeStatusFilter))
.constructor(CloseStatusFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("closeStatusFilter").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_FIELD,
START_TIME_FILTER_FIELD, CLOSE_TIME_FILTER_FIELD, EXECUTION_FILTER_FIELD, TYPE_FILTER_FIELD, TAG_FILTER_FIELD,
CLOSE_STATUS_FILTER_FIELD));
private final String domain;
private final ExecutionTimeFilter startTimeFilter;
private final ExecutionTimeFilter closeTimeFilter;
private final WorkflowExecutionFilter executionFilter;
private final WorkflowTypeFilter typeFilter;
private final TagFilter tagFilter;
private final CloseStatusFilter closeStatusFilter;
private CountClosedWorkflowExecutionsRequest(BuilderImpl builder) {
super(builder);
this.domain = builder.domain;
this.startTimeFilter = builder.startTimeFilter;
this.closeTimeFilter = builder.closeTimeFilter;
this.executionFilter = builder.executionFilter;
this.typeFilter = builder.typeFilter;
this.tagFilter = builder.tagFilter;
this.closeStatusFilter = builder.closeStatusFilter;
}
/**
*
* 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;
}
/**
*
* If specified, only workflow executions that meet the start time criteria of the filter are counted.
*
*
*
* startTimeFilter
and closeTimeFilter
are mutually exclusive. You must specify one of
* these in a request but not both.
*
*
*
* @return If specified, only workflow executions that meet the start time criteria of the filter are counted.
*
*
* startTimeFilter
and closeTimeFilter
are mutually exclusive. You must specify
* one of these in a request but not both.
*
*/
public final ExecutionTimeFilter startTimeFilter() {
return startTimeFilter;
}
/**
*
* If specified, only workflow executions that meet the close time criteria of the filter are counted.
*
*
*
* startTimeFilter
and closeTimeFilter
are mutually exclusive. You must specify one of
* these in a request but not both.
*
*
*
* @return If specified, only workflow executions that meet the close time criteria of the filter are counted.
*
*
* startTimeFilter
and closeTimeFilter
are mutually exclusive. You must specify
* one of these in a request but not both.
*
*/
public final ExecutionTimeFilter closeTimeFilter() {
return closeTimeFilter;
}
/**
*
* If specified, only workflow executions matching the WorkflowId
in the filter are counted.
*
*
*
* closeStatusFilter
, 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.
*
* closeStatusFilter
, executionFilter
, typeFilter
and
* tagFilter
are mutually exclusive. You can specify at most one of these in a request.
*
*/
public final WorkflowExecutionFilter executionFilter() {
return executionFilter;
}
/**
*
* If specified, indicates the type of the workflow executions to be counted.
*
*
*
* closeStatusFilter
, executionFilter
, typeFilter
and tagFilter
* are mutually exclusive. You can specify at most one of these in a request.
*
*
*
* @return If specified, indicates the type of the workflow executions to be counted.
*
* closeStatusFilter
, 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.
*
*
*
* closeStatusFilter
, 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.
*
* closeStatusFilter
, 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 that match this close status are counted. This filter has an affect only
* if executionStatus
is specified as CLOSED
.
*
*
*
* closeStatusFilter
, executionFilter
, typeFilter
and tagFilter
* are mutually exclusive. You can specify at most one of these in a request.
*
*
*
* @return If specified, only workflow executions that match this close status are counted. This filter has an
* affect only if executionStatus
is specified as CLOSED
.
*
* closeStatusFilter
, executionFilter
, typeFilter
and
* tagFilter
are mutually exclusive. You can specify at most one of these in a request.
*
*/
public final CloseStatusFilter closeStatusFilter() {
return closeStatusFilter;
}
@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(closeTimeFilter());
hashCode = 31 * hashCode + Objects.hashCode(executionFilter());
hashCode = 31 * hashCode + Objects.hashCode(typeFilter());
hashCode = 31 * hashCode + Objects.hashCode(tagFilter());
hashCode = 31 * hashCode + Objects.hashCode(closeStatusFilter());
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 CountClosedWorkflowExecutionsRequest)) {
return false;
}
CountClosedWorkflowExecutionsRequest other = (CountClosedWorkflowExecutionsRequest) obj;
return Objects.equals(domain(), other.domain()) && Objects.equals(startTimeFilter(), other.startTimeFilter())
&& Objects.equals(closeTimeFilter(), other.closeTimeFilter())
&& Objects.equals(executionFilter(), other.executionFilter()) && Objects.equals(typeFilter(), other.typeFilter())
&& Objects.equals(tagFilter(), other.tagFilter())
&& Objects.equals(closeStatusFilter(), other.closeStatusFilter());
}
/**
* 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("CountClosedWorkflowExecutionsRequest").add("Domain", domain())
.add("StartTimeFilter", startTimeFilter()).add("CloseTimeFilter", closeTimeFilter())
.add("ExecutionFilter", executionFilter()).add("TypeFilter", typeFilter()).add("TagFilter", tagFilter())
.add("CloseStatusFilter", closeStatusFilter()).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 "closeTimeFilter":
return Optional.ofNullable(clazz.cast(closeTimeFilter()));
case "executionFilter":
return Optional.ofNullable(clazz.cast(executionFilter()));
case "typeFilter":
return Optional.ofNullable(clazz.cast(typeFilter()));
case "tagFilter":
return Optional.ofNullable(clazz.cast(tagFilter()));
case "closeStatusFilter":
return Optional.ofNullable(clazz.cast(closeStatusFilter()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function