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, ::std::fmt::Debug)]
pub struct SendMessageInput {
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub assistant_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>The message type.</p>
    pub r#type: ::std::option::Option<crate::types::MessageType>,
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub message: ::std::option::Option<crate::types::MessageInput>,
    /// <p>The identifier of the AI Agent to use for processing the message.</p>
    pub ai_agent_id: ::std::option::Option<::std::string::String>,
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub conversation_context: ::std::option::Option<crate::types::ConversationContext>,
    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
    pub configuration: ::std::option::Option<crate::types::MessageConfiguration>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The orchestrator use case for message processing.</p>
    pub orchestrator_use_case: ::std::option::Option<::std::string::String>,
    /// <p>Additional metadata for the message.</p>
    pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl SendMessageInput {
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
        self.assistant_id.as_deref()
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>The message type.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::MessageType> {
        self.r#type.as_ref()
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn message(&self) -> ::std::option::Option<&crate::types::MessageInput> {
        self.message.as_ref()
    }
    /// <p>The identifier of the AI Agent to use for processing the message.</p>
    pub fn ai_agent_id(&self) -> ::std::option::Option<&str> {
        self.ai_agent_id.as_deref()
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn conversation_context(&self) -> ::std::option::Option<&crate::types::ConversationContext> {
        self.conversation_context.as_ref()
    }
    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
    pub fn configuration(&self) -> ::std::option::Option<&crate::types::MessageConfiguration> {
        self.configuration.as_ref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The orchestrator use case for message processing.</p>
    pub fn orchestrator_use_case(&self) -> ::std::option::Option<&str> {
        self.orchestrator_use_case.as_deref()
    }
    /// <p>Additional metadata for the message.</p>
    pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.metadata.as_ref()
    }
}
impl SendMessageInput {
    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
        crate::operation::send_message::builders::SendMessageInputBuilder::default()
    }
}

/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendMessageInputBuilder {
    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::MessageType>,
    pub(crate) message: ::std::option::Option<crate::types::MessageInput>,
    pub(crate) ai_agent_id: ::std::option::Option<::std::string::String>,
    pub(crate) conversation_context: ::std::option::Option<crate::types::ConversationContext>,
    pub(crate) configuration: ::std::option::Option<crate::types::MessageConfiguration>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) orchestrator_use_case: ::std::option::Option<::std::string::String>,
    pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl SendMessageInputBuilder {
    /// <p>The identifier of the Amazon Q in Connect assistant.</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.</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.</p>
    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.assistant_id
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    /// This field is required.
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The message type.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::MessageType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message type.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The message type.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::MessageType> {
        &self.r#type
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    /// This field is required.
    pub fn message(mut self, input: crate::types::MessageInput) -> Self {
        self.message = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn set_message(mut self, input: ::std::option::Option<crate::types::MessageInput>) -> Self {
        self.message = input;
        self
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn get_message(&self) -> &::std::option::Option<crate::types::MessageInput> {
        &self.message
    }
    /// <p>The identifier of the AI Agent to use for processing the message.</p>
    pub fn ai_agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ai_agent_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the AI Agent to use for processing the message.</p>
    pub fn set_ai_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ai_agent_id = input;
        self
    }
    /// <p>The identifier of the AI Agent to use for processing the message.</p>
    pub fn get_ai_agent_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ai_agent_id
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn conversation_context(mut self, input: crate::types::ConversationContext) -> Self {
        self.conversation_context = ::std::option::Option::Some(input);
        self
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn set_conversation_context(mut self, input: ::std::option::Option<crate::types::ConversationContext>) -> Self {
        self.conversation_context = input;
        self
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn get_conversation_context(&self) -> &::std::option::Option<crate::types::ConversationContext> {
        &self.conversation_context
    }
    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
    pub fn configuration(mut self, input: crate::types::MessageConfiguration) -> Self {
        self.configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::MessageConfiguration>) -> Self {
        self.configuration = input;
        self
    }
    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::MessageConfiguration> {
        &self.configuration
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</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 AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</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 AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The orchestrator use case for message processing.</p>
    pub fn orchestrator_use_case(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.orchestrator_use_case = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The orchestrator use case for message processing.</p>
    pub fn set_orchestrator_use_case(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.orchestrator_use_case = input;
        self
    }
    /// <p>The orchestrator use case for message processing.</p>
    pub fn get_orchestrator_use_case(&self) -> &::std::option::Option<::std::string::String> {
        &self.orchestrator_use_case
    }
    /// Adds a key-value pair to `metadata`.
    ///
    /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
    ///
    /// <p>Additional metadata for the message.</p>
    pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.metadata.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.metadata = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Additional metadata for the message.</p>
    pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.metadata = input;
        self
    }
    /// <p>Additional metadata for the message.</p>
    pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.metadata
    }
    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
            assistant_id: self.assistant_id,
            session_id: self.session_id,
            r#type: self.r#type,
            message: self.message,
            ai_agent_id: self.ai_agent_id,
            conversation_context: self.conversation_context,
            configuration: self.configuration,
            client_token: self.client_token,
            orchestrator_use_case: self.orchestrator_use_case,
            metadata: self.metadata,
        })
    }
}