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

commonMain.aws.sdk.kotlin.services.kms.model.UpdatePrimaryRegionRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kms.model

import aws.smithy.kotlin.runtime.SdkDsl

public class UpdatePrimaryRegionRequest private constructor(builder: Builder) {
    /**
     * Identifies the current primary key. When the operation completes, this KMS key will be a replica key.
     *
     * Specify the key ID or key ARN of a multi-Region primary key.
     *
     * For example:
     * + Key ID: `mrk-1234abcd12ab34cd56ef1234567890ab`
     * + Key ARN: `arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab`
     *
     * To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
     */
    public val keyId: kotlin.String? = builder.keyId
    /**
     * The Amazon Web Services Region of the new primary key. Enter the Region ID, such as `us-east-1` or `ap-southeast-2`. There must be an existing replica key in this Region.
     *
     * When the operation completes, the multi-Region key in this Region will be the primary key.
     */
    public val primaryRegion: kotlin.String? = builder.primaryRegion

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

    override fun toString(): kotlin.String = buildString {
        append("UpdatePrimaryRegionRequest(")
        append("keyId=$keyId,")
        append("primaryRegion=$primaryRegion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = keyId?.hashCode() ?: 0
        result = 31 * result + (primaryRegion?.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 UpdatePrimaryRegionRequest

        if (keyId != other.keyId) return false
        if (primaryRegion != other.primaryRegion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Identifies the current primary key. When the operation completes, this KMS key will be a replica key.
         *
         * Specify the key ID or key ARN of a multi-Region primary key.
         *
         * For example:
         * + Key ID: `mrk-1234abcd12ab34cd56ef1234567890ab`
         * + Key ARN: `arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab`
         *
         * To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
         */
        public var keyId: kotlin.String? = null
        /**
         * The Amazon Web Services Region of the new primary key. Enter the Region ID, such as `us-east-1` or `ap-southeast-2`. There must be an existing replica key in this Region.
         *
         * When the operation completes, the multi-Region key in this Region will be the primary key.
         */
        public var primaryRegion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kms.model.UpdatePrimaryRegionRequest) : this() {
            this.keyId = x.keyId
            this.primaryRegion = x.primaryRegion
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy