
commonMain.aws.sdk.kotlin.services.ivsrealtime.model.CreateParticipantTokenRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.ivsrealtime.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateParticipantTokenRequest private constructor(builder: Builder) {
/**
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total. *This field is exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive information.*
*/
public val attributes: Map? = builder.attributes
/**
* Set of capabilities that the user is allowed to perform in the stage. Default: `PUBLISH, SUBSCRIBE`.
*/
public val capabilities: List? = builder.capabilities
/**
* Duration (in minutes), after which the token expires. Default: 720 (12 hours).
*/
public val duration: kotlin.Int? = builder.duration
/**
* ARN of the stage to which this token is scoped.
*/
public val stageArn: kotlin.String = requireNotNull(builder.stageArn) { "A non-null value must be provided for stageArn" }
/**
* Name that can be specified to help identify the token. This can be any UTF-8 encoded text. *This field is exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive information.*
*/
public val userId: kotlin.String? = builder.userId
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ivsrealtime.model.CreateParticipantTokenRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateParticipantTokenRequest(")
append("attributes=$attributes,")
append("capabilities=$capabilities,")
append("duration=$duration,")
append("stageArn=$stageArn,")
append("userId=$userId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = attributes?.hashCode() ?: 0
result = 31 * result + (capabilities?.hashCode() ?: 0)
result = 31 * result + (duration ?: 0)
result = 31 * result + (stageArn.hashCode())
result = 31 * result + (userId?.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 CreateParticipantTokenRequest
if (attributes != other.attributes) return false
if (capabilities != other.capabilities) return false
if (duration != other.duration) return false
if (stageArn != other.stageArn) return false
if (userId != other.userId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ivsrealtime.model.CreateParticipantTokenRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total. *This field is exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive information.*
*/
public var attributes: Map? = null
/**
* Set of capabilities that the user is allowed to perform in the stage. Default: `PUBLISH, SUBSCRIBE`.
*/
public var capabilities: List? = null
/**
* Duration (in minutes), after which the token expires. Default: 720 (12 hours).
*/
public var duration: kotlin.Int? = null
/**
* ARN of the stage to which this token is scoped.
*/
public var stageArn: kotlin.String? = null
/**
* Name that can be specified to help identify the token. This can be any UTF-8 encoded text. *This field is exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive information.*
*/
public var userId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.ivsrealtime.model.CreateParticipantTokenRequest) : this() {
this.attributes = x.attributes
this.capabilities = x.capabilities
this.duration = x.duration
this.stageArn = x.stageArn
this.userId = x.userId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.ivsrealtime.model.CreateParticipantTokenRequest = CreateParticipantTokenRequest(this)
internal fun correctErrors(): Builder {
if (stageArn == null) stageArn = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy