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

commonMain.aws.sdk.kotlin.services.transfer.model.SftpConnectorConfig.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.transfer.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains the details for an SFTP connector object. The connector object is used for transferring files to and from a partner's SFTP server.
 *
 * Because the `SftpConnectorConfig` data type is used for both creating and updating SFTP connectors, its parameters, `TrustedHostKeys` and `UserSecretId` are marked as not required. This is a bit misleading, as they are not required when you are updating an existing SFTP connector, but *are required* when you are creating a new SFTP connector.
 */
public class SftpConnectorConfig private constructor(builder: Builder) {
    /**
     * The public portion of the host key, or keys, that are used to identify the external server to which you are connecting. You can use the `ssh-keyscan` command against the SFTP server to retrieve the necessary key.
     *
     * The three standard SSH public key format elements are `<key type>`, `<body base64>`, and an optional `<comment>`, with spaces between each element. Specify only the `<key type>` and `<body base64>`: do not enter the `<comment>` portion of the key.
     *
     * For the trusted host key, Transfer Family accepts RSA and ECDSA keys.
     * + For RSA keys, the `<key type>` string is `ssh-rsa`.
     * + For ECDSA keys, the `<key type>` string is either `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, or `ecdsa-sha2-nistp521`, depending on the size of the key you generated.
     *
     * Run this command to retrieve the SFTP server host key, where your SFTP server name is `ftp.host.com`.
     *
     * `ssh-keyscan ftp.host.com`
     *
     * This prints the public host key to standard output.
     *
     * `ftp.host.com ssh-rsa AAAAB3Nza...<long-string-for-public-key`
     *
     * Copy and paste this string into the `TrustedHostKeys` field for the `create-connector` command or into the **Trusted host keys** field in the console.
     */
    public val trustedHostKeys: List? = builder.trustedHostKeys
    /**
     * The identifier for the secret (in Amazon Web Services Secrets Manager) that contains the SFTP user's private key, password, or both. The identifier must be the Amazon Resource Name (ARN) of the secret.
     */
    public val userSecretId: kotlin.String? = builder.userSecretId

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

    override fun toString(): kotlin.String = buildString {
        append("SftpConnectorConfig(")
        append("trustedHostKeys=$trustedHostKeys,")
        append("userSecretId=$userSecretId")
        append(")")
    }

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

        if (trustedHostKeys != other.trustedHostKeys) return false
        if (userSecretId != other.userSecretId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The public portion of the host key, or keys, that are used to identify the external server to which you are connecting. You can use the `ssh-keyscan` command against the SFTP server to retrieve the necessary key.
         *
         * The three standard SSH public key format elements are `<key type>`, `<body base64>`, and an optional `<comment>`, with spaces between each element. Specify only the `<key type>` and `<body base64>`: do not enter the `<comment>` portion of the key.
         *
         * For the trusted host key, Transfer Family accepts RSA and ECDSA keys.
         * + For RSA keys, the `<key type>` string is `ssh-rsa`.
         * + For ECDSA keys, the `<key type>` string is either `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, or `ecdsa-sha2-nistp521`, depending on the size of the key you generated.
         *
         * Run this command to retrieve the SFTP server host key, where your SFTP server name is `ftp.host.com`.
         *
         * `ssh-keyscan ftp.host.com`
         *
         * This prints the public host key to standard output.
         *
         * `ftp.host.com ssh-rsa AAAAB3Nza...<long-string-for-public-key`
         *
         * Copy and paste this string into the `TrustedHostKeys` field for the `create-connector` command or into the **Trusted host keys** field in the console.
         */
        public var trustedHostKeys: List? = null
        /**
         * The identifier for the secret (in Amazon Web Services Secrets Manager) that contains the SFTP user's private key, password, or both. The identifier must be the Amazon Resource Name (ARN) of the secret.
         */
        public var userSecretId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.transfer.model.SftpConnectorConfig) : this() {
            this.trustedHostKeys = x.trustedHostKeys
            this.userSecretId = x.userSecretId
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy