/* * 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.pinpointsmsvoicev2.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 SendTextMessageRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The destination phone number in E.164 format. *
*/ private String destinationPhoneNumber; /** ** The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, * SenderId, SenderIdArn, PoolId, or PoolArn. *
*/ private String originationIdentity; /** ** The body of the text message. *
*/ private String messageBody; /** ** The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. *
*/ private String messageType; /** ** When you register a short code in the US, you must specify a program name. If you don’t have a US short code, * omit this attribute. *
*/ private String keyword; /** ** The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn. *
*/ private String configurationSetName; /** ** The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain * multiple parts. *
*/ private String maxPrice; /** ** How long the text message is valid for. By default this is 72 hours. *
*/ private Integer timeToLive; /** ** You can specify custom data in this field. If you do, that data is logged to the event destination. *
*/ private java.util.Map* This field is used for any country-specific registration requirements. Currently, this setting is only used when * you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. *
*/ private java.util.Map* When set to true, the message is checked and validated, but isn't sent to the end recipient. *
*/ private Boolean dryRun; /** ** The destination phone number in E.164 format. *
* * @param destinationPhoneNumber * The destination phone number in E.164 format. */ public void setDestinationPhoneNumber(String destinationPhoneNumber) { this.destinationPhoneNumber = destinationPhoneNumber; } /** ** The destination phone number in E.164 format. *
* * @return The destination phone number in E.164 format. */ public String getDestinationPhoneNumber() { return this.destinationPhoneNumber; } /** ** The destination phone number in E.164 format. *
* * @param destinationPhoneNumber * The destination phone number in E.164 format. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withDestinationPhoneNumber(String destinationPhoneNumber) { setDestinationPhoneNumber(destinationPhoneNumber); return this; } /** ** The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, * SenderId, SenderIdArn, PoolId, or PoolArn. *
* * @param originationIdentity * The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, * PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn. */ public void setOriginationIdentity(String originationIdentity) { this.originationIdentity = originationIdentity; } /** ** The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, * SenderId, SenderIdArn, PoolId, or PoolArn. *
* * @return The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, * PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn. */ public String getOriginationIdentity() { return this.originationIdentity; } /** ** The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, * SenderId, SenderIdArn, PoolId, or PoolArn. *
* * @param originationIdentity * The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, * PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withOriginationIdentity(String originationIdentity) { setOriginationIdentity(originationIdentity); return this; } /** ** The body of the text message. *
* * @param messageBody * The body of the text message. */ public void setMessageBody(String messageBody) { this.messageBody = messageBody; } /** ** The body of the text message. *
* * @return The body of the text message. */ public String getMessageBody() { return this.messageBody; } /** ** The body of the text message. *
* * @param messageBody * The body of the text message. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withMessageBody(String messageBody) { setMessageBody(messageBody); return this; } /** ** The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. *
* * @param messageType * The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. * @see MessageType */ public void setMessageType(String messageType) { this.messageType = messageType; } /** ** The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. *
* * @return The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. * @see MessageType */ public String getMessageType() { return this.messageType; } /** ** The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. *
* * @param messageType * The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. * @return Returns a reference to this object so that method calls can be chained together. * @see MessageType */ public SendTextMessageRequest withMessageType(String messageType) { setMessageType(messageType); return this; } /** ** The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. *
* * @param messageType * The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and * PROMOTIONAL for messages that aren't critical or time-sensitive. * @return Returns a reference to this object so that method calls can be chained together. * @see MessageType */ public SendTextMessageRequest withMessageType(MessageType messageType) { this.messageType = messageType.toString(); return this; } /** ** When you register a short code in the US, you must specify a program name. If you don’t have a US short code, * omit this attribute. *
* * @param keyword * When you register a short code in the US, you must specify a program name. If you don’t have a US short * code, omit this attribute. */ public void setKeyword(String keyword) { this.keyword = keyword; } /** ** When you register a short code in the US, you must specify a program name. If you don’t have a US short code, * omit this attribute. *
* * @return When you register a short code in the US, you must specify a program name. If you don’t have a US short * code, omit this attribute. */ public String getKeyword() { return this.keyword; } /** ** When you register a short code in the US, you must specify a program name. If you don’t have a US short code, * omit this attribute. *
* * @param keyword * When you register a short code in the US, you must specify a program name. If you don’t have a US short * code, omit this attribute. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withKeyword(String keyword) { setKeyword(keyword); return this; } /** ** The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn. *
* * @param configurationSetName * The name of the configuration set to use. This can be either the ConfigurationSetName or * ConfigurationSetArn. */ public void setConfigurationSetName(String configurationSetName) { this.configurationSetName = configurationSetName; } /** ** The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn. *
* * @return The name of the configuration set to use. This can be either the ConfigurationSetName or * ConfigurationSetArn. */ public String getConfigurationSetName() { return this.configurationSetName; } /** ** The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn. *
* * @param configurationSetName * The name of the configuration set to use. This can be either the ConfigurationSetName or * ConfigurationSetArn. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withConfigurationSetName(String configurationSetName) { setConfigurationSetName(configurationSetName); return this; } /** ** The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain * multiple parts. *
* * @param maxPrice * The maximum amount that you want to spend, in US dollars, per each text message part. A text message can * contain multiple parts. */ public void setMaxPrice(String maxPrice) { this.maxPrice = maxPrice; } /** ** The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain * multiple parts. *
* * @return The maximum amount that you want to spend, in US dollars, per each text message part. A text message can * contain multiple parts. */ public String getMaxPrice() { return this.maxPrice; } /** ** The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain * multiple parts. *
* * @param maxPrice * The maximum amount that you want to spend, in US dollars, per each text message part. A text message can * contain multiple parts. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withMaxPrice(String maxPrice) { setMaxPrice(maxPrice); return this; } /** ** How long the text message is valid for. By default this is 72 hours. *
* * @param timeToLive * How long the text message is valid for. By default this is 72 hours. */ public void setTimeToLive(Integer timeToLive) { this.timeToLive = timeToLive; } /** ** How long the text message is valid for. By default this is 72 hours. *
* * @return How long the text message is valid for. By default this is 72 hours. */ public Integer getTimeToLive() { return this.timeToLive; } /** ** How long the text message is valid for. By default this is 72 hours. *
* * @param timeToLive * How long the text message is valid for. By default this is 72 hours. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withTimeToLive(Integer timeToLive) { setTimeToLive(timeToLive); return this; } /** ** You can specify custom data in this field. If you do, that data is logged to the event destination. *
* * @return You can specify custom data in this field. If you do, that data is logged to the event destination. */ public java.util.Map* You can specify custom data in this field. If you do, that data is logged to the event destination. *
* * @param context * You can specify custom data in this field. If you do, that data is logged to the event destination. */ public void setContext(java.util.Map* You can specify custom data in this field. If you do, that data is logged to the event destination. *
* * @param context * You can specify custom data in this field. If you do, that data is logged to the event destination. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withContext(java.util.Map* This field is used for any country-specific registration requirements. Currently, this setting is only used when * you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. *
* * @return This field is used for any country-specific registration requirements. Currently, this setting is only * used when you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. */ public java.util.Map* This field is used for any country-specific registration requirements. Currently, this setting is only used when * you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. *
* * @param destinationCountryParameters * This field is used for any country-specific registration requirements. Currently, this setting is only * used when you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. */ public void setDestinationCountryParameters(java.util.Map* This field is used for any country-specific registration requirements. Currently, this setting is only used when * you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. *
* * @param destinationCountryParameters * This field is used for any country-specific registration requirements. Currently, this setting is only * used when you send messages to recipients in India using a sender ID. For more information see Special * requirements for sending SMS messages to recipients in India. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withDestinationCountryParameters(java.util.Map* When set to true, the message is checked and validated, but isn't sent to the end recipient. *
* * @param dryRun * When set to true, the message is checked and validated, but isn't sent to the end recipient. */ public void setDryRun(Boolean dryRun) { this.dryRun = dryRun; } /** ** When set to true, the message is checked and validated, but isn't sent to the end recipient. *
* * @return When set to true, the message is checked and validated, but isn't sent to the end recipient. */ public Boolean getDryRun() { return this.dryRun; } /** ** When set to true, the message is checked and validated, but isn't sent to the end recipient. *
* * @param dryRun * When set to true, the message is checked and validated, but isn't sent to the end recipient. * @return Returns a reference to this object so that method calls can be chained together. */ public SendTextMessageRequest withDryRun(Boolean dryRun) { setDryRun(dryRun); return this; } /** ** When set to true, the message is checked and validated, but isn't sent to the end recipient. *
* * @return When set to true, the message is checked and validated, but isn't sent to the end recipient. */ public Boolean isDryRun() { return this.dryRun; } /** * 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 (getDestinationPhoneNumber() != null) sb.append("DestinationPhoneNumber: ").append(getDestinationPhoneNumber()).append(","); if (getOriginationIdentity() != null) sb.append("OriginationIdentity: ").append(getOriginationIdentity()).append(","); if (getMessageBody() != null) sb.append("MessageBody: ").append(getMessageBody()).append(","); if (getMessageType() != null) sb.append("MessageType: ").append(getMessageType()).append(","); if (getKeyword() != null) sb.append("Keyword: ").append(getKeyword()).append(","); if (getConfigurationSetName() != null) sb.append("ConfigurationSetName: ").append(getConfigurationSetName()).append(","); if (getMaxPrice() != null) sb.append("MaxPrice: ").append(getMaxPrice()).append(","); if (getTimeToLive() != null) sb.append("TimeToLive: ").append(getTimeToLive()).append(","); if (getContext() != null) sb.append("Context: ").append(getContext()).append(","); if (getDestinationCountryParameters() != null) sb.append("DestinationCountryParameters: ").append(getDestinationCountryParameters()).append(","); if (getDryRun() != null) sb.append("DryRun: ").append(getDryRun()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SendTextMessageRequest == false) return false; SendTextMessageRequest other = (SendTextMessageRequest) obj; if (other.getDestinationPhoneNumber() == null ^ this.getDestinationPhoneNumber() == null) return false; if (other.getDestinationPhoneNumber() != null && other.getDestinationPhoneNumber().equals(this.getDestinationPhoneNumber()) == false) return false; if (other.getOriginationIdentity() == null ^ this.getOriginationIdentity() == null) return false; if (other.getOriginationIdentity() != null && other.getOriginationIdentity().equals(this.getOriginationIdentity()) == false) return false; if (other.getMessageBody() == null ^ this.getMessageBody() == null) return false; if (other.getMessageBody() != null && other.getMessageBody().equals(this.getMessageBody()) == false) return false; if (other.getMessageType() == null ^ this.getMessageType() == null) return false; if (other.getMessageType() != null && other.getMessageType().equals(this.getMessageType()) == false) return false; if (other.getKeyword() == null ^ this.getKeyword() == null) return false; if (other.getKeyword() != null && other.getKeyword().equals(this.getKeyword()) == false) return false; if (other.getConfigurationSetName() == null ^ this.getConfigurationSetName() == null) return false; if (other.getConfigurationSetName() != null && other.getConfigurationSetName().equals(this.getConfigurationSetName()) == false) return false; if (other.getMaxPrice() == null ^ this.getMaxPrice() == null) return false; if (other.getMaxPrice() != null && other.getMaxPrice().equals(this.getMaxPrice()) == false) return false; if (other.getTimeToLive() == null ^ this.getTimeToLive() == null) return false; if (other.getTimeToLive() != null && other.getTimeToLive().equals(this.getTimeToLive()) == false) return false; if (other.getContext() == null ^ this.getContext() == null) return false; if (other.getContext() != null && other.getContext().equals(this.getContext()) == false) return false; if (other.getDestinationCountryParameters() == null ^ this.getDestinationCountryParameters() == null) return false; if (other.getDestinationCountryParameters() != null && other.getDestinationCountryParameters().equals(this.getDestinationCountryParameters()) == false) return false; if (other.getDryRun() == null ^ this.getDryRun() == null) return false; if (other.getDryRun() != null && other.getDryRun().equals(this.getDryRun()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDestinationPhoneNumber() == null) ? 0 : getDestinationPhoneNumber().hashCode()); hashCode = prime * hashCode + ((getOriginationIdentity() == null) ? 0 : getOriginationIdentity().hashCode()); hashCode = prime * hashCode + ((getMessageBody() == null) ? 0 : getMessageBody().hashCode()); hashCode = prime * hashCode + ((getMessageType() == null) ? 0 : getMessageType().hashCode()); hashCode = prime * hashCode + ((getKeyword() == null) ? 0 : getKeyword().hashCode()); hashCode = prime * hashCode + ((getConfigurationSetName() == null) ? 0 : getConfigurationSetName().hashCode()); hashCode = prime * hashCode + ((getMaxPrice() == null) ? 0 : getMaxPrice().hashCode()); hashCode = prime * hashCode + ((getTimeToLive() == null) ? 0 : getTimeToLive().hashCode()); hashCode = prime * hashCode + ((getContext() == null) ? 0 : getContext().hashCode()); hashCode = prime * hashCode + ((getDestinationCountryParameters() == null) ? 0 : getDestinationCountryParameters().hashCode()); hashCode = prime * hashCode + ((getDryRun() == null) ? 0 : getDryRun().hashCode()); return hashCode; } @Override public SendTextMessageRequest clone() { return (SendTextMessageRequest) super.clone(); } }