
software.amazon.awssdk.services.support.model.DescribeCasesRequest 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.support.model;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 DescribeCasesRequest extends SupportRequest implements
ToCopyableBuilder {
private static final SdkField> CASE_ID_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("caseIdList")
.getter(getter(DescribeCasesRequest::caseIdList))
.setter(setter(Builder::caseIdList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("caseIdList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DISPLAY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("displayId").getter(getter(DescribeCasesRequest::displayId)).setter(setter(Builder::displayId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("displayId").build()).build();
private static final SdkField AFTER_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("afterTime").getter(getter(DescribeCasesRequest::afterTime)).setter(setter(Builder::afterTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("afterTime").build()).build();
private static final SdkField BEFORE_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("beforeTime").getter(getter(DescribeCasesRequest::beforeTime)).setter(setter(Builder::beforeTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("beforeTime").build()).build();
private static final SdkField INCLUDE_RESOLVED_CASES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("includeResolvedCases").getter(getter(DescribeCasesRequest::includeResolvedCases))
.setter(setter(Builder::includeResolvedCases))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("includeResolvedCases").build())
.build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("nextToken").getter(getter(DescribeCasesRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nextToken").build()).build();
private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("maxResults").getter(getter(DescribeCasesRequest::maxResults)).setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("maxResults").build()).build();
private static final SdkField LANGUAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("language").getter(getter(DescribeCasesRequest::language)).setter(setter(Builder::language))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("language").build()).build();
private static final SdkField INCLUDE_COMMUNICATIONS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("includeCommunications").getter(getter(DescribeCasesRequest::includeCommunications))
.setter(setter(Builder::includeCommunications))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("includeCommunications").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CASE_ID_LIST_FIELD,
DISPLAY_ID_FIELD, AFTER_TIME_FIELD, BEFORE_TIME_FIELD, INCLUDE_RESOLVED_CASES_FIELD, NEXT_TOKEN_FIELD,
MAX_RESULTS_FIELD, LANGUAGE_FIELD, INCLUDE_COMMUNICATIONS_FIELD));
private final List caseIdList;
private final String displayId;
private final String afterTime;
private final String beforeTime;
private final Boolean includeResolvedCases;
private final String nextToken;
private final Integer maxResults;
private final String language;
private final Boolean includeCommunications;
private DescribeCasesRequest(BuilderImpl builder) {
super(builder);
this.caseIdList = builder.caseIdList;
this.displayId = builder.displayId;
this.afterTime = builder.afterTime;
this.beforeTime = builder.beforeTime;
this.includeResolvedCases = builder.includeResolvedCases;
this.nextToken = builder.nextToken;
this.maxResults = builder.maxResults;
this.language = builder.language;
this.includeCommunications = builder.includeCommunications;
}
/**
* For responses, this returns true if the service returned a value for the CaseIdList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasCaseIdList() {
return caseIdList != null && !(caseIdList instanceof SdkAutoConstructList);
}
/**
*
* A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasCaseIdList} method.
*
*
* @return A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.
*/
public final List caseIdList() {
return caseIdList;
}
/**
*
* The ID displayed for a case in the Amazon Web Services Support Center user interface.
*
*
* @return The ID displayed for a case in the Amazon Web Services Support Center user interface.
*/
public final String displayId() {
return displayId;
}
/**
*
* The start date for a filtered date search on support case communications. Case communications are available for
* 12 months after creation.
*
*
* @return The start date for a filtered date search on support case communications. Case communications are
* available for 12 months after creation.
*/
public final String afterTime() {
return afterTime;
}
/**
*
* The end date for a filtered date search on support case communications. Case communications are available for 12
* months after creation.
*
*
* @return The end date for a filtered date search on support case communications. Case communications are available
* for 12 months after creation.
*/
public final String beforeTime() {
return beforeTime;
}
/**
*
* Specifies whether to include resolved support cases in the DescribeCases
response. By default,
* resolved cases aren't included.
*
*
* @return Specifies whether to include resolved support cases in the DescribeCases
response. By
* default, resolved cases aren't included.
*/
public final Boolean includeResolvedCases() {
return includeResolvedCases;
}
/**
*
* A resumption point for pagination.
*
*
* @return A resumption point for pagination.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The maximum number of results to return before paginating.
*
*
* @return The maximum number of results to return before paginating.
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently
* supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1 code
* for the language
parameter if you want support in that language.
*
*
* @return The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently
* supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO
* 639-1 code for the language
parameter if you want support in that language.
*/
public final String language() {
return language;
}
/**
*
* Specifies whether to include communications in the DescribeCases
response. By default,
* communications are included.
*
*
* @return Specifies whether to include communications in the DescribeCases
response. By default,
* communications are included.
*/
public final Boolean includeCommunications() {
return includeCommunications;
}
@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(hasCaseIdList() ? caseIdList() : null);
hashCode = 31 * hashCode + Objects.hashCode(displayId());
hashCode = 31 * hashCode + Objects.hashCode(afterTime());
hashCode = 31 * hashCode + Objects.hashCode(beforeTime());
hashCode = 31 * hashCode + Objects.hashCode(includeResolvedCases());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(language());
hashCode = 31 * hashCode + Objects.hashCode(includeCommunications());
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 DescribeCasesRequest)) {
return false;
}
DescribeCasesRequest other = (DescribeCasesRequest) obj;
return hasCaseIdList() == other.hasCaseIdList() && Objects.equals(caseIdList(), other.caseIdList())
&& Objects.equals(displayId(), other.displayId()) && Objects.equals(afterTime(), other.afterTime())
&& Objects.equals(beforeTime(), other.beforeTime())
&& Objects.equals(includeResolvedCases(), other.includeResolvedCases())
&& Objects.equals(nextToken(), other.nextToken()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(language(), other.language())
&& Objects.equals(includeCommunications(), other.includeCommunications());
}
/**
* 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("DescribeCasesRequest").add("CaseIdList", hasCaseIdList() ? caseIdList() : null)
.add("DisplayId", displayId()).add("AfterTime", afterTime()).add("BeforeTime", beforeTime())
.add("IncludeResolvedCases", includeResolvedCases()).add("NextToken", nextToken())
.add("MaxResults", maxResults()).add("Language", language())
.add("IncludeCommunications", includeCommunications()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "caseIdList":
return Optional.ofNullable(clazz.cast(caseIdList()));
case "displayId":
return Optional.ofNullable(clazz.cast(displayId()));
case "afterTime":
return Optional.ofNullable(clazz.cast(afterTime()));
case "beforeTime":
return Optional.ofNullable(clazz.cast(beforeTime()));
case "includeResolvedCases":
return Optional.ofNullable(clazz.cast(includeResolvedCases()));
case "nextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "maxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "language":
return Optional.ofNullable(clazz.cast(language()));
case "includeCommunications":
return Optional.ofNullable(clazz.cast(includeCommunications()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function