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

commonMain.aws.sdk.kotlin.services.directconnect.model.AllocatePrivateVirtualInterfaceRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.directconnect.model



public class AllocatePrivateVirtualInterfaceRequest private constructor(builder: Builder) {
    /**
     * The ID of the connection on which the private virtual interface is provisioned.
     */
    public val connectionId: kotlin.String? = builder.connectionId
    /**
     * Information about the private virtual interface.
     */
    public val newPrivateVirtualInterfaceAllocation: aws.sdk.kotlin.services.directconnect.model.NewPrivateVirtualInterfaceAllocation? = builder.newPrivateVirtualInterfaceAllocation
    /**
     * The ID of the Amazon Web Services account that owns the virtual private interface.
     */
    public val ownerAccount: kotlin.String? = builder.ownerAccount

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

    override fun toString(): kotlin.String = buildString {
        append("AllocatePrivateVirtualInterfaceRequest(")
        append("connectionId=$connectionId,")
        append("newPrivateVirtualInterfaceAllocation=$newPrivateVirtualInterfaceAllocation,")
        append("ownerAccount=$ownerAccount")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = connectionId?.hashCode() ?: 0
        result = 31 * result + (newPrivateVirtualInterfaceAllocation?.hashCode() ?: 0)
        result = 31 * result + (ownerAccount?.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 AllocatePrivateVirtualInterfaceRequest

        if (connectionId != other.connectionId) return false
        if (newPrivateVirtualInterfaceAllocation != other.newPrivateVirtualInterfaceAllocation) return false
        if (ownerAccount != other.ownerAccount) return false

        return true
    }

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

    public class Builder {
        /**
         * The ID of the connection on which the private virtual interface is provisioned.
         */
        public var connectionId: kotlin.String? = null
        /**
         * Information about the private virtual interface.
         */
        public var newPrivateVirtualInterfaceAllocation: aws.sdk.kotlin.services.directconnect.model.NewPrivateVirtualInterfaceAllocation? = null
        /**
         * The ID of the Amazon Web Services account that owns the virtual private interface.
         */
        public var ownerAccount: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.directconnect.model.AllocatePrivateVirtualInterfaceRequest) : this() {
            this.connectionId = x.connectionId
            this.newPrivateVirtualInterfaceAllocation = x.newPrivateVirtualInterfaceAllocation
            this.ownerAccount = x.ownerAccount
        }

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

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

        internal fun correctErrors(): Builder {
            if (connectionId == null) connectionId = ""
            if (newPrivateVirtualInterfaceAllocation == null) newPrivateVirtualInterfaceAllocation = NewPrivateVirtualInterfaceAllocation.Builder().correctErrors().build()
            if (ownerAccount == null) ownerAccount = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy