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

commonMain.aws.sdk.kotlin.services.firehose.model.ElasticsearchDestinationConfiguration.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 configuration of a destination in Amazon ES.
 */
public class ElasticsearchDestinationConfiguration private constructor(builder: Builder) {
    /**
     * The buffering options. If no value is specified, the default values for `ElasticsearchBufferingHints` are used.
     */
    public val bufferingHints: aws.sdk.kotlin.services.firehose.model.ElasticsearchBufferingHints? = builder.bufferingHints
    /**
     * The Amazon CloudWatch logging options for your delivery stream.
     */
    public val cloudWatchLoggingOptions: aws.sdk.kotlin.services.firehose.model.CloudWatchLoggingOptions? = builder.cloudWatchLoggingOptions
    /**
     * The endpoint to use when communicating with the cluster. Specify either this `ClusterEndpoint` or the `DomainARN` field.
     */
    public val clusterEndpoint: kotlin.String? = builder.clusterEndpoint
    /**
     * Indicates the method for setting up document ID. The supported methods are Firehose generated document ID and OpenSearch Service generated document ID.
     */
    public val documentIdOptions: aws.sdk.kotlin.services.firehose.model.DocumentIdOptions? = builder.documentIdOptions
    /**
     * The ARN of the Amazon ES domain. The IAM role must have permissions for `DescribeDomain`, `DescribeDomains`, and `DescribeDomainConfig` after assuming the role specified in **RoleARN**. For more information, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
     *
     * Specify either `ClusterEndpoint` or `DomainARN`.
     */
    public val domainArn: kotlin.String? = builder.domainArn
    /**
     * The Elasticsearch index name.
     */
    public val indexName: kotlin.String = requireNotNull(builder.indexName) { "A non-null value must be provided for indexName" }
    /**
     * The Elasticsearch index rotation period. Index rotation appends a timestamp to the `IndexName` to facilitate the expiration of old data. For more information, see [Index Rotation for the Amazon ES Destination](https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). The default value is `OneDay`.
     */
    public val indexRotationPeriod: aws.sdk.kotlin.services.firehose.model.ElasticsearchIndexRotationPeriod? = builder.indexRotationPeriod
    /**
     * The data processing configuration.
     */
    public val processingConfiguration: aws.sdk.kotlin.services.firehose.model.ProcessingConfiguration? = builder.processingConfiguration
    /**
     * The retry behavior in case Firehose is unable to deliver documents to Amazon ES. The default value is 300 (5 minutes).
     */
    public val retryOptions: aws.sdk.kotlin.services.firehose.model.ElasticsearchRetryOptions? = builder.retryOptions
    /**
     * The Amazon Resource Name (ARN) of the IAM role to be assumed by Firehose for calling the Amazon ES Configuration API and for indexing documents. For more information, see [Grant Firehose Access to an Amazon S3 Destination](https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) and [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }
    /**
     * Defines how documents should be delivered to Amazon S3. When it is set to `FailedDocumentsOnly`, Firehose writes any documents that could not be indexed to the configured Amazon S3 destination, with `AmazonOpenSearchService-failed/` appended to the key prefix. When set to `AllDocuments`, Firehose delivers all incoming records to Amazon S3, and also writes failed documents with `AmazonOpenSearchService-failed/` appended to the prefix. For more information, see [Amazon S3 Backup for the Amazon ES Destination](https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-s3-backup). Default value is `FailedDocumentsOnly`.
     *
     * You can't change this backup mode after you create the delivery stream.
     */
    public val s3BackupMode: aws.sdk.kotlin.services.firehose.model.ElasticsearchS3BackupMode? = builder.s3BackupMode
    /**
     * The configuration for the backup Amazon S3 location.
     */
    public val s3Configuration: aws.sdk.kotlin.services.firehose.model.S3DestinationConfiguration? = builder.s3Configuration
    /**
     * The Elasticsearch type name. For Elasticsearch 6.x, there can be only one type per index. If you try to specify a new type for an existing index that already has another type, Firehose returns an error during run time.
     *
     * For Elasticsearch 7.x, don't specify a `TypeName`.
     */
    public val typeName: kotlin.String? = builder.typeName
    /**
     * The details of the VPC of the Amazon destination.
     */
    public val vpcConfiguration: aws.sdk.kotlin.services.firehose.model.VpcConfiguration? = builder.vpcConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("ElasticsearchDestinationConfiguration(")
        append("bufferingHints=$bufferingHints,")
        append("cloudWatchLoggingOptions=$cloudWatchLoggingOptions,")
        append("clusterEndpoint=$clusterEndpoint,")
        append("documentIdOptions=$documentIdOptions,")
        append("domainArn=$domainArn,")
        append("indexName=$indexName,")
        append("indexRotationPeriod=$indexRotationPeriod,")
        append("processingConfiguration=$processingConfiguration,")
        append("retryOptions=$retryOptions,")
        append("roleArn=$roleArn,")
        append("s3BackupMode=$s3BackupMode,")
        append("s3Configuration=$s3Configuration,")
        append("typeName=$typeName,")
        append("vpcConfiguration=$vpcConfiguration")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = bufferingHints?.hashCode() ?: 0
        result = 31 * result + (cloudWatchLoggingOptions?.hashCode() ?: 0)
        result = 31 * result + (clusterEndpoint?.hashCode() ?: 0)
        result = 31 * result + (documentIdOptions?.hashCode() ?: 0)
        result = 31 * result + (domainArn?.hashCode() ?: 0)
        result = 31 * result + (indexName.hashCode())
        result = 31 * result + (indexRotationPeriod?.hashCode() ?: 0)
        result = 31 * result + (processingConfiguration?.hashCode() ?: 0)
        result = 31 * result + (retryOptions?.hashCode() ?: 0)
        result = 31 * result + (roleArn.hashCode())
        result = 31 * result + (s3BackupMode?.hashCode() ?: 0)
        result = 31 * result + (s3Configuration?.hashCode() ?: 0)
        result = 31 * result + (typeName?.hashCode() ?: 0)
        result = 31 * result + (vpcConfiguration?.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 ElasticsearchDestinationConfiguration

        if (bufferingHints != other.bufferingHints) return false
        if (cloudWatchLoggingOptions != other.cloudWatchLoggingOptions) return false
        if (clusterEndpoint != other.clusterEndpoint) return false
        if (documentIdOptions != other.documentIdOptions) return false
        if (domainArn != other.domainArn) return false
        if (indexName != other.indexName) return false
        if (indexRotationPeriod != other.indexRotationPeriod) return false
        if (processingConfiguration != other.processingConfiguration) return false
        if (retryOptions != other.retryOptions) return false
        if (roleArn != other.roleArn) return false
        if (s3BackupMode != other.s3BackupMode) return false
        if (s3Configuration != other.s3Configuration) return false
        if (typeName != other.typeName) return false
        if (vpcConfiguration != other.vpcConfiguration) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The buffering options. If no value is specified, the default values for `ElasticsearchBufferingHints` are used.
         */
        public var bufferingHints: aws.sdk.kotlin.services.firehose.model.ElasticsearchBufferingHints? = null
        /**
         * The Amazon CloudWatch logging options for your delivery stream.
         */
        public var cloudWatchLoggingOptions: aws.sdk.kotlin.services.firehose.model.CloudWatchLoggingOptions? = null
        /**
         * The endpoint to use when communicating with the cluster. Specify either this `ClusterEndpoint` or the `DomainARN` field.
         */
        public var clusterEndpoint: kotlin.String? = null
        /**
         * Indicates the method for setting up document ID. The supported methods are Firehose generated document ID and OpenSearch Service generated document ID.
         */
        public var documentIdOptions: aws.sdk.kotlin.services.firehose.model.DocumentIdOptions? = null
        /**
         * The ARN of the Amazon ES domain. The IAM role must have permissions for `DescribeDomain`, `DescribeDomains`, and `DescribeDomainConfig` after assuming the role specified in **RoleARN**. For more information, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
         *
         * Specify either `ClusterEndpoint` or `DomainARN`.
         */
        public var domainArn: kotlin.String? = null
        /**
         * The Elasticsearch index name.
         */
        public var indexName: kotlin.String? = null
        /**
         * The Elasticsearch index rotation period. Index rotation appends a timestamp to the `IndexName` to facilitate the expiration of old data. For more information, see [Index Rotation for the Amazon ES Destination](https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). The default value is `OneDay`.
         */
        public var indexRotationPeriod: aws.sdk.kotlin.services.firehose.model.ElasticsearchIndexRotationPeriod? = null
        /**
         * The data processing configuration.
         */
        public var processingConfiguration: aws.sdk.kotlin.services.firehose.model.ProcessingConfiguration? = null
        /**
         * The retry behavior in case Firehose is unable to deliver documents to Amazon ES. The default value is 300 (5 minutes).
         */
        public var retryOptions: aws.sdk.kotlin.services.firehose.model.ElasticsearchRetryOptions? = null
        /**
         * The Amazon Resource Name (ARN) of the IAM role to be assumed by Firehose for calling the Amazon ES Configuration API and for indexing documents. For more information, see [Grant Firehose Access to an Amazon S3 Destination](https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) and [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
         */
        public var roleArn: kotlin.String? = null
        /**
         * Defines how documents should be delivered to Amazon S3. When it is set to `FailedDocumentsOnly`, Firehose writes any documents that could not be indexed to the configured Amazon S3 destination, with `AmazonOpenSearchService-failed/` appended to the key prefix. When set to `AllDocuments`, Firehose delivers all incoming records to Amazon S3, and also writes failed documents with `AmazonOpenSearchService-failed/` appended to the prefix. For more information, see [Amazon S3 Backup for the Amazon ES Destination](https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-s3-backup). Default value is `FailedDocumentsOnly`.
         *
         * You can't change this backup mode after you create the delivery stream.
         */
        public var s3BackupMode: aws.sdk.kotlin.services.firehose.model.ElasticsearchS3BackupMode? = null
        /**
         * The configuration for the backup Amazon S3 location.
         */
        public var s3Configuration: aws.sdk.kotlin.services.firehose.model.S3DestinationConfiguration? = null
        /**
         * The Elasticsearch type name. For Elasticsearch 6.x, there can be only one type per index. If you try to specify a new type for an existing index that already has another type, Firehose returns an error during run time.
         *
         * For Elasticsearch 7.x, don't specify a `TypeName`.
         */
        public var typeName: kotlin.String? = null
        /**
         * The details of the VPC of the Amazon destination.
         */
        public var vpcConfiguration: aws.sdk.kotlin.services.firehose.model.VpcConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.firehose.model.ElasticsearchDestinationConfiguration) : this() {
            this.bufferingHints = x.bufferingHints
            this.cloudWatchLoggingOptions = x.cloudWatchLoggingOptions
            this.clusterEndpoint = x.clusterEndpoint
            this.documentIdOptions = x.documentIdOptions
            this.domainArn = x.domainArn
            this.indexName = x.indexName
            this.indexRotationPeriod = x.indexRotationPeriod
            this.processingConfiguration = x.processingConfiguration
            this.retryOptions = x.retryOptions
            this.roleArn = x.roleArn
            this.s3BackupMode = x.s3BackupMode
            this.s3Configuration = x.s3Configuration
            this.typeName = x.typeName
            this.vpcConfiguration = x.vpcConfiguration
        }

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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy