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

commonMain.aws.sdk.kotlin.services.kinesis.model.StreamDescription.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kinesis.model

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

/**
 * Represents the output for DescribeStream.
 */
public class StreamDescription private constructor(builder: Builder) {
    /**
     * The server-side encryption type used on the stream. This parameter can be one of the following values:
     * + `NONE`: Do not encrypt the records in the stream.
     * + `KMS`: Use server-side encryption on the records in the stream using a customer-managed Amazon Web Services KMS key.
     */
    public val encryptionType: aws.sdk.kotlin.services.kinesis.model.EncryptionType? = builder.encryptionType
    /**
     * Represents the current enhanced monitoring settings of the stream.
     */
    public val enhancedMonitoring: List = requireNotNull(builder.enhancedMonitoring) { "A non-null value must be provided for enhancedMonitoring" }
    /**
     * If set to `true`, more shards in the stream are available to describe.
     */
    public val hasMoreShards: kotlin.Boolean = requireNotNull(builder.hasMoreShards) { "A non-null value must be provided for hasMoreShards" }
    /**
     * The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified ARN to either an alias or a key, or an alias name prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams by specifying the alias `aws/kinesis`.
     * + Key ARN example: `arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012`
     * + Alias ARN example: `arn:aws:kms:us-east-1:123456789012:alias/MyAliasName`
     * + Globally unique key ID example: `12345678-1234-1234-1234-123456789012`
     * + Alias name example: `alias/MyAliasName`
     * + Master key owned by Kinesis Data Streams: `alias/aws/kinesis`
     */
    public val keyId: kotlin.String? = builder.keyId
    /**
     * The current retention period, in hours. Minimum value of 24. Maximum value of 168.
     */
    public val retentionPeriodHours: kotlin.Int = requireNotNull(builder.retentionPeriodHours) { "A non-null value must be provided for retentionPeriodHours" }
    /**
     * The shards that comprise the stream.
     */
    public val shards: List = requireNotNull(builder.shards) { "A non-null value must be provided for shards" }
    /**
     * The Amazon Resource Name (ARN) for the stream being described.
     */
    public val streamArn: kotlin.String = requireNotNull(builder.streamArn) { "A non-null value must be provided for streamArn" }
    /**
     * The approximate time that the stream was created.
     */
    public val streamCreationTimestamp: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.streamCreationTimestamp) { "A non-null value must be provided for streamCreationTimestamp" }
    /**
     * Specifies the capacity mode to which you want to set your data stream. Currently, in Kinesis Data Streams, you can choose between an **on-demand** capacity mode and a **provisioned** capacity mode for your data streams.
     */
    public val streamModeDetails: aws.sdk.kotlin.services.kinesis.model.StreamModeDetails? = builder.streamModeDetails
    /**
     * The name of the stream being described.
     */
    public val streamName: kotlin.String = requireNotNull(builder.streamName) { "A non-null value must be provided for streamName" }
    /**
     * The current status of the stream being described. The stream status is one of the following states:
     * + `CREATING` - The stream is being created. Kinesis Data Streams immediately returns and sets `StreamStatus` to `CREATING`.
     * + `DELETING` - The stream is being deleted. The specified stream is in the `DELETING` state until Kinesis Data Streams completes the deletion.
     * + `ACTIVE` - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an `ACTIVE` stream.
     * + `UPDATING` - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the `UPDATING` state.
     */
    public val streamStatus: aws.sdk.kotlin.services.kinesis.model.StreamStatus = requireNotNull(builder.streamStatus) { "A non-null value must be provided for streamStatus" }

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

    override fun toString(): kotlin.String = buildString {
        append("StreamDescription(")
        append("encryptionType=$encryptionType,")
        append("enhancedMonitoring=$enhancedMonitoring,")
        append("hasMoreShards=$hasMoreShards,")
        append("keyId=$keyId,")
        append("retentionPeriodHours=$retentionPeriodHours,")
        append("shards=$shards,")
        append("streamArn=$streamArn,")
        append("streamCreationTimestamp=$streamCreationTimestamp,")
        append("streamModeDetails=$streamModeDetails,")
        append("streamName=$streamName,")
        append("streamStatus=$streamStatus")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = encryptionType?.hashCode() ?: 0
        result = 31 * result + (enhancedMonitoring.hashCode())
        result = 31 * result + (hasMoreShards.hashCode())
        result = 31 * result + (keyId?.hashCode() ?: 0)
        result = 31 * result + (retentionPeriodHours)
        result = 31 * result + (shards.hashCode())
        result = 31 * result + (streamArn.hashCode())
        result = 31 * result + (streamCreationTimestamp.hashCode())
        result = 31 * result + (streamModeDetails?.hashCode() ?: 0)
        result = 31 * result + (streamName.hashCode())
        result = 31 * result + (streamStatus.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 StreamDescription

        if (encryptionType != other.encryptionType) return false
        if (enhancedMonitoring != other.enhancedMonitoring) return false
        if (hasMoreShards != other.hasMoreShards) return false
        if (keyId != other.keyId) return false
        if (retentionPeriodHours != other.retentionPeriodHours) return false
        if (shards != other.shards) return false
        if (streamArn != other.streamArn) return false
        if (streamCreationTimestamp != other.streamCreationTimestamp) return false
        if (streamModeDetails != other.streamModeDetails) return false
        if (streamName != other.streamName) return false
        if (streamStatus != other.streamStatus) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The server-side encryption type used on the stream. This parameter can be one of the following values:
         * + `NONE`: Do not encrypt the records in the stream.
         * + `KMS`: Use server-side encryption on the records in the stream using a customer-managed Amazon Web Services KMS key.
         */
        public var encryptionType: aws.sdk.kotlin.services.kinesis.model.EncryptionType? = null
        /**
         * Represents the current enhanced monitoring settings of the stream.
         */
        public var enhancedMonitoring: List? = null
        /**
         * If set to `true`, more shards in the stream are available to describe.
         */
        public var hasMoreShards: kotlin.Boolean? = null
        /**
         * The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified ARN to either an alias or a key, or an alias name prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams by specifying the alias `aws/kinesis`.
         * + Key ARN example: `arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012`
         * + Alias ARN example: `arn:aws:kms:us-east-1:123456789012:alias/MyAliasName`
         * + Globally unique key ID example: `12345678-1234-1234-1234-123456789012`
         * + Alias name example: `alias/MyAliasName`
         * + Master key owned by Kinesis Data Streams: `alias/aws/kinesis`
         */
        public var keyId: kotlin.String? = null
        /**
         * The current retention period, in hours. Minimum value of 24. Maximum value of 168.
         */
        public var retentionPeriodHours: kotlin.Int? = null
        /**
         * The shards that comprise the stream.
         */
        public var shards: List? = null
        /**
         * The Amazon Resource Name (ARN) for the stream being described.
         */
        public var streamArn: kotlin.String? = null
        /**
         * The approximate time that the stream was created.
         */
        public var streamCreationTimestamp: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Specifies the capacity mode to which you want to set your data stream. Currently, in Kinesis Data Streams, you can choose between an **on-demand** capacity mode and a **provisioned** capacity mode for your data streams.
         */
        public var streamModeDetails: aws.sdk.kotlin.services.kinesis.model.StreamModeDetails? = null
        /**
         * The name of the stream being described.
         */
        public var streamName: kotlin.String? = null
        /**
         * The current status of the stream being described. The stream status is one of the following states:
         * + `CREATING` - The stream is being created. Kinesis Data Streams immediately returns and sets `StreamStatus` to `CREATING`.
         * + `DELETING` - The stream is being deleted. The specified stream is in the `DELETING` state until Kinesis Data Streams completes the deletion.
         * + `ACTIVE` - The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an `ACTIVE` stream.
         * + `UPDATING` - Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the `UPDATING` state.
         */
        public var streamStatus: aws.sdk.kotlin.services.kinesis.model.StreamStatus? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kinesis.model.StreamDescription) : this() {
            this.encryptionType = x.encryptionType
            this.enhancedMonitoring = x.enhancedMonitoring
            this.hasMoreShards = x.hasMoreShards
            this.keyId = x.keyId
            this.retentionPeriodHours = x.retentionPeriodHours
            this.shards = x.shards
            this.streamArn = x.streamArn
            this.streamCreationTimestamp = x.streamCreationTimestamp
            this.streamModeDetails = x.streamModeDetails
            this.streamName = x.streamName
            this.streamStatus = x.streamStatus
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.kinesis.model.StreamModeDetails] inside the given [block]
         */
        public fun streamModeDetails(block: aws.sdk.kotlin.services.kinesis.model.StreamModeDetails.Builder.() -> kotlin.Unit) {
            this.streamModeDetails = aws.sdk.kotlin.services.kinesis.model.StreamModeDetails.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (enhancedMonitoring == null) enhancedMonitoring = emptyList()
            if (hasMoreShards == null) hasMoreShards = false
            if (retentionPeriodHours == null) retentionPeriodHours = 0
            if (shards == null) shards = emptyList()
            if (streamArn == null) streamArn = ""
            if (streamCreationTimestamp == null) streamCreationTimestamp = Instant.fromEpochSeconds(0)
            if (streamName == null) streamName = ""
            if (streamStatus == null) streamStatus = StreamStatus.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy