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

commonMain.aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCustomWord.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrockruntime.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A custom word configured in a guardrail.
 */
public class GuardrailCustomWord private constructor(builder: Builder) {
    /**
     * The action for the custom 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 custom word.
     */
    public val match: kotlin.String = requireNotNull(builder.match) { "A non-null value must be provided for match" }

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

    override fun toString(): kotlin.String = buildString {
        append("GuardrailCustomWord(")
        append("action=$action,")
        append("match=$match")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = action.hashCode()
        result = 31 * result + (match.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 GuardrailCustomWord

        if (action != other.action) return false
        if (match != other.match) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The action for the custom word.
         */
        public var action: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAction? = null
        /**
         * The match for the custom word.
         */
        public var match: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCustomWord) : this() {
            this.action = x.action
            this.match = x.match
        }

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

        internal fun correctErrors(): Builder {
            if (action == null) action = GuardrailWordPolicyAction.SdkUnknown("no value provided")
            if (match == null) match = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy