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

commonMain.aws.sdk.kotlin.services.ivschat.model.DisconnectUserRequest.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.ivschat.model

import aws.smithy.kotlin.runtime.SdkDsl

public class DisconnectUserRequest private constructor(builder: Builder) {
    /**
     * Reason for disconnecting the user.
     */
    public val reason: kotlin.String? = builder.reason
    /**
     * Identifier of the room from which the user's clients should be disconnected. Currently this must be an ARN.
     */
    public val roomIdentifier: kotlin.String = requireNotNull(builder.roomIdentifier) { "A non-null value must be provided for roomIdentifier" }
    /**
     * ID of the user (connection) to disconnect from the room.
     */
    public val userId: kotlin.String = requireNotNull(builder.userId) { "A non-null value must be provided for userId" }

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

    override fun toString(): kotlin.String = buildString {
        append("DisconnectUserRequest(")
        append("reason=$reason,")
        append("roomIdentifier=$roomIdentifier,")
        append("userId=*** Sensitive Data Redacted ***")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = reason?.hashCode() ?: 0
        result = 31 * result + (roomIdentifier.hashCode())
        result = 31 * result + (userId.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 DisconnectUserRequest

        if (reason != other.reason) return false
        if (roomIdentifier != other.roomIdentifier) return false
        if (userId != other.userId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Reason for disconnecting the user.
         */
        public var reason: kotlin.String? = null
        /**
         * Identifier of the room from which the user's clients should be disconnected. Currently this must be an ARN.
         */
        public var roomIdentifier: kotlin.String? = null
        /**
         * ID of the user (connection) to disconnect from the room.
         */
        public var userId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ivschat.model.DisconnectUserRequest) : this() {
            this.reason = x.reason
            this.roomIdentifier = x.roomIdentifier
            this.userId = x.userId
        }

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

        internal fun correctErrors(): Builder {
            if (roomIdentifier == null) roomIdentifier = ""
            if (userId == null) userId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy