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

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

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The details on the use of the guardrail.
 */
public class GuardrailUsage private constructor(builder: Builder) {
    /**
     * The content policy units processed by the guardrail.
     */
    public val contentPolicyUnits: kotlin.Int = requireNotNull(builder.contentPolicyUnits) { "A non-null value must be provided for contentPolicyUnits" }
    /**
     * The contextual grounding policy units processed by the guardrail.
     */
    public val contextualGroundingPolicyUnits: kotlin.Int = requireNotNull(builder.contextualGroundingPolicyUnits) { "A non-null value must be provided for contextualGroundingPolicyUnits" }
    /**
     * The sensitive information policy free units processed by the guardrail.
     */
    public val sensitiveInformationPolicyFreeUnits: kotlin.Int = requireNotNull(builder.sensitiveInformationPolicyFreeUnits) { "A non-null value must be provided for sensitiveInformationPolicyFreeUnits" }
    /**
     * The sensitive information policy units processed by the guardrail.
     */
    public val sensitiveInformationPolicyUnits: kotlin.Int = requireNotNull(builder.sensitiveInformationPolicyUnits) { "A non-null value must be provided for sensitiveInformationPolicyUnits" }
    /**
     * The topic policy units processed by the guardrail.
     */
    public val topicPolicyUnits: kotlin.Int = requireNotNull(builder.topicPolicyUnits) { "A non-null value must be provided for topicPolicyUnits" }
    /**
     * The word policy units processed by the guardrail.
     */
    public val wordPolicyUnits: kotlin.Int = requireNotNull(builder.wordPolicyUnits) { "A non-null value must be provided for wordPolicyUnits" }

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

    override fun toString(): kotlin.String = buildString {
        append("GuardrailUsage(")
        append("contentPolicyUnits=$contentPolicyUnits,")
        append("contextualGroundingPolicyUnits=$contextualGroundingPolicyUnits,")
        append("sensitiveInformationPolicyFreeUnits=$sensitiveInformationPolicyFreeUnits,")
        append("sensitiveInformationPolicyUnits=$sensitiveInformationPolicyUnits,")
        append("topicPolicyUnits=$topicPolicyUnits,")
        append("wordPolicyUnits=$wordPolicyUnits")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = contentPolicyUnits
        result = 31 * result + (contextualGroundingPolicyUnits)
        result = 31 * result + (sensitiveInformationPolicyFreeUnits)
        result = 31 * result + (sensitiveInformationPolicyUnits)
        result = 31 * result + (topicPolicyUnits)
        result = 31 * result + (wordPolicyUnits)
        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 GuardrailUsage

        if (contentPolicyUnits != other.contentPolicyUnits) return false
        if (contextualGroundingPolicyUnits != other.contextualGroundingPolicyUnits) return false
        if (sensitiveInformationPolicyFreeUnits != other.sensitiveInformationPolicyFreeUnits) return false
        if (sensitiveInformationPolicyUnits != other.sensitiveInformationPolicyUnits) return false
        if (topicPolicyUnits != other.topicPolicyUnits) return false
        if (wordPolicyUnits != other.wordPolicyUnits) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The content policy units processed by the guardrail.
         */
        public var contentPolicyUnits: kotlin.Int? = null
        /**
         * The contextual grounding policy units processed by the guardrail.
         */
        public var contextualGroundingPolicyUnits: kotlin.Int? = null
        /**
         * The sensitive information policy free units processed by the guardrail.
         */
        public var sensitiveInformationPolicyFreeUnits: kotlin.Int? = null
        /**
         * The sensitive information policy units processed by the guardrail.
         */
        public var sensitiveInformationPolicyUnits: kotlin.Int? = null
        /**
         * The topic policy units processed by the guardrail.
         */
        public var topicPolicyUnits: kotlin.Int? = null
        /**
         * The word policy units processed by the guardrail.
         */
        public var wordPolicyUnits: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailUsage) : this() {
            this.contentPolicyUnits = x.contentPolicyUnits
            this.contextualGroundingPolicyUnits = x.contextualGroundingPolicyUnits
            this.sensitiveInformationPolicyFreeUnits = x.sensitiveInformationPolicyFreeUnits
            this.sensitiveInformationPolicyUnits = x.sensitiveInformationPolicyUnits
            this.topicPolicyUnits = x.topicPolicyUnits
            this.wordPolicyUnits = x.wordPolicyUnits
        }

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

        internal fun correctErrors(): Builder {
            if (contentPolicyUnits == null) contentPolicyUnits = 0
            if (contextualGroundingPolicyUnits == null) contextualGroundingPolicyUnits = 0
            if (sensitiveInformationPolicyFreeUnits == null) sensitiveInformationPolicyFreeUnits = 0
            if (sensitiveInformationPolicyUnits == null) sensitiveInformationPolicyUnits = 0
            if (topicPolicyUnits == null) topicPolicyUnits = 0
            if (wordPolicyUnits == null) wordPolicyUnits = 0
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy