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

commonMain.aws.sdk.kotlin.services.transcribestreaming.model.ChannelDefinition.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.transcribestreaming.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Makes it possible to specify which speaker is on which audio channel. For example, if your agent is the first participant to speak, you would set `ChannelId` to `0` (to indicate the first channel) and `ParticipantRole` to `AGENT` (to indicate that it's the agent speaking).
 */
public class ChannelDefinition private constructor(builder: Builder) {
    /**
     * Specify the audio channel you want to define.
     */
    public val channelId: kotlin.Int = builder.channelId
    /**
     * Specify the speaker you want to define. Omitting this parameter is equivalent to specifying both participants.
     */
    public val participantRole: aws.sdk.kotlin.services.transcribestreaming.model.ParticipantRole = requireNotNull(builder.participantRole) { "A non-null value must be provided for participantRole" }

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

    override fun toString(): kotlin.String = buildString {
        append("ChannelDefinition(")
        append("channelId=$channelId,")
        append("participantRole=$participantRole")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = channelId
        result = 31 * result + (participantRole.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 ChannelDefinition

        if (channelId != other.channelId) return false
        if (participantRole != other.participantRole) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specify the audio channel you want to define.
         */
        public var channelId: kotlin.Int = 0
        /**
         * Specify the speaker you want to define. Omitting this parameter is equivalent to specifying both participants.
         */
        public var participantRole: aws.sdk.kotlin.services.transcribestreaming.model.ParticipantRole? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.transcribestreaming.model.ChannelDefinition) : this() {
            this.channelId = x.channelId
            this.participantRole = x.participantRole
        }

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

        internal fun correctErrors(): Builder {
            if (participantRole == null) participantRole = ParticipantRole.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy