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

commonMain.aws.sdk.kotlin.services.sqs.model.MessageAttributeValue.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.sqs.model



/**
 * The user-specified message attribute value. For string data types, the `Value` attribute has the same restrictions on the content as the message body. For more information, see ` SendMessage.`
 *
 * `Name`, `type`, `value` and the message body must not be empty or null. All parts of the message attribute, including `Name`, `Type`, and `Value`, are part of the message size restriction (256 KiB or 262,144 bytes).
 */
public class MessageAttributeValue private constructor(builder: Builder) {
    /**
     * Not implemented. Reserved for future use.
     */
    public val binaryListValues: List? = builder.binaryListValues
    /**
     * Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.
     */
    public val binaryValue: kotlin.ByteArray? = builder.binaryValue
    /**
     * Amazon SQS supports the following logical data types: `String`, `Number`, and `Binary`. For the `Number` data type, you must use `StringValue`.
     *
     * You can also append custom labels. For more information, see [Amazon SQS Message Attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) in the *Amazon SQS Developer Guide*.
     */
    public val dataType: kotlin.String = requireNotNull(builder.dataType) { "A non-null value must be provided for dataType" }
    /**
     * Not implemented. Reserved for future use.
     */
    public val stringListValues: List? = builder.stringListValues
    /**
     * Strings are Unicode with UTF-8 binary encoding. For a list of code values, see [ASCII Printable Characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
     */
    public val stringValue: kotlin.String? = builder.stringValue

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

    override fun toString(): kotlin.String = buildString {
        append("MessageAttributeValue(")
        append("binaryListValues=$binaryListValues,")
        append("binaryValue=$binaryValue,")
        append("dataType=$dataType,")
        append("stringListValues=$stringListValues,")
        append("stringValue=$stringValue")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = binaryListValues?.hashCode() ?: 0
        result = 31 * result + (binaryValue?.contentHashCode() ?: 0)
        result = 31 * result + (dataType.hashCode())
        result = 31 * result + (stringListValues?.hashCode() ?: 0)
        result = 31 * result + (stringValue?.hashCode() ?: 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 MessageAttributeValue

        if (binaryListValues != other.binaryListValues) return false
        if (binaryValue != null) {
            if (other.binaryValue == null) return false
            if (!binaryValue.contentEquals(other.binaryValue)) return false
        } else if (other.binaryValue != null) return false
        if (dataType != other.dataType) return false
        if (stringListValues != other.stringListValues) return false
        if (stringValue != other.stringValue) return false

        return true
    }

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

    public class Builder {
        /**
         * Not implemented. Reserved for future use.
         */
        public var binaryListValues: List? = null
        /**
         * Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.
         */
        public var binaryValue: kotlin.ByteArray? = null
        /**
         * Amazon SQS supports the following logical data types: `String`, `Number`, and `Binary`. For the `Number` data type, you must use `StringValue`.
         *
         * You can also append custom labels. For more information, see [Amazon SQS Message Attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) in the *Amazon SQS Developer Guide*.
         */
        public var dataType: kotlin.String? = null
        /**
         * Not implemented. Reserved for future use.
         */
        public var stringListValues: List? = null
        /**
         * Strings are Unicode with UTF-8 binary encoding. For a list of code values, see [ASCII Printable Characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
         */
        public var stringValue: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.sqs.model.MessageAttributeValue) : this() {
            this.binaryListValues = x.binaryListValues
            this.binaryValue = x.binaryValue
            this.dataType = x.dataType
            this.stringListValues = x.stringListValues
            this.stringValue = x.stringValue
        }

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

        internal fun correctErrors(): Builder {
            if (dataType == null) dataType = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy