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

software.amazon.awssdk.services.support.model.CaseDetails Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Support module holds the client classes that are used for communicating with AWS Support Service

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 2014-2019 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.io.Serializable;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* A JSON-formatted object that contains the metadata for a support case. It is contained the response from a * DescribeCases request. CaseDetails contains the following fields: *

*
    *
  • *

    * caseId. The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string * formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47. *

    *
  • *
  • *

    * categoryCode. The category of problem for the AWS Support case. Corresponds to the CategoryCode values * returned by a call to DescribeServices. *

    *
  • *
  • *

    * displayId. The identifier for the case on pages in the AWS Support Center. *

    *
  • *
  • *

    * language. The ISO 639-1 code for the language in which AWS provides support. AWS Support currently supports * English ("en") and Japanese ("ja"). Language parameters must be passed explicitly for operations that take them. *

    *
  • *
  • *

    * recentCommunications. One or more Communication objects. Fields of these objects are * attachments, body, caseId, submittedBy, and * timeCreated. *

    *
  • *
  • *

    * nextToken. A resumption point for pagination. *

    *
  • *
  • *

    * serviceCode. The identifier for the AWS service that corresponds to the service code defined in the call to * DescribeServices. *

    *
  • *
  • *

    * severityCode. The severity code assigned to the case. Contains one of the values returned by the call to * DescribeSeverityLevels. *

    *
  • *
  • *

    * status. The status of the case in the AWS Support Center. *

    *
  • *
  • *

    * subject. The subject line of the case. *

    *
  • *
  • *

    * submittedBy. The email address of the account that submitted the case. *

    *
  • *
  • *

    * timeCreated. The time the case was created, in ISO-8601 format. *

    *
  • *
*/ @Generated("software.amazon.awssdk:codegen") public final class CaseDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CASE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::caseId)).setter(setter(Builder::caseId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("caseId").build()).build(); private static final SdkField DISPLAY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::displayId)).setter(setter(Builder::displayId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("displayId").build()).build(); private static final SdkField SUBJECT_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::subject)).setter(setter(Builder::subject)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("subject").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField SERVICE_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::serviceCode)).setter(setter(Builder::serviceCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceCode").build()).build(); private static final SdkField CATEGORY_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::categoryCode)).setter(setter(Builder::categoryCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("categoryCode").build()).build(); private static final SdkField SEVERITY_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::severityCode)).setter(setter(Builder::severityCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("severityCode").build()).build(); private static final SdkField SUBMITTED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::submittedBy)).setter(setter(Builder::submittedBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("submittedBy").build()).build(); private static final SdkField TIME_CREATED_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::timeCreated)).setter(setter(Builder::timeCreated)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("timeCreated").build()).build(); private static final SdkField RECENT_COMMUNICATIONS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(CaseDetails::recentCommunications)) .setter(setter(Builder::recentCommunications)).constructor(RecentCaseCommunications::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recentCommunications").build()) .build(); private static final SdkField> CC_EMAIL_ADDRESSES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(CaseDetails::ccEmailAddresses)) .setter(setter(Builder::ccEmailAddresses)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ccEmailAddresses").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 LANGUAGE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CaseDetails::language)).setter(setter(Builder::language)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("language").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CASE_ID_FIELD, DISPLAY_ID_FIELD, SUBJECT_FIELD, STATUS_FIELD, SERVICE_CODE_FIELD, CATEGORY_CODE_FIELD, SEVERITY_CODE_FIELD, SUBMITTED_BY_FIELD, TIME_CREATED_FIELD, RECENT_COMMUNICATIONS_FIELD, CC_EMAIL_ADDRESSES_FIELD, LANGUAGE_FIELD)); private static final long serialVersionUID = 1L; private final String caseId; private final String displayId; private final String subject; private final String status; private final String serviceCode; private final String categoryCode; private final String severityCode; private final String submittedBy; private final String timeCreated; private final RecentCaseCommunications recentCommunications; private final List ccEmailAddresses; private final String language; private CaseDetails(BuilderImpl builder) { this.caseId = builder.caseId; this.displayId = builder.displayId; this.subject = builder.subject; this.status = builder.status; this.serviceCode = builder.serviceCode; this.categoryCode = builder.categoryCode; this.severityCode = builder.severityCode; this.submittedBy = builder.submittedBy; this.timeCreated = builder.timeCreated; this.recentCommunications = builder.recentCommunications; this.ccEmailAddresses = builder.ccEmailAddresses; this.language = builder.language; } /** *

* The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as * shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47 *

* * @return The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string * formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47 */ public String caseId() { return caseId; } /** *

* The ID displayed for the case in the AWS Support Center. This is a numeric string. *

* * @return The ID displayed for the case in the AWS Support Center. This is a numeric string. */ public String displayId() { return displayId; } /** *

* The subject line for the case in the AWS Support Center. *

* * @return The subject line for the case in the AWS Support Center. */ public String subject() { return subject; } /** *

* The status of the case. *

* * @return The status of the case. */ public String status() { return status; } /** *

* The code for the AWS service returned by the call to DescribeServices. *

* * @return The code for the AWS service returned by the call to DescribeServices. */ public String serviceCode() { return serviceCode; } /** *

* The category of problem for the AWS Support case. *

* * @return The category of problem for the AWS Support case. */ public String categoryCode() { return categoryCode; } /** *

* The code for the severity level returned by the call to DescribeSeverityLevels. *

* * @return The code for the severity level returned by the call to DescribeSeverityLevels. */ public String severityCode() { return severityCode; } /** *

* The email address of the account that submitted the case. *

* * @return The email address of the account that submitted the case. */ public String submittedBy() { return submittedBy; } /** *

* The time that the case was case created in the AWS Support Center. *

* * @return The time that the case was case created in the AWS Support Center. */ public String timeCreated() { return timeCreated; } /** *

* The five most recent communications between you and AWS Support Center, including the IDs of any attachments to * the communications. Also includes a nextToken that you can use to retrieve earlier communications. *

* * @return The five most recent communications between you and AWS Support Center, including the IDs of any * attachments to the communications. Also includes a nextToken that you can use to retrieve * earlier communications. */ public RecentCaseCommunications recentCommunications() { return recentCommunications; } /** *

* The email addresses that receive copies of communication about the case. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The email addresses that receive copies of communication about the case. */ public List ccEmailAddresses() { return ccEmailAddresses; } /** *

* The ISO 639-1 code for the language in which AWS provides support. AWS Support currently supports English ("en") * and Japanese ("ja"). Language parameters must be passed explicitly for operations that take them. *

* * @return The ISO 639-1 code for the language in which AWS provides support. AWS Support currently supports English * ("en") and Japanese ("ja"). Language parameters must be passed explicitly for operations that take them. */ public String language() { return language; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(caseId()); hashCode = 31 * hashCode + Objects.hashCode(displayId()); hashCode = 31 * hashCode + Objects.hashCode(subject()); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(serviceCode()); hashCode = 31 * hashCode + Objects.hashCode(categoryCode()); hashCode = 31 * hashCode + Objects.hashCode(severityCode()); hashCode = 31 * hashCode + Objects.hashCode(submittedBy()); hashCode = 31 * hashCode + Objects.hashCode(timeCreated()); hashCode = 31 * hashCode + Objects.hashCode(recentCommunications()); hashCode = 31 * hashCode + Objects.hashCode(ccEmailAddresses()); hashCode = 31 * hashCode + Objects.hashCode(language()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CaseDetails)) { return false; } CaseDetails other = (CaseDetails) obj; return Objects.equals(caseId(), other.caseId()) && Objects.equals(displayId(), other.displayId()) && Objects.equals(subject(), other.subject()) && Objects.equals(status(), other.status()) && Objects.equals(serviceCode(), other.serviceCode()) && Objects.equals(categoryCode(), other.categoryCode()) && Objects.equals(severityCode(), other.severityCode()) && Objects.equals(submittedBy(), other.submittedBy()) && Objects.equals(timeCreated(), other.timeCreated()) && Objects.equals(recentCommunications(), other.recentCommunications()) && Objects.equals(ccEmailAddresses(), other.ccEmailAddresses()) && Objects.equals(language(), other.language()); } /** * 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("CaseDetails").add("CaseId", caseId()).add("DisplayId", displayId()).add("Subject", subject()) .add("Status", status()).add("ServiceCode", serviceCode()).add("CategoryCode", categoryCode()) .add("SeverityCode", severityCode()).add("SubmittedBy", submittedBy()).add("TimeCreated", timeCreated()) .add("RecentCommunications", recentCommunications()).add("CcEmailAddresses", ccEmailAddresses()) .add("Language", language()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "caseId": return Optional.ofNullable(clazz.cast(caseId())); case "displayId": return Optional.ofNullable(clazz.cast(displayId())); case "subject": return Optional.ofNullable(clazz.cast(subject())); case "status": return Optional.ofNullable(clazz.cast(status())); case "serviceCode": return Optional.ofNullable(clazz.cast(serviceCode())); case "categoryCode": return Optional.ofNullable(clazz.cast(categoryCode())); case "severityCode": return Optional.ofNullable(clazz.cast(severityCode())); case "submittedBy": return Optional.ofNullable(clazz.cast(submittedBy())); case "timeCreated": return Optional.ofNullable(clazz.cast(timeCreated())); case "recentCommunications": return Optional.ofNullable(clazz.cast(recentCommunications())); case "ccEmailAddresses": return Optional.ofNullable(clazz.cast(ccEmailAddresses())); case "language": return Optional.ofNullable(clazz.cast(language())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CaseDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as * shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47 *

* * @param caseId * The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string * formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47 * @return Returns a reference to this object so that method calls can be chained together. */ Builder caseId(String caseId); /** *

* The ID displayed for the case in the AWS Support Center. This is a numeric string. *

* * @param displayId * The ID displayed for the case in the AWS Support Center. This is a numeric string. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayId(String displayId); /** *

* The subject line for the case in the AWS Support Center. *

* * @param subject * The subject line for the case in the AWS Support Center. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subject(String subject); /** *

* The status of the case. *

* * @param status * The status of the case. * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); /** *

* The code for the AWS service returned by the call to DescribeServices. *

* * @param serviceCode * The code for the AWS service returned by the call to DescribeServices. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceCode(String serviceCode); /** *

* The category of problem for the AWS Support case. *

* * @param categoryCode * The category of problem for the AWS Support case. * @return Returns a reference to this object so that method calls can be chained together. */ Builder categoryCode(String categoryCode); /** *

* The code for the severity level returned by the call to DescribeSeverityLevels. *

* * @param severityCode * The code for the severity level returned by the call to DescribeSeverityLevels. * @return Returns a reference to this object so that method calls can be chained together. */ Builder severityCode(String severityCode); /** *

* The email address of the account that submitted the case. *

* * @param submittedBy * The email address of the account that submitted the case. * @return Returns a reference to this object so that method calls can be chained together. */ Builder submittedBy(String submittedBy); /** *

* The time that the case was case created in the AWS Support Center. *

* * @param timeCreated * The time that the case was case created in the AWS Support Center. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeCreated(String timeCreated); /** *

* The five most recent communications between you and AWS Support Center, including the IDs of any attachments * to the communications. Also includes a nextToken that you can use to retrieve earlier * communications. *

* * @param recentCommunications * The five most recent communications between you and AWS Support Center, including the IDs of any * attachments to the communications. Also includes a nextToken that you can use to retrieve * earlier communications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recentCommunications(RecentCaseCommunications recentCommunications); /** *

* The five most recent communications between you and AWS Support Center, including the IDs of any attachments * to the communications. Also includes a nextToken that you can use to retrieve earlier * communications. *

* This is a convenience that creates an instance of the {@link RecentCaseCommunications.Builder} avoiding the * need to create one manually via {@link RecentCaseCommunications#builder()}. * * When the {@link Consumer} completes, {@link RecentCaseCommunications.Builder#build()} is called immediately * and its result is passed to {@link #recentCommunications(RecentCaseCommunications)}. * * @param recentCommunications * a consumer that will call methods on {@link RecentCaseCommunications.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #recentCommunications(RecentCaseCommunications) */ default Builder recentCommunications(Consumer recentCommunications) { return recentCommunications(RecentCaseCommunications.builder().applyMutation(recentCommunications).build()); } /** *

* The email addresses that receive copies of communication about the case. *

* * @param ccEmailAddresses * The email addresses that receive copies of communication about the case. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ccEmailAddresses(Collection ccEmailAddresses); /** *

* The email addresses that receive copies of communication about the case. *

* * @param ccEmailAddresses * The email addresses that receive copies of communication about the case. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ccEmailAddresses(String... ccEmailAddresses); /** *

* The ISO 639-1 code for the language in which AWS provides support. AWS Support currently supports English * ("en") and Japanese ("ja"). Language parameters must be passed explicitly for operations that take them. *

* * @param language * The ISO 639-1 code for the language in which AWS provides support. AWS Support currently supports * English ("en") and Japanese ("ja"). Language parameters must be passed explicitly for operations that * take them. * @return Returns a reference to this object so that method calls can be chained together. */ Builder language(String language); } static final class BuilderImpl implements Builder { private String caseId; private String displayId; private String subject; private String status; private String serviceCode; private String categoryCode; private String severityCode; private String submittedBy; private String timeCreated; private RecentCaseCommunications recentCommunications; private List ccEmailAddresses = DefaultSdkAutoConstructList.getInstance(); private String language; private BuilderImpl() { } private BuilderImpl(CaseDetails model) { caseId(model.caseId); displayId(model.displayId); subject(model.subject); status(model.status); serviceCode(model.serviceCode); categoryCode(model.categoryCode); severityCode(model.severityCode); submittedBy(model.submittedBy); timeCreated(model.timeCreated); recentCommunications(model.recentCommunications); ccEmailAddresses(model.ccEmailAddresses); language(model.language); } public final String getCaseId() { return caseId; } @Override public final Builder caseId(String caseId) { this.caseId = caseId; return this; } public final void setCaseId(String caseId) { this.caseId = caseId; } public final String getDisplayId() { return displayId; } @Override public final Builder displayId(String displayId) { this.displayId = displayId; return this; } public final void setDisplayId(String displayId) { this.displayId = displayId; } public final String getSubject() { return subject; } @Override public final Builder subject(String subject) { this.subject = subject; return this; } public final void setSubject(String subject) { this.subject = subject; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } public final void setStatus(String status) { this.status = status; } public final String getServiceCode() { return serviceCode; } @Override public final Builder serviceCode(String serviceCode) { this.serviceCode = serviceCode; return this; } public final void setServiceCode(String serviceCode) { this.serviceCode = serviceCode; } public final String getCategoryCode() { return categoryCode; } @Override public final Builder categoryCode(String categoryCode) { this.categoryCode = categoryCode; return this; } public final void setCategoryCode(String categoryCode) { this.categoryCode = categoryCode; } public final String getSeverityCode() { return severityCode; } @Override public final Builder severityCode(String severityCode) { this.severityCode = severityCode; return this; } public final void setSeverityCode(String severityCode) { this.severityCode = severityCode; } public final String getSubmittedBy() { return submittedBy; } @Override public final Builder submittedBy(String submittedBy) { this.submittedBy = submittedBy; return this; } public final void setSubmittedBy(String submittedBy) { this.submittedBy = submittedBy; } public final String getTimeCreated() { return timeCreated; } @Override public final Builder timeCreated(String timeCreated) { this.timeCreated = timeCreated; return this; } public final void setTimeCreated(String timeCreated) { this.timeCreated = timeCreated; } public final RecentCaseCommunications.Builder getRecentCommunications() { return recentCommunications != null ? recentCommunications.toBuilder() : null; } @Override public final Builder recentCommunications(RecentCaseCommunications recentCommunications) { this.recentCommunications = recentCommunications; return this; } public final void setRecentCommunications(RecentCaseCommunications.BuilderImpl recentCommunications) { this.recentCommunications = recentCommunications != null ? recentCommunications.build() : null; } public final Collection getCcEmailAddresses() { return ccEmailAddresses; } @Override public final Builder ccEmailAddresses(Collection ccEmailAddresses) { this.ccEmailAddresses = CcEmailAddressListCopier.copy(ccEmailAddresses); return this; } @Override @SafeVarargs public final Builder ccEmailAddresses(String... ccEmailAddresses) { ccEmailAddresses(Arrays.asList(ccEmailAddresses)); return this; } public final void setCcEmailAddresses(Collection ccEmailAddresses) { this.ccEmailAddresses = CcEmailAddressListCopier.copy(ccEmailAddresses); } public final String getLanguage() { return language; } @Override public final Builder language(String language) { this.language = language; return this; } public final void setLanguage(String language) { this.language = language; } @Override public CaseDetails build() { return new CaseDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy