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

commonMain.aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrock.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains details about how to handle harmful content.
 *
 * This data type is used in the following API operations:
 * + [CreateGuardrail request body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateGuardrail.html#API_CreateGuardrail_RequestSyntax)
 * + [UpdateGuardrail request body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_UpdateGuardrail.html#API_UpdateGuardrail_RequestSyntax)
 */
public class GuardrailContentPolicyConfig private constructor(builder: Builder) {
    /**
     * Contains the type of the content filter and how strongly it should apply to prompts and model responses.
     */
    public val filtersConfig: List = requireNotNull(builder.filtersConfig) { "A non-null value must be provided for filtersConfig" }

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

    override fun toString(): kotlin.String = buildString {
        append("GuardrailContentPolicyConfig(")
        append("filtersConfig=$filtersConfig")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = filtersConfig.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 GuardrailContentPolicyConfig

        if (filtersConfig != other.filtersConfig) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Contains the type of the content filter and how strongly it should apply to prompts and model responses.
         */
        public var filtersConfig: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig) : this() {
            this.filtersConfig = x.filtersConfig
        }

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

        internal fun correctErrors(): Builder {
            if (filtersConfig == null) filtersConfig = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy