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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.PutDefaultEncryptionConfigurationResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotsitewise.model

import aws.smithy.kotlin.runtime.SdkDsl

public class PutDefaultEncryptionConfigurationResponse private constructor(builder: Builder) {
    /**
     * The status of the account configuration. This contains the `ConfigurationState`. If there is an error, it also contains the `ErrorDetails`.
     */
    public val configurationStatus: aws.sdk.kotlin.services.iotsitewise.model.ConfigurationStatus? = builder.configurationStatus
    /**
     * The type of encryption used for the encryption configuration.
     */
    public val encryptionType: aws.sdk.kotlin.services.iotsitewise.model.EncryptionType = requireNotNull(builder.encryptionType) { "A non-null value must be provided for encryptionType" }
    /**
     * The Key ARN of the KMS key used for KMS encryption if you use `KMS_BASED_ENCRYPTION`.
     */
    public val kmsKeyArn: kotlin.String? = builder.kmsKeyArn

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

    override fun toString(): kotlin.String = buildString {
        append("PutDefaultEncryptionConfigurationResponse(")
        append("configurationStatus=$configurationStatus,")
        append("encryptionType=$encryptionType,")
        append("kmsKeyArn=$kmsKeyArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = configurationStatus?.hashCode() ?: 0
        result = 31 * result + (encryptionType.hashCode())
        result = 31 * result + (kmsKeyArn?.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 PutDefaultEncryptionConfigurationResponse

        if (configurationStatus != other.configurationStatus) return false
        if (encryptionType != other.encryptionType) return false
        if (kmsKeyArn != other.kmsKeyArn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The status of the account configuration. This contains the `ConfigurationState`. If there is an error, it also contains the `ErrorDetails`.
         */
        public var configurationStatus: aws.sdk.kotlin.services.iotsitewise.model.ConfigurationStatus? = null
        /**
         * The type of encryption used for the encryption configuration.
         */
        public var encryptionType: aws.sdk.kotlin.services.iotsitewise.model.EncryptionType? = null
        /**
         * The Key ARN of the KMS key used for KMS encryption if you use `KMS_BASED_ENCRYPTION`.
         */
        public var kmsKeyArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.PutDefaultEncryptionConfigurationResponse) : this() {
            this.configurationStatus = x.configurationStatus
            this.encryptionType = x.encryptionType
            this.kmsKeyArn = x.kmsKeyArn
        }

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

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

        internal fun correctErrors(): Builder {
            if (encryptionType == null) encryptionType = EncryptionType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy