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

commonMain.aws.sdk.kotlin.services.migrationhubconfig.model.CreateHomeRegionControlRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.migrationhubconfig.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateHomeRegionControlRequest private constructor(builder: Builder) {
    /**
     * Optional Boolean flag to indicate whether any effect should take place. It tests whether the caller has permission to make the call.
     */
    public val dryRun: kotlin.Boolean? = builder.dryRun
    /**
     * The name of the home region of the calling account.
     */
    public val homeRegion: kotlin.String? = builder.homeRegion
    /**
     * The account for which this command sets up a home region control. The `Target` is always of type `ACCOUNT`.
     */
    public val target: aws.sdk.kotlin.services.migrationhubconfig.model.Target? = builder.target

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

    override fun toString(): kotlin.String = buildString {
        append("CreateHomeRegionControlRequest(")
        append("dryRun=$dryRun,")
        append("homeRegion=$homeRegion,")
        append("target=$target")
        append(")")
    }

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

        if (dryRun != other.dryRun) return false
        if (homeRegion != other.homeRegion) return false
        if (target != other.target) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Optional Boolean flag to indicate whether any effect should take place. It tests whether the caller has permission to make the call.
         */
        public var dryRun: kotlin.Boolean? = null
        /**
         * The name of the home region of the calling account.
         */
        public var homeRegion: kotlin.String? = null
        /**
         * The account for which this command sets up a home region control. The `Target` is always of type `ACCOUNT`.
         */
        public var target: aws.sdk.kotlin.services.migrationhubconfig.model.Target? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.migrationhubconfig.model.CreateHomeRegionControlRequest) : this() {
            this.dryRun = x.dryRun
            this.homeRegion = x.homeRegion
            this.target = x.target
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.migrationhubconfig.model.Target] inside the given [block]
         */
        public fun target(block: aws.sdk.kotlin.services.migrationhubconfig.model.Target.Builder.() -> kotlin.Unit) {
            this.target = aws.sdk.kotlin.services.migrationhubconfig.model.Target.invoke(block)
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy