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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.CustomTransformationConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Settings for customizing steps in the data source content ingestion pipeline.
 *
 * You can configure the data source to process documents with a Lambda function after they are parsed and converted into chunks. When you add a post-chunking transformation, the service stores chunked documents in an S3 bucket and invokes a Lambda function to process them.
 *
 * To process chunked documents with a Lambda function, define an S3 bucket path for input and output objects, and a transformation that specifies the Lambda function to invoke. You can use the Lambda function to customize how chunks are split, and the metadata for each chunk.
 */
public class CustomTransformationConfiguration private constructor(builder: Builder) {
    /**
     * An S3 bucket path for input and output objects.
     */
    public val intermediateStorage: aws.sdk.kotlin.services.bedrockagent.model.IntermediateStorage? = builder.intermediateStorage
    /**
     * A Lambda function that processes documents.
     */
    public val transformations: List = requireNotNull(builder.transformations) { "A non-null value must be provided for transformations" }

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

    override fun toString(): kotlin.String = buildString {
        append("CustomTransformationConfiguration(")
        append("intermediateStorage=$intermediateStorage,")
        append("transformations=$transformations")
        append(")")
    }

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

        if (intermediateStorage != other.intermediateStorage) return false
        if (transformations != other.transformations) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An S3 bucket path for input and output objects.
         */
        public var intermediateStorage: aws.sdk.kotlin.services.bedrockagent.model.IntermediateStorage? = null
        /**
         * A Lambda function that processes documents.
         */
        public var transformations: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.CustomTransformationConfiguration) : this() {
            this.intermediateStorage = x.intermediateStorage
            this.transformations = x.transformations
        }

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

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

        internal fun correctErrors(): Builder {
            if (transformations == null) transformations = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy