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

commonMain.aws.sdk.kotlin.services.wisdom.model.CreateAssistantAssociationRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wisdom.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateAssistantAssociationRequest private constructor(builder: Builder) {
    /**
     * The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
     */
    public val assistantId: kotlin.String = requireNotNull(builder.assistantId) { "A non-null value must be provided for assistantId" }
    /**
     * The identifier of the associated resource.
     */
    public val association: aws.sdk.kotlin.services.wisdom.model.AssistantAssociationInputData? = builder.association
    /**
     * The type of association.
     */
    public val associationType: aws.sdk.kotlin.services.wisdom.model.AssociationType = requireNotNull(builder.associationType) { "A non-null value must be provided for associationType" }
    /**
     * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see [Making retries safe with idempotent APIs](https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/).
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The tags used to organize, track, or control access for this resource.
     */
    public val tags: Map? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateAssistantAssociationRequest(")
        append("assistantId=$assistantId,")
        append("association=$association,")
        append("associationType=$associationType,")
        append("clientToken=$clientToken,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = assistantId.hashCode()
        result = 31 * result + (association?.hashCode() ?: 0)
        result = 31 * result + (associationType.hashCode())
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (tags?.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 CreateAssistantAssociationRequest

        if (assistantId != other.assistantId) return false
        if (association != other.association) return false
        if (associationType != other.associationType) return false
        if (clientToken != other.clientToken) return false
        if (tags != other.tags) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
         */
        public var assistantId: kotlin.String? = null
        /**
         * The identifier of the associated resource.
         */
        public var association: aws.sdk.kotlin.services.wisdom.model.AssistantAssociationInputData? = null
        /**
         * The type of association.
         */
        public var associationType: aws.sdk.kotlin.services.wisdom.model.AssociationType? = null
        /**
         * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see [Making retries safe with idempotent APIs](https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/).
         */
        public var clientToken: kotlin.String? = null
        /**
         * The tags used to organize, track, or control access for this resource.
         */
        public var tags: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wisdom.model.CreateAssistantAssociationRequest) : this() {
            this.assistantId = x.assistantId
            this.association = x.association
            this.associationType = x.associationType
            this.clientToken = x.clientToken
            this.tags = x.tags
        }

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

        internal fun correctErrors(): Builder {
            if (assistantId == null) assistantId = ""
            if (associationType == null) associationType = AssociationType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy