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

commonMain.aws.sdk.kotlin.services.firehose.model.EncryptionConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.firehose.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Describes the encryption for a destination in Amazon S3.
 */
public class EncryptionConfiguration private constructor(builder: Builder) {
    /**
     * The encryption key.
     */
    public val kmsEncryptionConfig: aws.sdk.kotlin.services.firehose.model.KmsEncryptionConfig? = builder.kmsEncryptionConfig
    /**
     * Specifically override existing encryption information to ensure that no encryption is used.
     */
    public val noEncryptionConfig: aws.sdk.kotlin.services.firehose.model.NoEncryptionConfig? = builder.noEncryptionConfig

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

    override fun toString(): kotlin.String = buildString {
        append("EncryptionConfiguration(")
        append("kmsEncryptionConfig=$kmsEncryptionConfig,")
        append("noEncryptionConfig=$noEncryptionConfig")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = kmsEncryptionConfig?.hashCode() ?: 0
        result = 31 * result + (noEncryptionConfig?.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 EncryptionConfiguration

        if (kmsEncryptionConfig != other.kmsEncryptionConfig) return false
        if (noEncryptionConfig != other.noEncryptionConfig) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The encryption key.
         */
        public var kmsEncryptionConfig: aws.sdk.kotlin.services.firehose.model.KmsEncryptionConfig? = null
        /**
         * Specifically override existing encryption information to ensure that no encryption is used.
         */
        public var noEncryptionConfig: aws.sdk.kotlin.services.firehose.model.NoEncryptionConfig? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.firehose.model.EncryptionConfiguration) : this() {
            this.kmsEncryptionConfig = x.kmsEncryptionConfig
            this.noEncryptionConfig = x.noEncryptionConfig
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy