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

commonMain.aws.sdk.kotlin.services.bedrock.model.GuardrailTopicPolicy.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 topics that the guardrail should identify and deny.
 *
 * This data type is used in the following API operations:
 * + [GetGuardrail response body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax)
 */
public class GuardrailTopicPolicy private constructor(builder: Builder) {
    /**
     * A list of policies related to topics that the guardrail should deny.
     */
    public val topics: List = requireNotNull(builder.topics) { "A non-null value must be provided for topics" }

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

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

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

        if (topics != other.topics) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A list of policies related to topics that the guardrail should deny.
         */
        public var topics: List? = null

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy