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

commonMain.aws.sdk.kotlin.services.ivs.model.StreamSessionSummary.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ivs.model

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

/**
 * Summary information about a stream session.
 */
public class StreamSessionSummary private constructor(builder: Builder) {
    /**
     * Time when the channel went offline. This is an ISO 8601 timestamp; *note that this is returned as a string*. For live streams, this is `NULL`.
     */
    public val endTime: aws.smithy.kotlin.runtime.time.Instant? = builder.endTime
    /**
     * If `true`, this stream encountered a quota breach or failure.
     */
    public val hasErrorEvent: kotlin.Boolean = builder.hasErrorEvent
    /**
     * Time when the channel went live. This is an ISO 8601 timestamp; *note that this is returned as a string*.
     */
    public val startTime: aws.smithy.kotlin.runtime.time.Instant? = builder.startTime
    /**
     * Unique identifier for a live or previously live stream in the specified channel.
     */
    public val streamId: kotlin.String? = builder.streamId

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

    override fun toString(): kotlin.String = buildString {
        append("StreamSessionSummary(")
        append("endTime=$endTime,")
        append("hasErrorEvent=$hasErrorEvent,")
        append("startTime=$startTime,")
        append("streamId=$streamId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = endTime?.hashCode() ?: 0
        result = 31 * result + (hasErrorEvent.hashCode())
        result = 31 * result + (startTime?.hashCode() ?: 0)
        result = 31 * result + (streamId?.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 StreamSessionSummary

        if (endTime != other.endTime) return false
        if (hasErrorEvent != other.hasErrorEvent) return false
        if (startTime != other.startTime) return false
        if (streamId != other.streamId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Time when the channel went offline. This is an ISO 8601 timestamp; *note that this is returned as a string*. For live streams, this is `NULL`.
         */
        public var endTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * If `true`, this stream encountered a quota breach or failure.
         */
        public var hasErrorEvent: kotlin.Boolean = false
        /**
         * Time when the channel went live. This is an ISO 8601 timestamp; *note that this is returned as a string*.
         */
        public var startTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Unique identifier for a live or previously live stream in the specified channel.
         */
        public var streamId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ivs.model.StreamSessionSummary) : this() {
            this.endTime = x.endTime
            this.hasErrorEvent = x.hasErrorEvent
            this.startTime = x.startTime
            this.streamId = x.streamId
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy