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

commonMain.aws.sdk.kotlin.services.chimesdkmessaging.model.CreateChannelMembershipRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.chimesdkmessaging.model



public class CreateChannelMembershipRequest private constructor(builder: Builder) {
    /**
     * The ARN of the channel to which you're adding users.
     */
    public val channelArn: kotlin.String? = builder.channelArn
    /**
     * The ARN of the `AppInstanceUser` or `AppInstanceBot` that makes the API call.
     */
    public val chimeBearer: kotlin.String? = builder.chimeBearer
    /**
     * The `AppInstanceUserArn` of the member you want to add to the channel.
     */
    public val memberArn: kotlin.String? = builder.memberArn
    /**
     * The ID of the SubChannel in the request.
     *
     * Only required when creating membership in a SubChannel for a moderator in an elastic channel.
     */
    public val subChannelId: kotlin.String? = builder.subChannelId
    /**
     * The membership type of a user, `DEFAULT` or `HIDDEN`. Default members are always returned as part of `ListChannelMemberships`. Hidden members are only returned if the type filter in `ListChannelMemberships` equals `HIDDEN`. Otherwise hidden members are not returned. This is only supported by moderators.
     */
    public val type: aws.sdk.kotlin.services.chimesdkmessaging.model.ChannelMembershipType? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("CreateChannelMembershipRequest(")
        append("channelArn=$channelArn,")
        append("chimeBearer=$chimeBearer,")
        append("memberArn=$memberArn,")
        append("subChannelId=$subChannelId,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = channelArn?.hashCode() ?: 0
        result = 31 * result + (chimeBearer?.hashCode() ?: 0)
        result = 31 * result + (memberArn?.hashCode() ?: 0)
        result = 31 * result + (subChannelId?.hashCode() ?: 0)
        result = 31 * result + (type?.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 CreateChannelMembershipRequest

        if (channelArn != other.channelArn) return false
        if (chimeBearer != other.chimeBearer) return false
        if (memberArn != other.memberArn) return false
        if (subChannelId != other.subChannelId) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * The ARN of the channel to which you're adding users.
         */
        public var channelArn: kotlin.String? = null
        /**
         * The ARN of the `AppInstanceUser` or `AppInstanceBot` that makes the API call.
         */
        public var chimeBearer: kotlin.String? = null
        /**
         * The `AppInstanceUserArn` of the member you want to add to the channel.
         */
        public var memberArn: kotlin.String? = null
        /**
         * The ID of the SubChannel in the request.
         *
         * Only required when creating membership in a SubChannel for a moderator in an elastic channel.
         */
        public var subChannelId: kotlin.String? = null
        /**
         * The membership type of a user, `DEFAULT` or `HIDDEN`. Default members are always returned as part of `ListChannelMemberships`. Hidden members are only returned if the type filter in `ListChannelMemberships` equals `HIDDEN`. Otherwise hidden members are not returned. This is only supported by moderators.
         */
        public var type: aws.sdk.kotlin.services.chimesdkmessaging.model.ChannelMembershipType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.chimesdkmessaging.model.CreateChannelMembershipRequest) : this() {
            this.channelArn = x.channelArn
            this.chimeBearer = x.chimeBearer
            this.memberArn = x.memberArn
            this.subChannelId = x.subChannelId
            this.type = x.type
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy