commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ConverseTrace.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockruntime-jvm Show documentation
Show all versions of bedrockruntime-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Runtime
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The trace object in a response from [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). Currently, you can only trace guardrails.
*/
public class ConverseTrace private constructor(builder: Builder) {
/**
* The guardrail trace object.
*/
public val guardrail: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTraceAssessment? = builder.guardrail
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.ConverseTrace = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ConverseTrace(")
append("guardrail=$guardrail")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = guardrail?.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 ConverseTrace
if (guardrail != other.guardrail) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.ConverseTrace = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The guardrail trace object.
*/
public var guardrail: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTraceAssessment? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.ConverseTrace) : this() {
this.guardrail = x.guardrail
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.ConverseTrace = ConverseTrace(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTraceAssessment] inside the given [block]
*/
public fun guardrail(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTraceAssessment.Builder.() -> kotlin.Unit) {
this.guardrail = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTraceAssessment.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}