commonMain.aws.sdk.kotlin.services.ivschat.model.SendEventRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ivschat-jvm Show documentation
Show all versions of ivschat-jvm Show documentation
The AWS SDK for Kotlin client for ivschat
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.ivschat.model
import aws.smithy.kotlin.runtime.SdkDsl
public class SendEventRequest private constructor(builder: Builder) {
/**
* Application-defined metadata to attach to the event sent to clients. The maximum length of the metadata is 1 KB total.
*/
public val attributes: Map? = builder.attributes
/**
* Application-defined name of the event to send to clients.
*/
public val eventName: kotlin.String = requireNotNull(builder.eventName) { "A non-null value must be provided for eventName" }
/**
* Identifier of the room to which the event will be sent. Currently this must be an ARN.
*/
public val roomIdentifier: kotlin.String = requireNotNull(builder.roomIdentifier) { "A non-null value must be provided for roomIdentifier" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ivschat.model.SendEventRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SendEventRequest(")
append("attributes=$attributes,")
append("eventName=$eventName,")
append("roomIdentifier=$roomIdentifier")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = attributes?.hashCode() ?: 0
result = 31 * result + (eventName.hashCode())
result = 31 * result + (roomIdentifier.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 SendEventRequest
if (attributes != other.attributes) return false
if (eventName != other.eventName) return false
if (roomIdentifier != other.roomIdentifier) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ivschat.model.SendEventRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Application-defined metadata to attach to the event sent to clients. The maximum length of the metadata is 1 KB total.
*/
public var attributes: Map? = null
/**
* Application-defined name of the event to send to clients.
*/
public var eventName: kotlin.String? = null
/**
* Identifier of the room to which the event will be sent. Currently this must be an ARN.
*/
public var roomIdentifier: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.ivschat.model.SendEventRequest) : this() {
this.attributes = x.attributes
this.eventName = x.eventName
this.roomIdentifier = x.roomIdentifier
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.ivschat.model.SendEventRequest = SendEventRequest(this)
internal fun correctErrors(): Builder {
if (eventName == null) eventName = ""
if (roomIdentifier == null) roomIdentifier = ""
return this
}
}
}