aws-sdk-qconnect 1.109.0

AWS SDK for Amazon Q Connect
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateAiGuardrailInput {
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>..</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
    pub assistant_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the AI Guardrail.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The message to return when the AI Guardrail blocks a prompt.</p>
    pub blocked_input_messaging: ::std::option::Option<::std::string::String>,
    /// <p>The message to return when the AI Guardrail blocks a model response.</p>
    pub blocked_outputs_messaging: ::std::option::Option<::std::string::String>,
    /// <p>The visibility status of the AI Guardrail.</p>
    pub visibility_status: ::std::option::Option<crate::types::VisibilityStatus>,
    /// <p>A description of the AI Guardrail.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The topic policies to configure for the AI Guardrail.</p>
    pub topic_policy_config: ::std::option::Option<crate::types::AiGuardrailTopicPolicyConfig>,
    /// <p>The content filter policies to configure for the AI Guardrail.</p>
    pub content_policy_config: ::std::option::Option<crate::types::AiGuardrailContentPolicyConfig>,
    /// <p>The word policy you configure for the AI Guardrail.</p>
    pub word_policy_config: ::std::option::Option<crate::types::AiGuardrailWordPolicyConfig>,
    /// <p>The sensitive information policy to configure for the AI Guardrail.</p>
    pub sensitive_information_policy_config: ::std::option::Option<crate::types::AiGuardrailSensitiveInformationPolicyConfig>,
    /// <p>The contextual grounding policy configuration used to create an AI Guardrail.</p>
    pub contextual_grounding_policy_config: ::std::option::Option<crate::types::AiGuardrailContextualGroundingPolicyConfig>,
    /// <p>The tags used to organize, track, or control access for this resource.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateAiGuardrailInput {
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>..</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
        self.assistant_id.as_deref()
    }
    /// <p>The name of the AI Guardrail.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The message to return when the AI Guardrail blocks a prompt.</p>
    pub fn blocked_input_messaging(&self) -> ::std::option::Option<&str> {
        self.blocked_input_messaging.as_deref()
    }
    /// <p>The message to return when the AI Guardrail blocks a model response.</p>
    pub fn blocked_outputs_messaging(&self) -> ::std::option::Option<&str> {
        self.blocked_outputs_messaging.as_deref()
    }
    /// <p>The visibility status of the AI Guardrail.</p>
    pub fn visibility_status(&self) -> ::std::option::Option<&crate::types::VisibilityStatus> {
        self.visibility_status.as_ref()
    }
    /// <p>A description of the AI Guardrail.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The topic policies to configure for the AI Guardrail.</p>
    pub fn topic_policy_config(&self) -> ::std::option::Option<&crate::types::AiGuardrailTopicPolicyConfig> {
        self.topic_policy_config.as_ref()
    }
    /// <p>The content filter policies to configure for the AI Guardrail.</p>
    pub fn content_policy_config(&self) -> ::std::option::Option<&crate::types::AiGuardrailContentPolicyConfig> {
        self.content_policy_config.as_ref()
    }
    /// <p>The word policy you configure for the AI Guardrail.</p>
    pub fn word_policy_config(&self) -> ::std::option::Option<&crate::types::AiGuardrailWordPolicyConfig> {
        self.word_policy_config.as_ref()
    }
    /// <p>The sensitive information policy to configure for the AI Guardrail.</p>
    pub fn sensitive_information_policy_config(&self) -> ::std::option::Option<&crate::types::AiGuardrailSensitiveInformationPolicyConfig> {
        self.sensitive_information_policy_config.as_ref()
    }
    /// <p>The contextual grounding policy configuration used to create an AI Guardrail.</p>
    pub fn contextual_grounding_policy_config(&self) -> ::std::option::Option<&crate::types::AiGuardrailContextualGroundingPolicyConfig> {
        self.contextual_grounding_policy_config.as_ref()
    }
    /// <p>The tags used to organize, track, or control access for this resource.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for CreateAiGuardrailInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateAiGuardrailInput");
        formatter.field("client_token", &self.client_token);
        formatter.field("assistant_id", &self.assistant_id);
        formatter.field("name", &self.name);
        formatter.field("blocked_input_messaging", &"*** Sensitive Data Redacted ***");
        formatter.field("blocked_outputs_messaging", &"*** Sensitive Data Redacted ***");
        formatter.field("visibility_status", &self.visibility_status);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("topic_policy_config", &self.topic_policy_config);
        formatter.field("content_policy_config", &self.content_policy_config);
        formatter.field("word_policy_config", &self.word_policy_config);
        formatter.field("sensitive_information_policy_config", &self.sensitive_information_policy_config);
        formatter.field("contextual_grounding_policy_config", &self.contextual_grounding_policy_config);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl CreateAiGuardrailInput {
    /// Creates a new builder-style object to manufacture [`CreateAiGuardrailInput`](crate::operation::create_ai_guardrail::CreateAiGuardrailInput).
    pub fn builder() -> crate::operation::create_ai_guardrail::builders::CreateAiGuardrailInputBuilder {
        crate::operation::create_ai_guardrail::builders::CreateAiGuardrailInputBuilder::default()
    }
}

/// A builder for [`CreateAiGuardrailInput`](crate::operation::create_ai_guardrail::CreateAiGuardrailInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateAiGuardrailInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) blocked_input_messaging: ::std::option::Option<::std::string::String>,
    pub(crate) blocked_outputs_messaging: ::std::option::Option<::std::string::String>,
    pub(crate) visibility_status: ::std::option::Option<crate::types::VisibilityStatus>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) topic_policy_config: ::std::option::Option<crate::types::AiGuardrailTopicPolicyConfig>,
    pub(crate) content_policy_config: ::std::option::Option<crate::types::AiGuardrailContentPolicyConfig>,
    pub(crate) word_policy_config: ::std::option::Option<crate::types::AiGuardrailWordPolicyConfig>,
    pub(crate) sensitive_information_policy_config: ::std::option::Option<crate::types::AiGuardrailSensitiveInformationPolicyConfig>,
    pub(crate) contextual_grounding_policy_config: ::std::option::Option<crate::types::AiGuardrailContextualGroundingPolicyConfig>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateAiGuardrailInputBuilder {
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>..</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>..</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>..</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
    /// This field is required.
    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.assistant_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assistant_id = input;
        self
    }
    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.assistant_id
    }
    /// <p>The name of the AI Guardrail.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the AI Guardrail.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the AI Guardrail.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The message to return when the AI Guardrail blocks a prompt.</p>
    /// This field is required.
    pub fn blocked_input_messaging(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.blocked_input_messaging = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message to return when the AI Guardrail blocks a prompt.</p>
    pub fn set_blocked_input_messaging(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.blocked_input_messaging = input;
        self
    }
    /// <p>The message to return when the AI Guardrail blocks a prompt.</p>
    pub fn get_blocked_input_messaging(&self) -> &::std::option::Option<::std::string::String> {
        &self.blocked_input_messaging
    }
    /// <p>The message to return when the AI Guardrail blocks a model response.</p>
    /// This field is required.
    pub fn blocked_outputs_messaging(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.blocked_outputs_messaging = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message to return when the AI Guardrail blocks a model response.</p>
    pub fn set_blocked_outputs_messaging(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.blocked_outputs_messaging = input;
        self
    }
    /// <p>The message to return when the AI Guardrail blocks a model response.</p>
    pub fn get_blocked_outputs_messaging(&self) -> &::std::option::Option<::std::string::String> {
        &self.blocked_outputs_messaging
    }
    /// <p>The visibility status of the AI Guardrail.</p>
    /// This field is required.
    pub fn visibility_status(mut self, input: crate::types::VisibilityStatus) -> Self {
        self.visibility_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The visibility status of the AI Guardrail.</p>
    pub fn set_visibility_status(mut self, input: ::std::option::Option<crate::types::VisibilityStatus>) -> Self {
        self.visibility_status = input;
        self
    }
    /// <p>The visibility status of the AI Guardrail.</p>
    pub fn get_visibility_status(&self) -> &::std::option::Option<crate::types::VisibilityStatus> {
        &self.visibility_status
    }
    /// <p>A description of the AI Guardrail.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the AI Guardrail.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the AI Guardrail.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The topic policies to configure for the AI Guardrail.</p>
    pub fn topic_policy_config(mut self, input: crate::types::AiGuardrailTopicPolicyConfig) -> Self {
        self.topic_policy_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The topic policies to configure for the AI Guardrail.</p>
    pub fn set_topic_policy_config(mut self, input: ::std::option::Option<crate::types::AiGuardrailTopicPolicyConfig>) -> Self {
        self.topic_policy_config = input;
        self
    }
    /// <p>The topic policies to configure for the AI Guardrail.</p>
    pub fn get_topic_policy_config(&self) -> &::std::option::Option<crate::types::AiGuardrailTopicPolicyConfig> {
        &self.topic_policy_config
    }
    /// <p>The content filter policies to configure for the AI Guardrail.</p>
    pub fn content_policy_config(mut self, input: crate::types::AiGuardrailContentPolicyConfig) -> Self {
        self.content_policy_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The content filter policies to configure for the AI Guardrail.</p>
    pub fn set_content_policy_config(mut self, input: ::std::option::Option<crate::types::AiGuardrailContentPolicyConfig>) -> Self {
        self.content_policy_config = input;
        self
    }
    /// <p>The content filter policies to configure for the AI Guardrail.</p>
    pub fn get_content_policy_config(&self) -> &::std::option::Option<crate::types::AiGuardrailContentPolicyConfig> {
        &self.content_policy_config
    }
    /// <p>The word policy you configure for the AI Guardrail.</p>
    pub fn word_policy_config(mut self, input: crate::types::AiGuardrailWordPolicyConfig) -> Self {
        self.word_policy_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The word policy you configure for the AI Guardrail.</p>
    pub fn set_word_policy_config(mut self, input: ::std::option::Option<crate::types::AiGuardrailWordPolicyConfig>) -> Self {
        self.word_policy_config = input;
        self
    }
    /// <p>The word policy you configure for the AI Guardrail.</p>
    pub fn get_word_policy_config(&self) -> &::std::option::Option<crate::types::AiGuardrailWordPolicyConfig> {
        &self.word_policy_config
    }
    /// <p>The sensitive information policy to configure for the AI Guardrail.</p>
    pub fn sensitive_information_policy_config(mut self, input: crate::types::AiGuardrailSensitiveInformationPolicyConfig) -> Self {
        self.sensitive_information_policy_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sensitive information policy to configure for the AI Guardrail.</p>
    pub fn set_sensitive_information_policy_config(
        mut self,
        input: ::std::option::Option<crate::types::AiGuardrailSensitiveInformationPolicyConfig>,
    ) -> Self {
        self.sensitive_information_policy_config = input;
        self
    }
    /// <p>The sensitive information policy to configure for the AI Guardrail.</p>
    pub fn get_sensitive_information_policy_config(&self) -> &::std::option::Option<crate::types::AiGuardrailSensitiveInformationPolicyConfig> {
        &self.sensitive_information_policy_config
    }
    /// <p>The contextual grounding policy configuration used to create an AI Guardrail.</p>
    pub fn contextual_grounding_policy_config(mut self, input: crate::types::AiGuardrailContextualGroundingPolicyConfig) -> Self {
        self.contextual_grounding_policy_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The contextual grounding policy configuration used to create an AI Guardrail.</p>
    pub fn set_contextual_grounding_policy_config(
        mut self,
        input: ::std::option::Option<crate::types::AiGuardrailContextualGroundingPolicyConfig>,
    ) -> Self {
        self.contextual_grounding_policy_config = input;
        self
    }
    /// <p>The contextual grounding policy configuration used to create an AI Guardrail.</p>
    pub fn get_contextual_grounding_policy_config(&self) -> &::std::option::Option<crate::types::AiGuardrailContextualGroundingPolicyConfig> {
        &self.contextual_grounding_policy_config
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags used to organize, track, or control access for this resource.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags used to organize, track, or control access for this resource.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags used to organize, track, or control access for this resource.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateAiGuardrailInput`](crate::operation::create_ai_guardrail::CreateAiGuardrailInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_ai_guardrail::CreateAiGuardrailInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_ai_guardrail::CreateAiGuardrailInput {
            client_token: self.client_token,
            assistant_id: self.assistant_id,
            name: self.name,
            blocked_input_messaging: self.blocked_input_messaging,
            blocked_outputs_messaging: self.blocked_outputs_messaging,
            visibility_status: self.visibility_status,
            description: self.description,
            topic_policy_config: self.topic_policy_config,
            content_policy_config: self.content_policy_config,
            word_policy_config: self.word_policy_config,
            sensitive_information_policy_config: self.sensitive_information_policy_config,
            contextual_grounding_policy_config: self.contextual_grounding_policy_config,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreateAiGuardrailInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateAiGuardrailInputBuilder");
        formatter.field("client_token", &self.client_token);
        formatter.field("assistant_id", &self.assistant_id);
        formatter.field("name", &self.name);
        formatter.field("blocked_input_messaging", &"*** Sensitive Data Redacted ***");
        formatter.field("blocked_outputs_messaging", &"*** Sensitive Data Redacted ***");
        formatter.field("visibility_status", &self.visibility_status);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("topic_policy_config", &self.topic_policy_config);
        formatter.field("content_policy_config", &self.content_policy_config);
        formatter.field("word_policy_config", &self.word_policy_config);
        formatter.field("sensitive_information_policy_config", &self.sensitive_information_policy_config);
        formatter.field("contextual_grounding_policy_config", &self.contextual_grounding_policy_config);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}