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

commonMain.aws.sdk.kotlin.services.greengrass.model.Subscription.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.greengrass.model



/**
 * Information about a subscription.
 */
public class Subscription private constructor(builder: Builder) {
    /**
     * A descriptive or arbitrary ID for the subscription. This value must be unique within the subscription definition version. Max length is 128 characters with pattern ''[a-zA-Z0-9:_-]+''.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The source of the subscription. Can be a thing ARN, a Lambda function ARN, a connector ARN, 'cloud' (which represents the AWS IoT cloud), or 'GGShadowService'.
     */
    public val source: kotlin.String? = builder.source
    /**
     * The MQTT topic used to route the message.
     */
    public val subject: kotlin.String? = builder.subject
    /**
     * Where the message is sent to. Can be a thing ARN, a Lambda function ARN, a connector ARN, 'cloud' (which represents the AWS IoT cloud), or 'GGShadowService'.
     */
    public val target: kotlin.String? = builder.target

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

    override fun toString(): kotlin.String = buildString {
        append("Subscription(")
        append("id=$id,")
        append("source=$source,")
        append("subject=$subject,")
        append("target=$target")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = id?.hashCode() ?: 0
        result = 31 * result + (source?.hashCode() ?: 0)
        result = 31 * result + (subject?.hashCode() ?: 0)
        result = 31 * result + (target?.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 Subscription

        if (id != other.id) return false
        if (source != other.source) return false
        if (subject != other.subject) return false
        if (target != other.target) return false

        return true
    }

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

    public class Builder {
        /**
         * A descriptive or arbitrary ID for the subscription. This value must be unique within the subscription definition version. Max length is 128 characters with pattern ''[a-zA-Z0-9:_-]+''.
         */
        public var id: kotlin.String? = null
        /**
         * The source of the subscription. Can be a thing ARN, a Lambda function ARN, a connector ARN, 'cloud' (which represents the AWS IoT cloud), or 'GGShadowService'.
         */
        public var source: kotlin.String? = null
        /**
         * The MQTT topic used to route the message.
         */
        public var subject: kotlin.String? = null
        /**
         * Where the message is sent to. Can be a thing ARN, a Lambda function ARN, a connector ARN, 'cloud' (which represents the AWS IoT cloud), or 'GGShadowService'.
         */
        public var target: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.greengrass.model.Subscription) : this() {
            this.id = x.id
            this.source = x.source
            this.subject = x.subject
            this.target = x.target
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy