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

commonMain.aws.sdk.kotlin.services.dsql.model.GetClusterResponse.kt Maven / Gradle / Ivy

There is a newer version: 1.3.100
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.dsql.model

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

/**
 * Output Mixin
 */
public class GetClusterResponse private constructor(builder: Builder) {
    /**
     * The ARN of the retrieved cluster.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * The time of when the cluster was created.
     */
    public val creationTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.creationTime) { "A non-null value must be provided for creationTime" }
    /**
     * Whether deletion protection is enabled in this cluster.
     */
    public val deletionProtectionEnabled: kotlin.Boolean = requireNotNull(builder.deletionProtectionEnabled) { "A non-null value must be provided for deletionProtectionEnabled" }
    /**
     * The ID of the retrieved cluster.
     */
    public val identifier: kotlin.String = requireNotNull(builder.identifier) { "A non-null value must be provided for identifier" }
    /**
     * The ARNs of the clusters linked to the retrieved cluster.
     */
    public val linkedClusterArns: List? = builder.linkedClusterArns
    /**
     * The status of the retrieved cluster.
     */
    public val status: aws.sdk.kotlin.services.dsql.model.ClusterStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
    /**
     * The witness Region of the cluster. Applicable only for multi-Region clusters.
     */
    public val witnessRegion: kotlin.String? = builder.witnessRegion

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

    override fun toString(): kotlin.String = buildString {
        append("GetClusterResponse(")
        append("arn=$arn,")
        append("creationTime=$creationTime,")
        append("deletionProtectionEnabled=$deletionProtectionEnabled,")
        append("identifier=$identifier,")
        append("linkedClusterArns=$linkedClusterArns,")
        append("status=$status,")
        append("witnessRegion=$witnessRegion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = arn.hashCode()
        result = 31 * result + (creationTime.hashCode())
        result = 31 * result + (deletionProtectionEnabled.hashCode())
        result = 31 * result + (identifier.hashCode())
        result = 31 * result + (linkedClusterArns?.hashCode() ?: 0)
        result = 31 * result + (status.hashCode())
        result = 31 * result + (witnessRegion?.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 GetClusterResponse

        if (arn != other.arn) return false
        if (creationTime != other.creationTime) return false
        if (deletionProtectionEnabled != other.deletionProtectionEnabled) return false
        if (identifier != other.identifier) return false
        if (linkedClusterArns != other.linkedClusterArns) return false
        if (status != other.status) return false
        if (witnessRegion != other.witnessRegion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ARN of the retrieved cluster.
         */
        public var arn: kotlin.String? = null
        /**
         * The time of when the cluster was created.
         */
        public var creationTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Whether deletion protection is enabled in this cluster.
         */
        public var deletionProtectionEnabled: kotlin.Boolean? = null
        /**
         * The ID of the retrieved cluster.
         */
        public var identifier: kotlin.String? = null
        /**
         * The ARNs of the clusters linked to the retrieved cluster.
         */
        public var linkedClusterArns: List? = null
        /**
         * The status of the retrieved cluster.
         */
        public var status: aws.sdk.kotlin.services.dsql.model.ClusterStatus? = null
        /**
         * The witness Region of the cluster. Applicable only for multi-Region clusters.
         */
        public var witnessRegion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dsql.model.GetClusterResponse) : this() {
            this.arn = x.arn
            this.creationTime = x.creationTime
            this.deletionProtectionEnabled = x.deletionProtectionEnabled
            this.identifier = x.identifier
            this.linkedClusterArns = x.linkedClusterArns
            this.status = x.status
            this.witnessRegion = x.witnessRegion
        }

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            if (creationTime == null) creationTime = Instant.fromEpochSeconds(0)
            if (deletionProtectionEnabled == null) deletionProtectionEnabled = false
            if (identifier == null) identifier = ""
            if (status == null) status = ClusterStatus.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy