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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

public class UpdateGuardrailRequest private constructor(builder: Builder) {
    /**
     * The message to return when the guardrail blocks a prompt.
     */
    public val blockedInputMessaging: kotlin.String? = builder.blockedInputMessaging
    /**
     * The message to return when the guardrail blocks a model response.
     */
    public val blockedOutputsMessaging: kotlin.String? = builder.blockedOutputsMessaging
    /**
     * The content policy to configure for the guardrail.
     */
    public val contentPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig? = builder.contentPolicyConfig
    /**
     * The contextual grounding policy configuration used to update a guardrail.
     */
    public val contextualGroundingPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailContextualGroundingPolicyConfig? = builder.contextualGroundingPolicyConfig
    /**
     * A description of the guardrail.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The unique identifier of the guardrail. This can be an ID or the ARN.
     */
    public val guardrailIdentifier: kotlin.String? = builder.guardrailIdentifier
    /**
     * The ARN of the KMS key with which to encrypt the guardrail.
     */
    public val kmsKeyId: kotlin.String? = builder.kmsKeyId
    /**
     * A name for the guardrail.
     */
    public val name: kotlin.String? = builder.name
    /**
     * The sensitive information policy to configure for the guardrail.
     */
    public val sensitiveInformationPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailSensitiveInformationPolicyConfig? = builder.sensitiveInformationPolicyConfig
    /**
     * The topic policy to configure for the guardrail.
     */
    public val topicPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailTopicPolicyConfig? = builder.topicPolicyConfig
    /**
     * The word policy to configure for the guardrail.
     */
    public val wordPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailWordPolicyConfig? = builder.wordPolicyConfig

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateGuardrailRequest(")
        append("blockedInputMessaging=*** Sensitive Data Redacted ***,")
        append("blockedOutputsMessaging=*** Sensitive Data Redacted ***,")
        append("contentPolicyConfig=$contentPolicyConfig,")
        append("contextualGroundingPolicyConfig=$contextualGroundingPolicyConfig,")
        append("description=*** Sensitive Data Redacted ***,")
        append("guardrailIdentifier=$guardrailIdentifier,")
        append("kmsKeyId=$kmsKeyId,")
        append("name=*** Sensitive Data Redacted ***,")
        append("sensitiveInformationPolicyConfig=$sensitiveInformationPolicyConfig,")
        append("topicPolicyConfig=$topicPolicyConfig,")
        append("wordPolicyConfig=$wordPolicyConfig")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = blockedInputMessaging?.hashCode() ?: 0
        result = 31 * result + (blockedOutputsMessaging?.hashCode() ?: 0)
        result = 31 * result + (contentPolicyConfig?.hashCode() ?: 0)
        result = 31 * result + (contextualGroundingPolicyConfig?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (guardrailIdentifier?.hashCode() ?: 0)
        result = 31 * result + (kmsKeyId?.hashCode() ?: 0)
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (sensitiveInformationPolicyConfig?.hashCode() ?: 0)
        result = 31 * result + (topicPolicyConfig?.hashCode() ?: 0)
        result = 31 * result + (wordPolicyConfig?.hashCode() ?: 0)
        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 UpdateGuardrailRequest

        if (blockedInputMessaging != other.blockedInputMessaging) return false
        if (blockedOutputsMessaging != other.blockedOutputsMessaging) return false
        if (contentPolicyConfig != other.contentPolicyConfig) return false
        if (contextualGroundingPolicyConfig != other.contextualGroundingPolicyConfig) return false
        if (description != other.description) return false
        if (guardrailIdentifier != other.guardrailIdentifier) return false
        if (kmsKeyId != other.kmsKeyId) return false
        if (name != other.name) return false
        if (sensitiveInformationPolicyConfig != other.sensitiveInformationPolicyConfig) return false
        if (topicPolicyConfig != other.topicPolicyConfig) return false
        if (wordPolicyConfig != other.wordPolicyConfig) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The message to return when the guardrail blocks a prompt.
         */
        public var blockedInputMessaging: kotlin.String? = null
        /**
         * The message to return when the guardrail blocks a model response.
         */
        public var blockedOutputsMessaging: kotlin.String? = null
        /**
         * The content policy to configure for the guardrail.
         */
        public var contentPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig? = null
        /**
         * The contextual grounding policy configuration used to update a guardrail.
         */
        public var contextualGroundingPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailContextualGroundingPolicyConfig? = null
        /**
         * A description of the guardrail.
         */
        public var description: kotlin.String? = null
        /**
         * The unique identifier of the guardrail. This can be an ID or the ARN.
         */
        public var guardrailIdentifier: kotlin.String? = null
        /**
         * The ARN of the KMS key with which to encrypt the guardrail.
         */
        public var kmsKeyId: kotlin.String? = null
        /**
         * A name for the guardrail.
         */
        public var name: kotlin.String? = null
        /**
         * The sensitive information policy to configure for the guardrail.
         */
        public var sensitiveInformationPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailSensitiveInformationPolicyConfig? = null
        /**
         * The topic policy to configure for the guardrail.
         */
        public var topicPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailTopicPolicyConfig? = null
        /**
         * The word policy to configure for the guardrail.
         */
        public var wordPolicyConfig: aws.sdk.kotlin.services.bedrock.model.GuardrailWordPolicyConfig? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrock.model.UpdateGuardrailRequest) : this() {
            this.blockedInputMessaging = x.blockedInputMessaging
            this.blockedOutputsMessaging = x.blockedOutputsMessaging
            this.contentPolicyConfig = x.contentPolicyConfig
            this.contextualGroundingPolicyConfig = x.contextualGroundingPolicyConfig
            this.description = x.description
            this.guardrailIdentifier = x.guardrailIdentifier
            this.kmsKeyId = x.kmsKeyId
            this.name = x.name
            this.sensitiveInformationPolicyConfig = x.sensitiveInformationPolicyConfig
            this.topicPolicyConfig = x.topicPolicyConfig
            this.wordPolicyConfig = x.wordPolicyConfig
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig] inside the given [block]
         */
        public fun contentPolicyConfig(block: aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig.Builder.() -> kotlin.Unit) {
            this.contentPolicyConfig = aws.sdk.kotlin.services.bedrock.model.GuardrailContentPolicyConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrock.model.GuardrailContextualGroundingPolicyConfig] inside the given [block]
         */
        public fun contextualGroundingPolicyConfig(block: aws.sdk.kotlin.services.bedrock.model.GuardrailContextualGroundingPolicyConfig.Builder.() -> kotlin.Unit) {
            this.contextualGroundingPolicyConfig = aws.sdk.kotlin.services.bedrock.model.GuardrailContextualGroundingPolicyConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrock.model.GuardrailSensitiveInformationPolicyConfig] inside the given [block]
         */
        public fun sensitiveInformationPolicyConfig(block: aws.sdk.kotlin.services.bedrock.model.GuardrailSensitiveInformationPolicyConfig.Builder.() -> kotlin.Unit) {
            this.sensitiveInformationPolicyConfig = aws.sdk.kotlin.services.bedrock.model.GuardrailSensitiveInformationPolicyConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrock.model.GuardrailTopicPolicyConfig] inside the given [block]
         */
        public fun topicPolicyConfig(block: aws.sdk.kotlin.services.bedrock.model.GuardrailTopicPolicyConfig.Builder.() -> kotlin.Unit) {
            this.topicPolicyConfig = aws.sdk.kotlin.services.bedrock.model.GuardrailTopicPolicyConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrock.model.GuardrailWordPolicyConfig] inside the given [block]
         */
        public fun wordPolicyConfig(block: aws.sdk.kotlin.services.bedrock.model.GuardrailWordPolicyConfig.Builder.() -> kotlin.Unit) {
            this.wordPolicyConfig = aws.sdk.kotlin.services.bedrock.model.GuardrailWordPolicyConfig.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy