/* * Copyright 2018-2023 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.lightsail.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 CreateContactMethodRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The protocol of the contact method, such as Email
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions * where SMS text messaging is supported, see Supported Regions and * Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in * Amazon Lightsail. *
*/ private String protocol; /** ** The destination of the contact method, such as an email address or a mobile phone number. *
** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure * used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, * and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 * format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia. *
*/ private String contactEndpoint; /** *
* The protocol of the contact method, such as Email
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions * where SMS text messaging is supported, see Supported Regions and * Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in * Amazon Lightsail. *
* * @param protocol * The protocol of the contact method, such asEmail
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services * Regions where SMS text messaging is supported, see Supported Regions * and Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in Amazon Lightsail. * @see ContactProtocol */ public void setProtocol(String protocol) { this.protocol = protocol; } /** *
* The protocol of the contact method, such as Email
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions * where SMS text messaging is supported, see Supported Regions and * Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in * Amazon Lightsail. *
* * @return The protocol of the contact method, such asEmail
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services * Regions where SMS text messaging is supported, see Supported Regions * and Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in Amazon Lightsail. * @see ContactProtocol */ public String getProtocol() { return this.protocol; } /** *
* The protocol of the contact method, such as Email
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions * where SMS text messaging is supported, see Supported Regions and * Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in * Amazon Lightsail. *
* * @param protocol * The protocol of the contact method, such asEmail
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services * Regions where SMS text messaging is supported, see Supported Regions * and Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in Amazon Lightsail. * @return Returns a reference to this object so that method calls can be chained together. * @see ContactProtocol */ public CreateContactMethodRequest withProtocol(String protocol) { setProtocol(protocol); return this; } /** *
* The protocol of the contact method, such as Email
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions * where SMS text messaging is supported, see Supported Regions and * Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in * Amazon Lightsail. *
* * @param protocol * The protocol of the contact method, such asEmail
or SMS
(text messaging).
*
* The SMS
protocol is supported only in the following Amazon Web Services Regions.
*
* US East (N. Virginia) (us-east-1
)
*
* US West (Oregon) (us-west-2
)
*
* Europe (Ireland) (eu-west-1
)
*
* Asia Pacific (Tokyo) (ap-northeast-1
)
*
* Asia Pacific (Singapore) (ap-southeast-1
)
*
* Asia Pacific (Sydney) (ap-southeast-2
)
*
* For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services * Regions where SMS text messaging is supported, see Supported Regions * and Countries in the Amazon SNS Developer Guide. *
** For more information about notifications in Amazon Lightsail, see Notifications in Amazon Lightsail. * @return Returns a reference to this object so that method calls can be chained together. * @see ContactProtocol */ public CreateContactMethodRequest withProtocol(ContactProtocol protocol) { this.protocol = protocol.toString(); return this; } /** *
* The destination of the contact method, such as an email address or a mobile phone number. *
** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure * used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, * and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 * format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia. *
* * @param contactEndpoint * The destination of the contact method, such as an email address or a mobile phone number. ** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number * structure used for international telecommunication. Phone numbers that follow this format can have a * maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For example, * a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia. */ public void setContactEndpoint(String contactEndpoint) { this.contactEndpoint = contactEndpoint; } /** *
* The destination of the contact method, such as an email address or a mobile phone number. *
** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure * used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, * and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 * format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia. *
* * @return The destination of the contact method, such as an email address or a mobile phone number. ** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number * structure used for international telecommunication. Phone numbers that follow this format can have a * maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For * example, a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, * see E.164 on Wikipedia. */ public String getContactEndpoint() { return this.contactEndpoint; } /** *
* The destination of the contact method, such as an email address or a mobile phone number. *
** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure * used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, * and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 * format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia. *
* * @param contactEndpoint * The destination of the contact method, such as an email address or a mobile phone number. ** Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number * structure used for international telecommunication. Phone numbers that follow this format can have a * maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For example, * a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateContactMethodRequest withContactEndpoint(String contactEndpoint) { setContactEndpoint(contactEndpoint); 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 (getProtocol() != null) sb.append("Protocol: ").append(getProtocol()).append(","); if (getContactEndpoint() != null) sb.append("ContactEndpoint: ").append(getContactEndpoint()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateContactMethodRequest == false) return false; CreateContactMethodRequest other = (CreateContactMethodRequest) obj; if (other.getProtocol() == null ^ this.getProtocol() == null) return false; if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) return false; if (other.getContactEndpoint() == null ^ this.getContactEndpoint() == null) return false; if (other.getContactEndpoint() != null && other.getContactEndpoint().equals(this.getContactEndpoint()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); hashCode = prime * hashCode + ((getContactEndpoint() == null) ? 0 : getContactEndpoint().hashCode()); return hashCode; } @Override public CreateContactMethodRequest clone() { return (CreateContactMethodRequest) super.clone(); } }