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

commonMain.aws.sdk.kotlin.services.chimesdkmessaging.model.ChannelMembership.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 member.
 */
public class ChannelMembership private constructor(builder: Builder) {
    /**
     * The ARN of the member's channel.
     */
    public val channelArn: kotlin.String? = builder.channelArn
    /**
     * The time at which the channel membership was created.
     */
    public val createdTimestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.createdTimestamp
    /**
     * The identifier of the member who invited another member.
     */
    public val invitedBy: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = builder.invitedBy
    /**
     * The time at which a channel membership was last updated.
     */
    public val lastUpdatedTimestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.lastUpdatedTimestamp
    /**
     * The data of the channel member.
     */
    public val member: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = builder.member
    /**
     * The ID of the SubChannel that a user belongs to.
     */
    public val subChannelId: kotlin.String? = builder.subChannelId
    /**
     * The membership type set for the channel member.
     */
    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.ChannelMembership = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ChannelMembership(")
        append("channelArn=$channelArn,")
        append("createdTimestamp=$createdTimestamp,")
        append("invitedBy=$invitedBy,")
        append("lastUpdatedTimestamp=$lastUpdatedTimestamp,")
        append("member=$member,")
        append("subChannelId=$subChannelId,")
        append("type=$type")
        append(")")
    }

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

        if (channelArn != other.channelArn) return false
        if (createdTimestamp != other.createdTimestamp) return false
        if (invitedBy != other.invitedBy) return false
        if (lastUpdatedTimestamp != other.lastUpdatedTimestamp) return false
        if (member != other.member) 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.ChannelMembership = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The ARN of the member's channel.
         */
        public var channelArn: kotlin.String? = null
        /**
         * The time at which the channel membership was created.
         */
        public var createdTimestamp: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The identifier of the member who invited another member.
         */
        public var invitedBy: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = null
        /**
         * The time at which a channel membership was last updated.
         */
        public var lastUpdatedTimestamp: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The data of the channel member.
         */
        public var member: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity? = null
        /**
         * The ID of the SubChannel that a user belongs to.
         */
        public var subChannelId: kotlin.String? = null
        /**
         * The membership type set for the channel member.
         */
        public var type: aws.sdk.kotlin.services.chimesdkmessaging.model.ChannelMembershipType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.chimesdkmessaging.model.ChannelMembership) : this() {
            this.channelArn = x.channelArn
            this.createdTimestamp = x.createdTimestamp
            this.invitedBy = x.invitedBy
            this.lastUpdatedTimestamp = x.lastUpdatedTimestamp
            this.member = x.member
            this.subChannelId = x.subChannelId
            this.type = x.type
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.chimesdkmessaging.model.Identity] inside the given [block]
         */
        public fun invitedBy(block: aws.sdk.kotlin.services.chimesdkmessaging.model.Identity.Builder.() -> kotlin.Unit) {
            this.invitedBy = 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