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

commonMain.aws.sdk.kotlin.services.transfer.model.DescribedConnector.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

/**
 * Describes the parameters for the connector, as identified by the `ConnectorId`.
 */
public class DescribedConnector private constructor(builder: Builder) {
    /**
     * Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.
     *
     * **For AS2 connectors**
     *
     * With AS2, you can send files by calling `StartFileTransfer` and specifying the file paths in the request parameter, `SendFilePaths`. We use the file’s parent directory (for example, for `--send-file-paths /bucket/dir/file.txt`, parent directory is `/bucket/dir/`) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, the `AccessRole` needs to provide read and write access to the parent directory of the file location used in the `StartFileTransfer` request. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send with `StartFileTransfer`.
     *
     * If you are using Basic authentication for your AS2 connector, the access role requires the `secretsmanager:GetSecretValue` permission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs the `kms:Decrypt` permission for that key.
     *
     * **For SFTP connectors**
     *
     * Make sure that the access role provides read and write access to the parent directory of the file location that's used in the `StartFileTransfer` request. Additionally, make sure that the role provides `secretsmanager:GetSecretValue` permission to Secrets Manager.
     */
    public val accessRole: kotlin.String? = builder.accessRole
    /**
     * The unique Amazon Resource Name (ARN) for the connector.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * A structure that contains the parameters for an AS2 connector object.
     */
    public val as2Config: aws.sdk.kotlin.services.transfer.model.As2ConnectorConfig? = builder.as2Config
    /**
     * The unique identifier for the connector.
     */
    public val connectorId: kotlin.String? = builder.connectorId
    /**
     * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that allows a connector to turn on CloudWatch logging for Amazon S3 events. When set, you can view connector activity in your CloudWatch logs.
     */
    public val loggingRole: kotlin.String? = builder.loggingRole
    /**
     * The text name of the security policy for the specified connector.
     */
    public val securityPolicyName: kotlin.String? = builder.securityPolicyName
    /**
     * The list of egress IP addresses of this connector. These IP addresses are assigned automatically when you create the connector.
     */
    public val serviceManagedEgressIpAddresses: List? = builder.serviceManagedEgressIpAddresses
    /**
     * A structure that contains the parameters for an SFTP connector object.
     */
    public val sftpConfig: aws.sdk.kotlin.services.transfer.model.SftpConnectorConfig? = builder.sftpConfig
    /**
     * Key-value pairs that can be used to group and search for connectors.
     */
    public val tags: List? = builder.tags
    /**
     * The URL of the partner's AS2 or SFTP endpoint.
     */
    public val url: kotlin.String? = builder.url

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

    override fun toString(): kotlin.String = buildString {
        append("DescribedConnector(")
        append("accessRole=$accessRole,")
        append("arn=$arn,")
        append("as2Config=$as2Config,")
        append("connectorId=$connectorId,")
        append("loggingRole=$loggingRole,")
        append("securityPolicyName=$securityPolicyName,")
        append("serviceManagedEgressIpAddresses=$serviceManagedEgressIpAddresses,")
        append("sftpConfig=$sftpConfig,")
        append("tags=$tags,")
        append("url=$url")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = accessRole?.hashCode() ?: 0
        result = 31 * result + (arn.hashCode())
        result = 31 * result + (as2Config?.hashCode() ?: 0)
        result = 31 * result + (connectorId?.hashCode() ?: 0)
        result = 31 * result + (loggingRole?.hashCode() ?: 0)
        result = 31 * result + (securityPolicyName?.hashCode() ?: 0)
        result = 31 * result + (serviceManagedEgressIpAddresses?.hashCode() ?: 0)
        result = 31 * result + (sftpConfig?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (url?.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 DescribedConnector

        if (accessRole != other.accessRole) return false
        if (arn != other.arn) return false
        if (as2Config != other.as2Config) return false
        if (connectorId != other.connectorId) return false
        if (loggingRole != other.loggingRole) return false
        if (securityPolicyName != other.securityPolicyName) return false
        if (serviceManagedEgressIpAddresses != other.serviceManagedEgressIpAddresses) return false
        if (sftpConfig != other.sftpConfig) return false
        if (tags != other.tags) return false
        if (url != other.url) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.
         *
         * **For AS2 connectors**
         *
         * With AS2, you can send files by calling `StartFileTransfer` and specifying the file paths in the request parameter, `SendFilePaths`. We use the file’s parent directory (for example, for `--send-file-paths /bucket/dir/file.txt`, parent directory is `/bucket/dir/`) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, the `AccessRole` needs to provide read and write access to the parent directory of the file location used in the `StartFileTransfer` request. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send with `StartFileTransfer`.
         *
         * If you are using Basic authentication for your AS2 connector, the access role requires the `secretsmanager:GetSecretValue` permission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs the `kms:Decrypt` permission for that key.
         *
         * **For SFTP connectors**
         *
         * Make sure that the access role provides read and write access to the parent directory of the file location that's used in the `StartFileTransfer` request. Additionally, make sure that the role provides `secretsmanager:GetSecretValue` permission to Secrets Manager.
         */
        public var accessRole: kotlin.String? = null
        /**
         * The unique Amazon Resource Name (ARN) for the connector.
         */
        public var arn: kotlin.String? = null
        /**
         * A structure that contains the parameters for an AS2 connector object.
         */
        public var as2Config: aws.sdk.kotlin.services.transfer.model.As2ConnectorConfig? = null
        /**
         * The unique identifier for the connector.
         */
        public var connectorId: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that allows a connector to turn on CloudWatch logging for Amazon S3 events. When set, you can view connector activity in your CloudWatch logs.
         */
        public var loggingRole: kotlin.String? = null
        /**
         * The text name of the security policy for the specified connector.
         */
        public var securityPolicyName: kotlin.String? = null
        /**
         * The list of egress IP addresses of this connector. These IP addresses are assigned automatically when you create the connector.
         */
        public var serviceManagedEgressIpAddresses: List? = null
        /**
         * A structure that contains the parameters for an SFTP connector object.
         */
        public var sftpConfig: aws.sdk.kotlin.services.transfer.model.SftpConnectorConfig? = null
        /**
         * Key-value pairs that can be used to group and search for connectors.
         */
        public var tags: List? = null
        /**
         * The URL of the partner's AS2 or SFTP endpoint.
         */
        public var url: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.transfer.model.DescribedConnector) : this() {
            this.accessRole = x.accessRole
            this.arn = x.arn
            this.as2Config = x.as2Config
            this.connectorId = x.connectorId
            this.loggingRole = x.loggingRole
            this.securityPolicyName = x.securityPolicyName
            this.serviceManagedEgressIpAddresses = x.serviceManagedEgressIpAddresses
            this.sftpConfig = x.sftpConfig
            this.tags = x.tags
            this.url = x.url
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy