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

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

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A structure that is used to specify testing a connection to a service.
 */
public class TestConnectionInput private constructor(builder: Builder) {
    /**
     * A structure containing the authentication configuration in the TestConnection request. Required for a connection to Salesforce using OAuth authentication.
     */
    public val authenticationConfiguration: aws.sdk.kotlin.services.glue.model.AuthenticationConfigurationInput? = builder.authenticationConfiguration
    /**
     * The key-value pairs that define parameters for the connection.
     *
     * JDBC connections use the following connection properties:
     * + Required: All of (`HOST`, `PORT`, `JDBC_ENGINE`) or `JDBC_CONNECTION_URL`.
     * + Required: All of (`USERNAME`, `PASSWORD`) or `SECRET_ID`.
     * + Optional: `JDBC_ENFORCE_SSL`, `CUSTOM_JDBC_CERT`, `CUSTOM_JDBC_CERT_STRING`, `SKIP_CUSTOM_JDBC_CERT_VALIDATION`. These parameters are used to configure SSL with JDBC.
     *
     * SALESFORCE connections require the `AuthenticationConfiguration` member to be configured.
     */
    public val connectionProperties: Map = requireNotNull(builder.connectionProperties) { "A non-null value must be provided for connectionProperties" }
    /**
     * The type of connection to test. This operation is only available for the `JDBC` or `SALESFORCE` connection types.
     */
    public val connectionType: aws.sdk.kotlin.services.glue.model.ConnectionType = requireNotNull(builder.connectionType) { "A non-null value must be provided for connectionType" }

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

    override fun toString(): kotlin.String = buildString {
        append("TestConnectionInput(")
        append("authenticationConfiguration=$authenticationConfiguration,")
        append("connectionProperties=$connectionProperties,")
        append("connectionType=$connectionType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = authenticationConfiguration?.hashCode() ?: 0
        result = 31 * result + (connectionProperties.hashCode())
        result = 31 * result + (connectionType.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 TestConnectionInput

        if (authenticationConfiguration != other.authenticationConfiguration) return false
        if (connectionProperties != other.connectionProperties) return false
        if (connectionType != other.connectionType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A structure containing the authentication configuration in the TestConnection request. Required for a connection to Salesforce using OAuth authentication.
         */
        public var authenticationConfiguration: aws.sdk.kotlin.services.glue.model.AuthenticationConfigurationInput? = null
        /**
         * The key-value pairs that define parameters for the connection.
         *
         * JDBC connections use the following connection properties:
         * + Required: All of (`HOST`, `PORT`, `JDBC_ENGINE`) or `JDBC_CONNECTION_URL`.
         * + Required: All of (`USERNAME`, `PASSWORD`) or `SECRET_ID`.
         * + Optional: `JDBC_ENFORCE_SSL`, `CUSTOM_JDBC_CERT`, `CUSTOM_JDBC_CERT_STRING`, `SKIP_CUSTOM_JDBC_CERT_VALIDATION`. These parameters are used to configure SSL with JDBC.
         *
         * SALESFORCE connections require the `AuthenticationConfiguration` member to be configured.
         */
        public var connectionProperties: Map? = null
        /**
         * The type of connection to test. This operation is only available for the `JDBC` or `SALESFORCE` connection types.
         */
        public var connectionType: aws.sdk.kotlin.services.glue.model.ConnectionType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.TestConnectionInput) : this() {
            this.authenticationConfiguration = x.authenticationConfiguration
            this.connectionProperties = x.connectionProperties
            this.connectionType = x.connectionType
        }

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

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

        internal fun correctErrors(): Builder {
            if (connectionProperties == null) connectionProperties = emptyMap()
            if (connectionType == null) connectionType = ConnectionType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy