commonMain.aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConfiguration.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 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
/**
* Configuration information for a guardrail that you use with the [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) operation.
*/
public class GuardrailConfiguration private constructor(builder: Builder) {
/**
* The identifier for the guardrail.
*/
public val guardrailIdentifier: kotlin.String = requireNotNull(builder.guardrailIdentifier) { "A non-null value must be provided for guardrailIdentifier" }
/**
* The version of the guardrail.
*/
public val guardrailVersion: kotlin.String = requireNotNull(builder.guardrailVersion) { "A non-null value must be provided for guardrailVersion" }
/**
* The trace behavior for the guardrail.
*/
public val trace: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTrace = builder.trace
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GuardrailConfiguration(")
append("guardrailIdentifier=$guardrailIdentifier,")
append("guardrailVersion=$guardrailVersion,")
append("trace=$trace")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = guardrailIdentifier.hashCode()
result = 31 * result + (guardrailVersion.hashCode())
result = 31 * result + (trace.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 GuardrailConfiguration
if (guardrailIdentifier != other.guardrailIdentifier) return false
if (guardrailVersion != other.guardrailVersion) return false
if (trace != other.trace) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The identifier for the guardrail.
*/
public var guardrailIdentifier: kotlin.String? = null
/**
* The version of the guardrail.
*/
public var guardrailVersion: kotlin.String? = null
/**
* The trace behavior for the guardrail.
*/
public var trace: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTrace = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTrace.fromValue("disabled")
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConfiguration) : this() {
this.guardrailIdentifier = x.guardrailIdentifier
this.guardrailVersion = x.guardrailVersion
this.trace = x.trace
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConfiguration = GuardrailConfiguration(this)
internal fun correctErrors(): Builder {
if (guardrailIdentifier == null) guardrailIdentifier = ""
if (guardrailVersion == null) guardrailVersion = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy