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

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

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

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

import aws.smithy.kotlin.runtime.time.Instant

/**
 * The details of a channel ban.
 */
public class ChannelBan private constructor(builder: Builder) {
    /**
     * The ARN of the channel from which a member is being banned.
     */
    public val channelArn: kotlin.String? = builder.channelArn
    /**
     * The `AppInstanceUser` who created the ban.
     */
    public val createdBy: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = builder.createdBy
    /**
     * The time at which the ban was created.
     */
    public val createdTimestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.createdTimestamp
    /**
     * The member being banned from the channel.
     */
    public val member: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = builder.member

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

    override fun toString(): kotlin.String = buildString {
        append("ChannelBan(")
        append("channelArn=$channelArn,")
        append("createdBy=$createdBy,")
        append("createdTimestamp=$createdTimestamp,")
        append("member=$member")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = channelArn?.hashCode() ?: 0
        result = 31 * result + (createdBy?.hashCode() ?: 0)
        result = 31 * result + (createdTimestamp?.hashCode() ?: 0)
        result = 31 * result + (member?.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 ChannelBan

        if (channelArn != other.channelArn) return false
        if (createdBy != other.createdBy) return false
        if (createdTimestamp != other.createdTimestamp) return false
        if (member != other.member) return false

        return true
    }

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

    public class Builder {
        /**
         * The ARN of the channel from which a member is being banned.
         */
        public var channelArn: kotlin.String? = null
        /**
         * The `AppInstanceUser` who created the ban.
         */
        public var createdBy: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = null
        /**
         * The time at which the ban was created.
         */
        public var createdTimestamp: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The member being banned from the channel.
         */
        public var member: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.chimesdkmessaging.model.ChannelBan) : this() {
            this.channelArn = x.channelArn
            this.createdBy = x.createdBy
            this.createdTimestamp = x.createdTimestamp
            this.member = x.member
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy