commonMain.aws.sdk.kotlin.services.bedrockagent.model.Transformation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A custom processing step for documents moving through a data source ingestion pipeline. To process documents after they have been converted into chunks, set the step to apply to `POST_CHUNKING`.
*/
public class Transformation private constructor(builder: Builder) {
/**
* When the service applies the transformation.
*/
public val stepToApply: aws.sdk.kotlin.services.bedrockagent.model.StepType = requireNotNull(builder.stepToApply) { "A non-null value must be provided for stepToApply" }
/**
* A Lambda function that processes documents.
*/
public val transformationFunction: aws.sdk.kotlin.services.bedrockagent.model.TransformationFunction? = builder.transformationFunction
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.Transformation = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Transformation(")
append("stepToApply=$stepToApply,")
append("transformationFunction=$transformationFunction")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = stepToApply.hashCode()
result = 31 * result + (transformationFunction?.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 Transformation
if (stepToApply != other.stepToApply) return false
if (transformationFunction != other.transformationFunction) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.Transformation = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* When the service applies the transformation.
*/
public var stepToApply: aws.sdk.kotlin.services.bedrockagent.model.StepType? = null
/**
* A Lambda function that processes documents.
*/
public var transformationFunction: aws.sdk.kotlin.services.bedrockagent.model.TransformationFunction? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.Transformation) : this() {
this.stepToApply = x.stepToApply
this.transformationFunction = x.transformationFunction
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.Transformation = Transformation(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.TransformationFunction] inside the given [block]
*/
public fun transformationFunction(block: aws.sdk.kotlin.services.bedrockagent.model.TransformationFunction.Builder.() -> kotlin.Unit) {
this.transformationFunction = aws.sdk.kotlin.services.bedrockagent.model.TransformationFunction.invoke(block)
}
internal fun correctErrors(): Builder {
if (stepToApply == null) stepToApply = StepType.SdkUnknown("no value provided")
return this
}
}
}