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 GetNextMessageOutput {
    /// <p>The type of message response.</p>
    pub r#type: crate::types::MessageType,
    /// <p>The message response to the requested message.</p>
    pub response: ::std::option::Option<crate::types::MessageOutput>,
    /// <p>The identifier of the submitted message.</p>
    pub request_message_id: ::std::string::String,
    /// <p>The state of current conversation.</p>
    pub conversation_state: ::std::option::Option<crate::types::ConversationState>,
    /// <p>The token for the next message.</p>
    pub next_message_token: ::std::option::Option<::std::string::String>,
    /// <p>The conversation data stored on an Amazon Q in Connect Session.</p>
    pub conversation_session_data: ::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>>,
    /// <p>Indicates whether the chunked response has been terminated.</p>
    pub chunked_response_terminated: ::std::option::Option<bool>,
    _request_id: Option<String>,
}
impl GetNextMessageOutput {
    /// <p>The type of message response.</p>
    pub fn r#type(&self) -> &crate::types::MessageType {
        &self.r#type
    }
    /// <p>The message response to the requested message.</p>
    pub fn response(&self) -> ::std::option::Option<&crate::types::MessageOutput> {
        self.response.as_ref()
    }
    /// <p>The identifier of the submitted message.</p>
    pub fn request_message_id(&self) -> &str {
        use std::ops::Deref;
        self.request_message_id.deref()
    }
    /// <p>The state of current conversation.</p>
    pub fn conversation_state(&self) -> ::std::option::Option<&crate::types::ConversationState> {
        self.conversation_state.as_ref()
    }
    /// <p>The token for the next message.</p>
    pub fn next_message_token(&self) -> ::std::option::Option<&str> {
        self.next_message_token.as_deref()
    }
    /// <p>The conversation data stored on an Amazon Q in Connect Session.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.conversation_session_data.is_none()`.
    pub fn conversation_session_data(&self) -> &[crate::types::RuntimeSessionData] {
        self.conversation_session_data.as_deref().unwrap_or_default()
    }
    /// <p>Indicates whether the chunked response has been terminated.</p>
    pub fn chunked_response_terminated(&self) -> ::std::option::Option<bool> {
        self.chunked_response_terminated
    }
}
impl ::aws_types::request_id::RequestId for GetNextMessageOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetNextMessageOutput {
    /// Creates a new builder-style object to manufacture [`GetNextMessageOutput`](crate::operation::get_next_message::GetNextMessageOutput).
    pub fn builder() -> crate::operation::get_next_message::builders::GetNextMessageOutputBuilder {
        crate::operation::get_next_message::builders::GetNextMessageOutputBuilder::default()
    }
}

/// A builder for [`GetNextMessageOutput`](crate::operation::get_next_message::GetNextMessageOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetNextMessageOutputBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::MessageType>,
    pub(crate) response: ::std::option::Option<crate::types::MessageOutput>,
    pub(crate) request_message_id: ::std::option::Option<::std::string::String>,
    pub(crate) conversation_state: ::std::option::Option<crate::types::ConversationState>,
    pub(crate) next_message_token: ::std::option::Option<::std::string::String>,
    pub(crate) conversation_session_data: ::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>>,
    pub(crate) chunked_response_terminated: ::std::option::Option<bool>,
    _request_id: Option<String>,
}
impl GetNextMessageOutputBuilder {
    /// <p>The type of message response.</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 type of message response.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of message response.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::MessageType> {
        &self.r#type
    }
    /// <p>The message response to the requested message.</p>
    /// This field is required.
    pub fn response(mut self, input: crate::types::MessageOutput) -> Self {
        self.response = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message response to the requested message.</p>
    pub fn set_response(mut self, input: ::std::option::Option<crate::types::MessageOutput>) -> Self {
        self.response = input;
        self
    }
    /// <p>The message response to the requested message.</p>
    pub fn get_response(&self) -> &::std::option::Option<crate::types::MessageOutput> {
        &self.response
    }
    /// <p>The identifier of the submitted message.</p>
    /// This field is required.
    pub fn request_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.request_message_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the submitted message.</p>
    pub fn set_request_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.request_message_id = input;
        self
    }
    /// <p>The identifier of the submitted message.</p>
    pub fn get_request_message_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.request_message_id
    }
    /// <p>The state of current conversation.</p>
    /// This field is required.
    pub fn conversation_state(mut self, input: crate::types::ConversationState) -> Self {
        self.conversation_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of current conversation.</p>
    pub fn set_conversation_state(mut self, input: ::std::option::Option<crate::types::ConversationState>) -> Self {
        self.conversation_state = input;
        self
    }
    /// <p>The state of current conversation.</p>
    pub fn get_conversation_state(&self) -> &::std::option::Option<crate::types::ConversationState> {
        &self.conversation_state
    }
    /// <p>The token for the next message.</p>
    pub fn next_message_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_message_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The token for the next message.</p>
    pub fn set_next_message_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_message_token = input;
        self
    }
    /// <p>The token for the next message.</p>
    pub fn get_next_message_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_message_token
    }
    /// Appends an item to `conversation_session_data`.
    ///
    /// To override the contents of this collection use [`set_conversation_session_data`](Self::set_conversation_session_data).
    ///
    /// <p>The conversation data stored on an Amazon Q in Connect Session.</p>
    pub fn conversation_session_data(mut self, input: crate::types::RuntimeSessionData) -> Self {
        let mut v = self.conversation_session_data.unwrap_or_default();
        v.push(input);
        self.conversation_session_data = ::std::option::Option::Some(v);
        self
    }
    /// <p>The conversation data stored on an Amazon Q in Connect Session.</p>
    pub fn set_conversation_session_data(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>>) -> Self {
        self.conversation_session_data = input;
        self
    }
    /// <p>The conversation data stored on an Amazon Q in Connect Session.</p>
    pub fn get_conversation_session_data(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>> {
        &self.conversation_session_data
    }
    /// <p>Indicates whether the chunked response has been terminated.</p>
    pub fn chunked_response_terminated(mut self, input: bool) -> Self {
        self.chunked_response_terminated = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the chunked response has been terminated.</p>
    pub fn set_chunked_response_terminated(mut self, input: ::std::option::Option<bool>) -> Self {
        self.chunked_response_terminated = input;
        self
    }
    /// <p>Indicates whether the chunked response has been terminated.</p>
    pub fn get_chunked_response_terminated(&self) -> &::std::option::Option<bool> {
        &self.chunked_response_terminated
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetNextMessageOutput`](crate::operation::get_next_message::GetNextMessageOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`r#type`](crate::operation::get_next_message::builders::GetNextMessageOutputBuilder::type)
    /// - [`request_message_id`](crate::operation::get_next_message::builders::GetNextMessageOutputBuilder::request_message_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_next_message::GetNextMessageOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_next_message::GetNextMessageOutput {
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building GetNextMessageOutput",
                )
            })?,
            response: self.response,
            request_message_id: self.request_message_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "request_message_id",
                    "request_message_id was not specified but it is required when building GetNextMessageOutput",
                )
            })?,
            conversation_state: self.conversation_state,
            next_message_token: self.next_message_token,
            conversation_session_data: self.conversation_session_data,
            chunked_response_terminated: self.chunked_response_terminated,
            _request_id: self._request_id,
        })
    }
}