commonMain.aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWord.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
/**
* A managed word configured in a guardrail.
*/
public class GuardrailManagedWord private constructor(builder: Builder) {
/**
* The action for the managed word.
*/
public val action: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAction = requireNotNull(builder.action) { "A non-null value must be provided for action" }
/**
* The match for the managed word.
*/
public val match: kotlin.String = requireNotNull(builder.match) { "A non-null value must be provided for match" }
/**
* The type for the managed word.
*/
public val type: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWordType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWord = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GuardrailManagedWord(")
append("action=$action,")
append("match=$match,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action.hashCode()
result = 31 * result + (match.hashCode())
result = 31 * result + (type.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 GuardrailManagedWord
if (action != other.action) return false
if (match != other.match) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWord = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The action for the managed word.
*/
public var action: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAction? = null
/**
* The match for the managed word.
*/
public var match: kotlin.String? = null
/**
* The type for the managed word.
*/
public var type: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWordType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWord) : this() {
this.action = x.action
this.match = x.match
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailManagedWord = GuardrailManagedWord(this)
internal fun correctErrors(): Builder {
if (action == null) action = GuardrailWordPolicyAction.SdkUnknown("no value provided")
if (match == null) match = ""
if (type == null) type = GuardrailManagedWordType.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy