com.amazonaws.services.support.model.Communication Maven / Gradle / Ivy
Show all versions of aws-java-sdk-support Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.support.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A communication associated with a support case. The communication consists of the case ID, the message body,
* attachment information, the submitter of the communication, and the date and time of the communication.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Communication implements Serializable, Cloneable, StructuredPojo {
/**
*
* The 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
*
*/
private String caseId;
/**
*
* The text of the communication between the customer and Amazon Web Services Support.
*
*/
private String body;
/**
*
* The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM
* role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "Amazon
* Web Services," and don't show an email address.
*
*/
private String submittedBy;
/**
*
* The time the communication was created.
*
*/
private String timeCreated;
/**
*
* Information about the attachments to the case communication.
*
*/
private com.amazonaws.internal.SdkInternalList attachmentSet;
/**
*
* The 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 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 void setCaseId(String caseId) {
this.caseId = caseId;
}
/**
*
* The 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 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 getCaseId() {
return this.caseId;
}
/**
*
* The 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 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.
*/
public Communication withCaseId(String caseId) {
setCaseId(caseId);
return this;
}
/**
*
* The text of the communication between the customer and Amazon Web Services Support.
*
*
* @param body
* The text of the communication between the customer and Amazon Web Services Support.
*/
public void setBody(String body) {
this.body = body;
}
/**
*
* The text of the communication between the customer and Amazon Web Services Support.
*
*
* @return The text of the communication between the customer and Amazon Web Services Support.
*/
public String getBody() {
return this.body;
}
/**
*
* The text of the communication between the customer and Amazon Web Services Support.
*
*
* @param body
* The text of the communication between the customer and Amazon Web Services Support.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Communication withBody(String body) {
setBody(body);
return this;
}
/**
*
* The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM
* role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "Amazon
* Web Services," and don't show an email address.
*
*
* @param submittedBy
* The identity of the account that submitted, or responded to, the support case. Customer entries include
* the IAM role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "
* Amazon Web Services," and don't show an email address.
*/
public void setSubmittedBy(String submittedBy) {
this.submittedBy = submittedBy;
}
/**
*
* The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM
* role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "Amazon
* Web Services," and don't show an email address.
*
*
* @return The identity of the account that submitted, or responded to, the support case. Customer entries include
* the IAM role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "
* Amazon Web Services," and don't show an email address.
*/
public String getSubmittedBy() {
return this.submittedBy;
}
/**
*
* The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM
* role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "Amazon
* Web Services," and don't show an email address.
*
*
* @param submittedBy
* The identity of the account that submitted, or responded to, the support case. Customer entries include
* the IAM role as well as the email address (for example,
* "AdminRole (Role) <[email protected]>). Entries from the Amazon Web Services Support team display "
* Amazon Web Services," and don't show an email address.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Communication withSubmittedBy(String submittedBy) {
setSubmittedBy(submittedBy);
return this;
}
/**
*
* The time the communication was created.
*
*
* @param timeCreated
* The time the communication was created.
*/
public void setTimeCreated(String timeCreated) {
this.timeCreated = timeCreated;
}
/**
*
* The time the communication was created.
*
*
* @return The time the communication was created.
*/
public String getTimeCreated() {
return this.timeCreated;
}
/**
*
* The time the communication was created.
*
*
* @param timeCreated
* The time the communication was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Communication withTimeCreated(String timeCreated) {
setTimeCreated(timeCreated);
return this;
}
/**
*
* Information about the attachments to the case communication.
*
*
* @return Information about the attachments to the case communication.
*/
public java.util.List getAttachmentSet() {
if (attachmentSet == null) {
attachmentSet = new com.amazonaws.internal.SdkInternalList();
}
return attachmentSet;
}
/**
*
* Information about the attachments to the case communication.
*
*
* @param attachmentSet
* Information about the attachments to the case communication.
*/
public void setAttachmentSet(java.util.Collection attachmentSet) {
if (attachmentSet == null) {
this.attachmentSet = null;
return;
}
this.attachmentSet = new com.amazonaws.internal.SdkInternalList(attachmentSet);
}
/**
*
* Information about the attachments to the case communication.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAttachmentSet(java.util.Collection)} or {@link #withAttachmentSet(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param attachmentSet
* Information about the attachments to the case communication.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Communication withAttachmentSet(AttachmentDetails... attachmentSet) {
if (this.attachmentSet == null) {
setAttachmentSet(new com.amazonaws.internal.SdkInternalList(attachmentSet.length));
}
for (AttachmentDetails ele : attachmentSet) {
this.attachmentSet.add(ele);
}
return this;
}
/**
*
* Information about the attachments to the case communication.
*
*
* @param attachmentSet
* Information about the attachments to the case communication.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Communication withAttachmentSet(java.util.Collection attachmentSet) {
setAttachmentSet(attachmentSet);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCaseId() != null)
sb.append("CaseId: ").append(getCaseId()).append(",");
if (getBody() != null)
sb.append("Body: ").append(getBody()).append(",");
if (getSubmittedBy() != null)
sb.append("SubmittedBy: ").append(getSubmittedBy()).append(",");
if (getTimeCreated() != null)
sb.append("TimeCreated: ").append(getTimeCreated()).append(",");
if (getAttachmentSet() != null)
sb.append("AttachmentSet: ").append(getAttachmentSet());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Communication == false)
return false;
Communication other = (Communication) obj;
if (other.getCaseId() == null ^ this.getCaseId() == null)
return false;
if (other.getCaseId() != null && other.getCaseId().equals(this.getCaseId()) == false)
return false;
if (other.getBody() == null ^ this.getBody() == null)
return false;
if (other.getBody() != null && other.getBody().equals(this.getBody()) == false)
return false;
if (other.getSubmittedBy() == null ^ this.getSubmittedBy() == null)
return false;
if (other.getSubmittedBy() != null && other.getSubmittedBy().equals(this.getSubmittedBy()) == false)
return false;
if (other.getTimeCreated() == null ^ this.getTimeCreated() == null)
return false;
if (other.getTimeCreated() != null && other.getTimeCreated().equals(this.getTimeCreated()) == false)
return false;
if (other.getAttachmentSet() == null ^ this.getAttachmentSet() == null)
return false;
if (other.getAttachmentSet() != null && other.getAttachmentSet().equals(this.getAttachmentSet()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCaseId() == null) ? 0 : getCaseId().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
hashCode = prime * hashCode + ((getSubmittedBy() == null) ? 0 : getSubmittedBy().hashCode());
hashCode = prime * hashCode + ((getTimeCreated() == null) ? 0 : getTimeCreated().hashCode());
hashCode = prime * hashCode + ((getAttachmentSet() == null) ? 0 : getAttachmentSet().hashCode());
return hashCode;
}
@Override
public Communication clone() {
try {
return (Communication) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.support.model.transform.CommunicationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}