com.amazonaws.services.simpleemailv2.model.UpdateContactRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-sesv2 Show documentation
/*
* Copyright 2017-2022 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.simpleemailv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateContactRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the contact list.
*
*/
private String contactListName;
/**
*
* The contact's email addres.
*
*/
private String emailAddress;
/**
*
* The contact's preference for being opted-in to or opted-out of a topic.
*
*/
private java.util.List topicPreferences;
/**
*
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
*
*/
private Boolean unsubscribeAll;
/**
*
* The attribute data attached to a contact.
*
*/
private String attributesData;
/**
*
* The name of the contact list.
*
*
* @param contactListName
* The name of the contact list.
*/
public void setContactListName(String contactListName) {
this.contactListName = contactListName;
}
/**
*
* The name of the contact list.
*
*
* @return The name of the contact list.
*/
public String getContactListName() {
return this.contactListName;
}
/**
*
* The name of the contact list.
*
*
* @param contactListName
* The name of the contact list.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateContactRequest withContactListName(String contactListName) {
setContactListName(contactListName);
return this;
}
/**
*
* The contact's email addres.
*
*
* @param emailAddress
* The contact's email addres.
*/
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
/**
*
* The contact's email addres.
*
*
* @return The contact's email addres.
*/
public String getEmailAddress() {
return this.emailAddress;
}
/**
*
* The contact's email addres.
*
*
* @param emailAddress
* The contact's email addres.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateContactRequest withEmailAddress(String emailAddress) {
setEmailAddress(emailAddress);
return this;
}
/**
*
* The contact's preference for being opted-in to or opted-out of a topic.
*
*
* @return The contact's preference for being opted-in to or opted-out of a topic.
*/
public java.util.List getTopicPreferences() {
return topicPreferences;
}
/**
*
* The contact's preference for being opted-in to or opted-out of a topic.
*
*
* @param topicPreferences
* The contact's preference for being opted-in to or opted-out of a topic.
*/
public void setTopicPreferences(java.util.Collection topicPreferences) {
if (topicPreferences == null) {
this.topicPreferences = null;
return;
}
this.topicPreferences = new java.util.ArrayList(topicPreferences);
}
/**
*
* The contact's preference for being opted-in to or opted-out of a topic.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTopicPreferences(java.util.Collection)} or {@link #withTopicPreferences(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param topicPreferences
* The contact's preference for being opted-in to or opted-out of a topic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateContactRequest withTopicPreferences(TopicPreference... topicPreferences) {
if (this.topicPreferences == null) {
setTopicPreferences(new java.util.ArrayList(topicPreferences.length));
}
for (TopicPreference ele : topicPreferences) {
this.topicPreferences.add(ele);
}
return this;
}
/**
*
* The contact's preference for being opted-in to or opted-out of a topic.
*
*
* @param topicPreferences
* The contact's preference for being opted-in to or opted-out of a topic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateContactRequest withTopicPreferences(java.util.Collection topicPreferences) {
setTopicPreferences(topicPreferences);
return this;
}
/**
*
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
*
*
* @param unsubscribeAll
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
*/
public void setUnsubscribeAll(Boolean unsubscribeAll) {
this.unsubscribeAll = unsubscribeAll;
}
/**
*
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
*
*
* @return A boolean value status noting if the contact is unsubscribed from all contact list topics.
*/
public Boolean getUnsubscribeAll() {
return this.unsubscribeAll;
}
/**
*
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
*
*
* @param unsubscribeAll
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateContactRequest withUnsubscribeAll(Boolean unsubscribeAll) {
setUnsubscribeAll(unsubscribeAll);
return this;
}
/**
*
* A boolean value status noting if the contact is unsubscribed from all contact list topics.
*
*
* @return A boolean value status noting if the contact is unsubscribed from all contact list topics.
*/
public Boolean isUnsubscribeAll() {
return this.unsubscribeAll;
}
/**
*
* The attribute data attached to a contact.
*
*
* @param attributesData
* The attribute data attached to a contact.
*/
public void setAttributesData(String attributesData) {
this.attributesData = attributesData;
}
/**
*
* The attribute data attached to a contact.
*
*
* @return The attribute data attached to a contact.
*/
public String getAttributesData() {
return this.attributesData;
}
/**
*
* The attribute data attached to a contact.
*
*
* @param attributesData
* The attribute data attached to a contact.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateContactRequest withAttributesData(String attributesData) {
setAttributesData(attributesData);
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 (getContactListName() != null)
sb.append("ContactListName: ").append(getContactListName()).append(",");
if (getEmailAddress() != null)
sb.append("EmailAddress: ").append(getEmailAddress()).append(",");
if (getTopicPreferences() != null)
sb.append("TopicPreferences: ").append(getTopicPreferences()).append(",");
if (getUnsubscribeAll() != null)
sb.append("UnsubscribeAll: ").append(getUnsubscribeAll()).append(",");
if (getAttributesData() != null)
sb.append("AttributesData: ").append(getAttributesData());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateContactRequest == false)
return false;
UpdateContactRequest other = (UpdateContactRequest) obj;
if (other.getContactListName() == null ^ this.getContactListName() == null)
return false;
if (other.getContactListName() != null && other.getContactListName().equals(this.getContactListName()) == false)
return false;
if (other.getEmailAddress() == null ^ this.getEmailAddress() == null)
return false;
if (other.getEmailAddress() != null && other.getEmailAddress().equals(this.getEmailAddress()) == false)
return false;
if (other.getTopicPreferences() == null ^ this.getTopicPreferences() == null)
return false;
if (other.getTopicPreferences() != null && other.getTopicPreferences().equals(this.getTopicPreferences()) == false)
return false;
if (other.getUnsubscribeAll() == null ^ this.getUnsubscribeAll() == null)
return false;
if (other.getUnsubscribeAll() != null && other.getUnsubscribeAll().equals(this.getUnsubscribeAll()) == false)
return false;
if (other.getAttributesData() == null ^ this.getAttributesData() == null)
return false;
if (other.getAttributesData() != null && other.getAttributesData().equals(this.getAttributesData()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getContactListName() == null) ? 0 : getContactListName().hashCode());
hashCode = prime * hashCode + ((getEmailAddress() == null) ? 0 : getEmailAddress().hashCode());
hashCode = prime * hashCode + ((getTopicPreferences() == null) ? 0 : getTopicPreferences().hashCode());
hashCode = prime * hashCode + ((getUnsubscribeAll() == null) ? 0 : getUnsubscribeAll().hashCode());
hashCode = prime * hashCode + ((getAttributesData() == null) ? 0 : getAttributesData().hashCode());
return hashCode;
}
@Override
public UpdateContactRequest clone() {
return (UpdateContactRequest) super.clone();
}
}