aws-sdk-lexruntimev2 1.93.0

AWS SDK for Amazon Lex Runtime V2
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::fmt::Debug)]
pub struct StartConversationInput {
    /// <p>The identifier of the bot to process the request.</p>
    pub bot_id: ::std::option::Option<::std::string::String>,
    /// <p>The alias identifier in use for the bot that processes the request.</p>
    pub bot_alias_id: ::std::option::Option<::std::string::String>,
    /// <p>The locale where the session is in use.</p>
    pub locale_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the user session that is having the conversation.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>The conversation type that you are using the Amazon Lex V2. If the conversation mode is <code>AUDIO</code> you can send both audio and DTMF information. If the mode is <code>TEXT</code> you can only send text.</p>
    pub conversation_mode: ::std::option::Option<crate::types::ConversationMode>,
    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
    pub request_event_stream: ::aws_smithy_http::event_stream::EventStreamSender<
        crate::types::StartConversationRequestEventStream,
        crate::types::error::StartConversationRequestEventStreamError,
    >,
}
impl StartConversationInput {
    /// <p>The identifier of the bot to process the request.</p>
    pub fn bot_id(&self) -> ::std::option::Option<&str> {
        self.bot_id.as_deref()
    }
    /// <p>The alias identifier in use for the bot that processes the request.</p>
    pub fn bot_alias_id(&self) -> ::std::option::Option<&str> {
        self.bot_alias_id.as_deref()
    }
    /// <p>The locale where the session is in use.</p>
    pub fn locale_id(&self) -> ::std::option::Option<&str> {
        self.locale_id.as_deref()
    }
    /// <p>The identifier of the user session that is having the conversation.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>The conversation type that you are using the Amazon Lex V2. If the conversation mode is <code>AUDIO</code> you can send both audio and DTMF information. If the mode is <code>TEXT</code> you can only send text.</p>
    pub fn conversation_mode(&self) -> ::std::option::Option<&crate::types::ConversationMode> {
        self.conversation_mode.as_ref()
    }
    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
    pub fn request_event_stream(
        &self,
    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
        crate::types::StartConversationRequestEventStream,
        crate::types::error::StartConversationRequestEventStreamError,
    > {
        &self.request_event_stream
    }
}
impl StartConversationInput {
    /// Creates a new builder-style object to manufacture [`StartConversationInput`](crate::operation::start_conversation::StartConversationInput).
    pub fn builder() -> crate::operation::start_conversation::builders::StartConversationInputBuilder {
        crate::operation::start_conversation::builders::StartConversationInputBuilder::default()
    }
}

/// A builder for [`StartConversationInput`](crate::operation::start_conversation::StartConversationInput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartConversationInputBuilder {
    pub(crate) bot_id: ::std::option::Option<::std::string::String>,
    pub(crate) bot_alias_id: ::std::option::Option<::std::string::String>,
    pub(crate) locale_id: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) conversation_mode: ::std::option::Option<crate::types::ConversationMode>,
    pub(crate) request_event_stream: ::std::option::Option<
        ::aws_smithy_http::event_stream::EventStreamSender<
            crate::types::StartConversationRequestEventStream,
            crate::types::error::StartConversationRequestEventStreamError,
        >,
    >,
}
impl StartConversationInputBuilder {
    /// <p>The identifier of the bot to process the request.</p>
    /// This field is required.
    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bot_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the bot to process the request.</p>
    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bot_id = input;
        self
    }
    /// <p>The identifier of the bot to process the request.</p>
    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.bot_id
    }
    /// <p>The alias identifier in use for the bot that processes the request.</p>
    /// This field is required.
    pub fn bot_alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bot_alias_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The alias identifier in use for the bot that processes the request.</p>
    pub fn set_bot_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bot_alias_id = input;
        self
    }
    /// <p>The alias identifier in use for the bot that processes the request.</p>
    pub fn get_bot_alias_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.bot_alias_id
    }
    /// <p>The locale where the session is in use.</p>
    /// This field is required.
    pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.locale_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The locale where the session is in use.</p>
    pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.locale_id = input;
        self
    }
    /// <p>The locale where the session is in use.</p>
    pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.locale_id
    }
    /// <p>The identifier of the user session that is having the conversation.</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 user session that is having the conversation.</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 user session that is having the conversation.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The conversation type that you are using the Amazon Lex V2. If the conversation mode is <code>AUDIO</code> you can send both audio and DTMF information. If the mode is <code>TEXT</code> you can only send text.</p>
    pub fn conversation_mode(mut self, input: crate::types::ConversationMode) -> Self {
        self.conversation_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The conversation type that you are using the Amazon Lex V2. If the conversation mode is <code>AUDIO</code> you can send both audio and DTMF information. If the mode is <code>TEXT</code> you can only send text.</p>
    pub fn set_conversation_mode(mut self, input: ::std::option::Option<crate::types::ConversationMode>) -> Self {
        self.conversation_mode = input;
        self
    }
    /// <p>The conversation type that you are using the Amazon Lex V2. If the conversation mode is <code>AUDIO</code> you can send both audio and DTMF information. If the mode is <code>TEXT</code> you can only send text.</p>
    pub fn get_conversation_mode(&self) -> &::std::option::Option<crate::types::ConversationMode> {
        &self.conversation_mode
    }
    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
    /// This field is required.
    pub fn request_event_stream(
        mut self,
        input: ::aws_smithy_http::event_stream::EventStreamSender<
            crate::types::StartConversationRequestEventStream,
            crate::types::error::StartConversationRequestEventStreamError,
        >,
    ) -> Self {
        self.request_event_stream = ::std::option::Option::Some(input);
        self
    }
    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
    pub fn set_request_event_stream(
        mut self,
        input: ::std::option::Option<
            ::aws_smithy_http::event_stream::EventStreamSender<
                crate::types::StartConversationRequestEventStream,
                crate::types::error::StartConversationRequestEventStreamError,
            >,
        >,
    ) -> Self {
        self.request_event_stream = input;
        self
    }
    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
    pub fn get_request_event_stream(
        &self,
    ) -> &::std::option::Option<
        ::aws_smithy_http::event_stream::EventStreamSender<
            crate::types::StartConversationRequestEventStream,
            crate::types::error::StartConversationRequestEventStreamError,
        >,
    > {
        &self.request_event_stream
    }
    /// Consumes the builder and constructs a [`StartConversationInput`](crate::operation::start_conversation::StartConversationInput).
    /// This method will fail if any of the following fields are not set:
    /// - [`request_event_stream`](crate::operation::start_conversation::builders::StartConversationInputBuilder::request_event_stream)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_conversation::StartConversationInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_conversation::StartConversationInput {
            bot_id: self.bot_id,
            bot_alias_id: self.bot_alias_id,
            locale_id: self.locale_id,
            session_id: self.session_id,
            conversation_mode: self.conversation_mode,
            request_event_stream: self.request_event_stream.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "request_event_stream",
                    "request_event_stream was not specified but it is required when building StartConversationInput",
                )
            })?,
        })
    }
}