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

commonMain.aws.sdk.kotlin.services.glue.model.ConnectionPasswordEncryption.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The data structure used by the Data Catalog to encrypt the password as part of `CreateConnection` or `UpdateConnection` and store it in the `ENCRYPTED_PASSWORD` field in the connection properties. You can enable catalog encryption or only password encryption.
 *
 * When a `CreationConnection` request arrives containing a password, the Data Catalog first encrypts the password using your KMS key. It then encrypts the whole connection object again if catalog encryption is also enabled.
 *
 * This encryption requires that you set KMS key permissions to enable or restrict access on the password key according to your security requirements. For example, you might want only administrators to have decrypt permission on the password key.
 */
public class ConnectionPasswordEncryption private constructor(builder: Builder) {
    /**
     * An KMS key that is used to encrypt the connection password.
     *
     * If connection password protection is enabled, the caller of `CreateConnection` and `UpdateConnection` needs at least `kms:Encrypt` permission on the specified KMS key, to encrypt passwords before storing them in the Data Catalog.
     *
     * You can set the decrypt permission to enable or restrict access on the password key according to your security requirements.
     */
    public val awsKmsKeyId: kotlin.String? = builder.awsKmsKeyId
    /**
     * When the `ReturnConnectionPasswordEncrypted` flag is set to "true", passwords remain encrypted in the responses of `GetConnection` and `GetConnections`. This encryption takes effect independently from catalog encryption.
     */
    public val returnConnectionPasswordEncrypted: kotlin.Boolean = builder.returnConnectionPasswordEncrypted

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

    override fun toString(): kotlin.String = buildString {
        append("ConnectionPasswordEncryption(")
        append("awsKmsKeyId=$awsKmsKeyId,")
        append("returnConnectionPasswordEncrypted=$returnConnectionPasswordEncrypted")
        append(")")
    }

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

        if (awsKmsKeyId != other.awsKmsKeyId) return false
        if (returnConnectionPasswordEncrypted != other.returnConnectionPasswordEncrypted) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An KMS key that is used to encrypt the connection password.
         *
         * If connection password protection is enabled, the caller of `CreateConnection` and `UpdateConnection` needs at least `kms:Encrypt` permission on the specified KMS key, to encrypt passwords before storing them in the Data Catalog.
         *
         * You can set the decrypt permission to enable or restrict access on the password key according to your security requirements.
         */
        public var awsKmsKeyId: kotlin.String? = null
        /**
         * When the `ReturnConnectionPasswordEncrypted` flag is set to "true", passwords remain encrypted in the responses of `GetConnection` and `GetConnections`. This encryption takes effect independently from catalog encryption.
         */
        public var returnConnectionPasswordEncrypted: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.ConnectionPasswordEncryption) : this() {
            this.awsKmsKeyId = x.awsKmsKeyId
            this.returnConnectionPasswordEncrypted = x.returnConnectionPasswordEncrypted
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy