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

commonMain.aws.sdk.kotlin.services.backupgateway.model.AssociateGatewayToServerRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.backupgateway.model

import aws.smithy.kotlin.runtime.SdkDsl

public class AssociateGatewayToServerRequest private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the gateway. Use the `ListGateways` operation to return a list of gateways for your account and Amazon Web Services Region.
     */
    public val gatewayArn: kotlin.String = requireNotNull(builder.gatewayArn) { "A non-null value must be provided for gatewayArn" }
    /**
     * The Amazon Resource Name (ARN) of the server that hosts your virtual machines.
     */
    public val serverArn: kotlin.String = requireNotNull(builder.serverArn) { "A non-null value must be provided for serverArn" }

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

    override fun toString(): kotlin.String = buildString {
        append("AssociateGatewayToServerRequest(")
        append("gatewayArn=$gatewayArn,")
        append("serverArn=$serverArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = gatewayArn.hashCode()
        result = 31 * result + (serverArn.hashCode())
        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 AssociateGatewayToServerRequest

        if (gatewayArn != other.gatewayArn) return false
        if (serverArn != other.serverArn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the gateway. Use the `ListGateways` operation to return a list of gateways for your account and Amazon Web Services Region.
         */
        public var gatewayArn: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the server that hosts your virtual machines.
         */
        public var serverArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.backupgateway.model.AssociateGatewayToServerRequest) : this() {
            this.gatewayArn = x.gatewayArn
            this.serverArn = x.serverArn
        }

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

        internal fun correctErrors(): Builder {
            if (gatewayArn == null) gatewayArn = ""
            if (serverArn == null) serverArn = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy