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

commonMain.aws.sdk.kotlin.services.licensemanagerusersubscriptions.model.DisassociateUserRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.licensemanagerusersubscriptions.model

import aws.smithy.kotlin.runtime.SdkDsl

public class DisassociateUserRequest private constructor(builder: Builder) {
    /**
     * The domain name of the user.
     */
    public val domain: kotlin.String? = builder.domain
    /**
     * An object that specifies details for the identity provider.
     */
    public val identityProvider: aws.sdk.kotlin.services.licensemanagerusersubscriptions.model.IdentityProvider? = builder.identityProvider
    /**
     * The ID of the EC2 instance, which provides user-based subscriptions.
     */
    public val instanceId: kotlin.String = requireNotNull(builder.instanceId) { "A non-null value must be provided for instanceId" }
    /**
     * The user name from the identity provider for the user.
     */
    public val username: kotlin.String = requireNotNull(builder.username) { "A non-null value must be provided for username" }

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

    override fun toString(): kotlin.String = buildString {
        append("DisassociateUserRequest(")
        append("domain=$domain,")
        append("identityProvider=$identityProvider,")
        append("instanceId=$instanceId,")
        append("username=$username")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = domain?.hashCode() ?: 0
        result = 31 * result + (identityProvider?.hashCode() ?: 0)
        result = 31 * result + (instanceId.hashCode())
        result = 31 * result + (username.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 DisassociateUserRequest

        if (domain != other.domain) return false
        if (identityProvider != other.identityProvider) return false
        if (instanceId != other.instanceId) return false
        if (username != other.username) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The domain name of the user.
         */
        public var domain: kotlin.String? = null
        /**
         * An object that specifies details for the identity provider.
         */
        public var identityProvider: aws.sdk.kotlin.services.licensemanagerusersubscriptions.model.IdentityProvider? = null
        /**
         * The ID of the EC2 instance, which provides user-based subscriptions.
         */
        public var instanceId: kotlin.String? = null
        /**
         * The user name from the identity provider for the user.
         */
        public var username: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.licensemanagerusersubscriptions.model.DisassociateUserRequest) : this() {
            this.domain = x.domain
            this.identityProvider = x.identityProvider
            this.instanceId = x.instanceId
            this.username = x.username
        }

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

        internal fun correctErrors(): Builder {
            if (instanceId == null) instanceId = ""
            if (username == null) username = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy