
commonMain.aws.sdk.kotlin.services.kinesis.model.ConsumerDescription.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
/**
* An object that represents the details of a registered consumer. This type of object is returned by DescribeStreamConsumer.
*/
public class ConsumerDescription private constructor(builder: Builder) {
/**
* When you register a consumer, Kinesis Data Streams generates an ARN for it. You need this ARN to be able to call SubscribeToShard.
*
* If you delete a consumer and then create a new one with the same name, it won't have the same ARN. That's because consumer ARNs contain the creation timestamp. This is important to keep in mind if you have IAM policies that reference consumer ARNs.
*/
public val consumerArn: kotlin.String = requireNotNull(builder.consumerArn) { "A non-null value must be provided for consumerArn" }
/**
*
*/
public val consumerCreationTimestamp: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.consumerCreationTimestamp) { "A non-null value must be provided for consumerCreationTimestamp" }
/**
* The name of the consumer is something you choose when you register the consumer.
*/
public val consumerName: kotlin.String = requireNotNull(builder.consumerName) { "A non-null value must be provided for consumerName" }
/**
* A consumer can't read data while in the `CREATING` or `DELETING` states.
*/
public val consumerStatus: aws.sdk.kotlin.services.kinesis.model.ConsumerStatus = requireNotNull(builder.consumerStatus) { "A non-null value must be provided for consumerStatus" }
/**
* The ARN of the stream with which you registered the consumer.
*/
public val streamArn: kotlin.String = requireNotNull(builder.streamArn) { "A non-null value must be provided for streamArn" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.kinesis.model.ConsumerDescription = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ConsumerDescription(")
append("consumerArn=$consumerArn,")
append("consumerCreationTimestamp=$consumerCreationTimestamp,")
append("consumerName=$consumerName,")
append("consumerStatus=$consumerStatus,")
append("streamArn=$streamArn")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = consumerArn.hashCode()
result = 31 * result + (consumerCreationTimestamp.hashCode())
result = 31 * result + (consumerName.hashCode())
result = 31 * result + (consumerStatus.hashCode())
result = 31 * result + (streamArn.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 ConsumerDescription
if (consumerArn != other.consumerArn) return false
if (consumerCreationTimestamp != other.consumerCreationTimestamp) return false
if (consumerName != other.consumerName) return false
if (consumerStatus != other.consumerStatus) return false
if (streamArn != other.streamArn) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.kinesis.model.ConsumerDescription = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* When you register a consumer, Kinesis Data Streams generates an ARN for it. You need this ARN to be able to call SubscribeToShard.
*
* If you delete a consumer and then create a new one with the same name, it won't have the same ARN. That's because consumer ARNs contain the creation timestamp. This is important to keep in mind if you have IAM policies that reference consumer ARNs.
*/
public var consumerArn: kotlin.String? = null
/**
*
*/
public var consumerCreationTimestamp: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The name of the consumer is something you choose when you register the consumer.
*/
public var consumerName: kotlin.String? = null
/**
* A consumer can't read data while in the `CREATING` or `DELETING` states.
*/
public var consumerStatus: aws.sdk.kotlin.services.kinesis.model.ConsumerStatus? = null
/**
* The ARN of the stream with which you registered the consumer.
*/
public var streamArn: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.kinesis.model.ConsumerDescription) : this() {
this.consumerArn = x.consumerArn
this.consumerCreationTimestamp = x.consumerCreationTimestamp
this.consumerName = x.consumerName
this.consumerStatus = x.consumerStatus
this.streamArn = x.streamArn
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.kinesis.model.ConsumerDescription = ConsumerDescription(this)
internal fun correctErrors(): Builder {
if (consumerArn == null) consumerArn = ""
if (consumerCreationTimestamp == null) consumerCreationTimestamp = Instant.fromEpochSeconds(0)
if (consumerName == null) consumerName = ""
if (consumerStatus == null) consumerStatus = ConsumerStatus.SdkUnknown("no value provided")
if (streamArn == null) streamArn = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy