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.
pub use crate::operation::send_message::_send_message_input::SendMessageInputBuilder;

pub use crate::operation::send_message::_send_message_output::SendMessageOutputBuilder;

impl crate::operation::send_message::builders::SendMessageInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::send_message::SendMessageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::send_message::SendMessageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.send_message();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `SendMessage`.
///
/// <p>Submits a message to the Amazon Q in Connect session.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SendMessageFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::send_message::builders::SendMessageInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::send_message::SendMessageOutput,
        crate::operation::send_message::SendMessageError,
    > for SendMessageFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::send_message::SendMessageOutput,
            crate::operation::send_message::SendMessageError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl SendMessageFluentBuilder {
    /// Creates a new `SendMessageFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the SendMessage as a reference.
    pub fn as_input(&self) -> &crate::operation::send_message::builders::SendMessageInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::send_message::SendMessageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::send_message::SendMessageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::send_message::SendMessage::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::send_message::SendMessage::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::send_message::SendMessageOutput,
        crate::operation::send_message::SendMessageError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.assistant_id(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.inner = self.inner.set_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.inner.get_assistant_id()
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.session_id(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.inner = self.inner.set_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.inner.get_session_id()
    }
    /// <p>The message type.</p>
    pub fn r#type(mut self, input: crate::types::MessageType) -> Self {
        self.inner = self.inner.r#type(input);
        self
    }
    /// <p>The message type.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <p>The message type.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::MessageType> {
        self.inner.get_type()
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn message(mut self, input: crate::types::MessageInput) -> Self {
        self.inner = self.inner.message(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.ai_agent_id(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.conversation_context(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.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 set_configuration(mut self, input: ::std::option::Option<crate::types::MessageConfiguration>) -> Self {
        self.inner = self.inner.set_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.inner.get_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.inner = self.inner.client_token(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.orchestrator_use_case(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.inner = self.inner.set_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.inner.get_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 {
        self.inner = self.inner.metadata(k.into(), v.into());
        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.inner = self.inner.set_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.inner.get_metadata()
    }
}