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

commonMain.aws.sdk.kotlin.services.iotdataplane.model.GetRetainedMessageResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotdataplane.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The output from the GetRetainedMessage operation.
 */
public class GetRetainedMessageResponse private constructor(builder: Builder) {
    /**
     * The Epoch date and time, in milliseconds, when the retained message was stored by IoT.
     */
    public val lastModifiedTime: kotlin.Long = builder.lastModifiedTime
    /**
     * The Base64-encoded message payload of the retained message body.
     */
    public val payload: kotlin.ByteArray? = builder.payload
    /**
     * The quality of service (QoS) level used to publish the retained message.
     */
    public val qos: kotlin.Int = builder.qos
    /**
     * The topic name to which the retained message was published.
     */
    public val topic: kotlin.String? = builder.topic
    /**
     * A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.
     *
     * The following example `userProperties` parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:
     *
     * `[{"deviceName": "alpha"}, {"deviceCnt": "45"}]`
     */
    public val userProperties: kotlin.ByteArray? = builder.userProperties

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

    override fun toString(): kotlin.String = buildString {
        append("GetRetainedMessageResponse(")
        append("lastModifiedTime=$lastModifiedTime,")
        append("payload=$payload,")
        append("qos=$qos,")
        append("topic=$topic,")
        append("userProperties=$userProperties")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = lastModifiedTime.hashCode()
        result = 31 * result + (payload?.contentHashCode() ?: 0)
        result = 31 * result + (qos)
        result = 31 * result + (topic?.hashCode() ?: 0)
        result = 31 * result + (userProperties?.contentHashCode() ?: 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 GetRetainedMessageResponse

        if (lastModifiedTime != other.lastModifiedTime) return false
        if (payload != null) {
            if (other.payload == null) return false
            if (!payload.contentEquals(other.payload)) return false
        } else if (other.payload != null) return false
        if (qos != other.qos) return false
        if (topic != other.topic) return false
        if (userProperties != null) {
            if (other.userProperties == null) return false
            if (!userProperties.contentEquals(other.userProperties)) return false
        } else if (other.userProperties != null) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Epoch date and time, in milliseconds, when the retained message was stored by IoT.
         */
        public var lastModifiedTime: kotlin.Long = 0L
        /**
         * The Base64-encoded message payload of the retained message body.
         */
        public var payload: kotlin.ByteArray? = null
        /**
         * The quality of service (QoS) level used to publish the retained message.
         */
        public var qos: kotlin.Int = 0
        /**
         * The topic name to which the retained message was published.
         */
        public var topic: kotlin.String? = null
        /**
         * A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.
         *
         * The following example `userProperties` parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:
         *
         * `[{"deviceName": "alpha"}, {"deviceCnt": "45"}]`
         */
        public var userProperties: kotlin.ByteArray? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotdataplane.model.GetRetainedMessageResponse) : this() {
            this.lastModifiedTime = x.lastModifiedTime
            this.payload = x.payload
            this.qos = x.qos
            this.topic = x.topic
            this.userProperties = x.userProperties
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy