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

commonMain.aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SendTextMessageRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.pinpointsmsvoicev2.model

import aws.smithy.kotlin.runtime.SdkDsl

public class SendTextMessageRequest private constructor(builder: Builder) {
    /**
     * The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
     */
    public val configurationSetName: kotlin.String? = builder.configurationSetName
    /**
     * You can specify custom data in this field. If you do, that data is logged to the event destination.
     */
    public val context: Map? = builder.context
    /**
     * 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](https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-senderid-india.html).
     * + `IN_ENTITY_ID` The entity ID or Principal Entity (PE) ID that you received after completing the sender ID registration process.
     * + `IN_TEMPLATE_ID` The template ID that you received after completing the sender ID registration process.Make sure that the Template ID that you specify matches your message template exactly. If your message doesn't match the template that you provided during the registration process, the mobile carriers might reject your message.
     */
    public val destinationCountryParameters: Map? = builder.destinationCountryParameters
    /**
     * The destination phone number in E.164 format.
     */
    public val destinationPhoneNumber: kotlin.String? = builder.destinationPhoneNumber
    /**
     * When set to true, the message is checked and validated, but isn't sent to the end recipient. You are not charged for using `DryRun`.
     *
     * The Message Parts per Second (MPS) limit when using `DryRun` is five. If your origination identity has a lower MPS limit then the lower MPS limit is used. For more information about MPS limits, see [Message Parts per Second (MPS) limits](https://docs.aws.amazon.com/sms-voice/latest/userguide/sms-limitations-mps.html) in the *AWS End User Messaging SMS User Guide*..
     */
    public val dryRun: kotlin.Boolean? = builder.dryRun
    /**
     * 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 val keyword: kotlin.String? = builder.keyword
    /**
     * The maximum amount that you want to spend, in US dollars, per each text message. If the calculated amount to send the text message is greater than `MaxPrice`, the message is not sent and an error is returned.
     */
    public val maxPrice: kotlin.String? = builder.maxPrice
    /**
     * The body of the text message.
     */
    public val messageBody: kotlin.String? = builder.messageBody
    /**
     * The type of message. Valid values are for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.
     */
    public val messageType: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.MessageType? = builder.messageType
    /**
     * The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.
     */
    public val originationIdentity: kotlin.String? = builder.originationIdentity
    /**
     * The unique identifier for the protect configuration.
     */
    public val protectConfigurationId: kotlin.String? = builder.protectConfigurationId
    /**
     * How long the text message is valid for, in seconds. By default this is 72 hours. If the messages isn't handed off before the TTL expires we stop attempting to hand off the message and return `TTL_EXPIRED` event.
     */
    public val timeToLive: kotlin.Int? = builder.timeToLive

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SendTextMessageRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("SendTextMessageRequest(")
        append("configurationSetName=$configurationSetName,")
        append("context=$context,")
        append("destinationCountryParameters=$destinationCountryParameters,")
        append("destinationPhoneNumber=$destinationPhoneNumber,")
        append("dryRun=$dryRun,")
        append("keyword=$keyword,")
        append("maxPrice=$maxPrice,")
        append("messageBody=$messageBody,")
        append("messageType=$messageType,")
        append("originationIdentity=$originationIdentity,")
        append("protectConfigurationId=$protectConfigurationId,")
        append("timeToLive=$timeToLive")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = configurationSetName?.hashCode() ?: 0
        result = 31 * result + (context?.hashCode() ?: 0)
        result = 31 * result + (destinationCountryParameters?.hashCode() ?: 0)
        result = 31 * result + (destinationPhoneNumber?.hashCode() ?: 0)
        result = 31 * result + (dryRun?.hashCode() ?: 0)
        result = 31 * result + (keyword?.hashCode() ?: 0)
        result = 31 * result + (maxPrice?.hashCode() ?: 0)
        result = 31 * result + (messageBody?.hashCode() ?: 0)
        result = 31 * result + (messageType?.hashCode() ?: 0)
        result = 31 * result + (originationIdentity?.hashCode() ?: 0)
        result = 31 * result + (protectConfigurationId?.hashCode() ?: 0)
        result = 31 * result + (timeToLive ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as SendTextMessageRequest

        if (configurationSetName != other.configurationSetName) return false
        if (context != other.context) return false
        if (destinationCountryParameters != other.destinationCountryParameters) return false
        if (destinationPhoneNumber != other.destinationPhoneNumber) return false
        if (dryRun != other.dryRun) return false
        if (keyword != other.keyword) return false
        if (maxPrice != other.maxPrice) return false
        if (messageBody != other.messageBody) return false
        if (messageType != other.messageType) return false
        if (originationIdentity != other.originationIdentity) return false
        if (protectConfigurationId != other.protectConfigurationId) return false
        if (timeToLive != other.timeToLive) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SendTextMessageRequest = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
         */
        public var configurationSetName: kotlin.String? = null
        /**
         * You can specify custom data in this field. If you do, that data is logged to the event destination.
         */
        public var context: Map? = null
        /**
         * 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](https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-senderid-india.html).
         * + `IN_ENTITY_ID` The entity ID or Principal Entity (PE) ID that you received after completing the sender ID registration process.
         * + `IN_TEMPLATE_ID` The template ID that you received after completing the sender ID registration process.Make sure that the Template ID that you specify matches your message template exactly. If your message doesn't match the template that you provided during the registration process, the mobile carriers might reject your message.
         */
        public var destinationCountryParameters: Map? = null
        /**
         * The destination phone number in E.164 format.
         */
        public var destinationPhoneNumber: kotlin.String? = null
        /**
         * When set to true, the message is checked and validated, but isn't sent to the end recipient. You are not charged for using `DryRun`.
         *
         * The Message Parts per Second (MPS) limit when using `DryRun` is five. If your origination identity has a lower MPS limit then the lower MPS limit is used. For more information about MPS limits, see [Message Parts per Second (MPS) limits](https://docs.aws.amazon.com/sms-voice/latest/userguide/sms-limitations-mps.html) in the *AWS End User Messaging SMS User Guide*..
         */
        public var dryRun: kotlin.Boolean? = null
        /**
         * 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 var keyword: kotlin.String? = null
        /**
         * The maximum amount that you want to spend, in US dollars, per each text message. If the calculated amount to send the text message is greater than `MaxPrice`, the message is not sent and an error is returned.
         */
        public var maxPrice: kotlin.String? = null
        /**
         * The body of the text message.
         */
        public var messageBody: kotlin.String? = null
        /**
         * The type of message. Valid values are for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.
         */
        public var messageType: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.MessageType? = null
        /**
         * The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.
         */
        public var originationIdentity: kotlin.String? = null
        /**
         * The unique identifier for the protect configuration.
         */
        public var protectConfigurationId: kotlin.String? = null
        /**
         * How long the text message is valid for, in seconds. By default this is 72 hours. If the messages isn't handed off before the TTL expires we stop attempting to hand off the message and return `TTL_EXPIRED` event.
         */
        public var timeToLive: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SendTextMessageRequest) : this() {
            this.configurationSetName = x.configurationSetName
            this.context = x.context
            this.destinationCountryParameters = x.destinationCountryParameters
            this.destinationPhoneNumber = x.destinationPhoneNumber
            this.dryRun = x.dryRun
            this.keyword = x.keyword
            this.maxPrice = x.maxPrice
            this.messageBody = x.messageBody
            this.messageType = x.messageType
            this.originationIdentity = x.originationIdentity
            this.protectConfigurationId = x.protectConfigurationId
            this.timeToLive = x.timeToLive
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SendTextMessageRequest = SendTextMessageRequest(this)

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy