aws_sdk_lexruntimev2/operation/start_conversation/
_start_conversation_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct StartConversationInput {
6    /// <p>The identifier of the bot to process the request.</p>
7    pub bot_id: ::std::option::Option<::std::string::String>,
8    /// <p>The alias identifier in use for the bot that processes the request.</p>
9    pub bot_alias_id: ::std::option::Option<::std::string::String>,
10    /// <p>The locale where the session is in use.</p>
11    pub locale_id: ::std::option::Option<::std::string::String>,
12    /// <p>The identifier of the user session that is having the conversation.</p>
13    pub session_id: ::std::option::Option<::std::string::String>,
14    /// <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>
15    pub conversation_mode: ::std::option::Option<crate::types::ConversationMode>,
16    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
17    pub request_event_stream: ::aws_smithy_http::event_stream::EventStreamSender<
18        crate::types::StartConversationRequestEventStream,
19        crate::types::error::StartConversationRequestEventStreamError,
20    >,
21}
22impl StartConversationInput {
23    /// <p>The identifier of the bot to process the request.</p>
24    pub fn bot_id(&self) -> ::std::option::Option<&str> {
25        self.bot_id.as_deref()
26    }
27    /// <p>The alias identifier in use for the bot that processes the request.</p>
28    pub fn bot_alias_id(&self) -> ::std::option::Option<&str> {
29        self.bot_alias_id.as_deref()
30    }
31    /// <p>The locale where the session is in use.</p>
32    pub fn locale_id(&self) -> ::std::option::Option<&str> {
33        self.locale_id.as_deref()
34    }
35    /// <p>The identifier of the user session that is having the conversation.</p>
36    pub fn session_id(&self) -> ::std::option::Option<&str> {
37        self.session_id.as_deref()
38    }
39    /// <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>
40    pub fn conversation_mode(&self) -> ::std::option::Option<&crate::types::ConversationMode> {
41        self.conversation_mode.as_ref()
42    }
43    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
44    pub fn request_event_stream(
45        &self,
46    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
47        crate::types::StartConversationRequestEventStream,
48        crate::types::error::StartConversationRequestEventStreamError,
49    > {
50        &self.request_event_stream
51    }
52}
53impl StartConversationInput {
54    /// Creates a new builder-style object to manufacture [`StartConversationInput`](crate::operation::start_conversation::StartConversationInput).
55    pub fn builder() -> crate::operation::start_conversation::builders::StartConversationInputBuilder {
56        crate::operation::start_conversation::builders::StartConversationInputBuilder::default()
57    }
58}
59
60/// A builder for [`StartConversationInput`](crate::operation::start_conversation::StartConversationInput).
61#[derive(::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct StartConversationInputBuilder {
64    pub(crate) bot_id: ::std::option::Option<::std::string::String>,
65    pub(crate) bot_alias_id: ::std::option::Option<::std::string::String>,
66    pub(crate) locale_id: ::std::option::Option<::std::string::String>,
67    pub(crate) session_id: ::std::option::Option<::std::string::String>,
68    pub(crate) conversation_mode: ::std::option::Option<crate::types::ConversationMode>,
69    pub(crate) request_event_stream: ::std::option::Option<
70        ::aws_smithy_http::event_stream::EventStreamSender<
71            crate::types::StartConversationRequestEventStream,
72            crate::types::error::StartConversationRequestEventStreamError,
73        >,
74    >,
75}
76impl StartConversationInputBuilder {
77    /// <p>The identifier of the bot to process the request.</p>
78    /// This field is required.
79    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.bot_id = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>The identifier of the bot to process the request.</p>
84    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.bot_id = input;
86        self
87    }
88    /// <p>The identifier of the bot to process the request.</p>
89    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
90        &self.bot_id
91    }
92    /// <p>The alias identifier in use for the bot that processes the request.</p>
93    /// This field is required.
94    pub fn bot_alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.bot_alias_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The alias identifier in use for the bot that processes the request.</p>
99    pub fn set_bot_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.bot_alias_id = input;
101        self
102    }
103    /// <p>The alias identifier in use for the bot that processes the request.</p>
104    pub fn get_bot_alias_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.bot_alias_id
106    }
107    /// <p>The locale where the session is in use.</p>
108    /// This field is required.
109    pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.locale_id = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The locale where the session is in use.</p>
114    pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.locale_id = input;
116        self
117    }
118    /// <p>The locale where the session is in use.</p>
119    pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
120        &self.locale_id
121    }
122    /// <p>The identifier of the user session that is having the conversation.</p>
123    /// This field is required.
124    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.session_id = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The identifier of the user session that is having the conversation.</p>
129    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.session_id = input;
131        self
132    }
133    /// <p>The identifier of the user session that is having the conversation.</p>
134    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
135        &self.session_id
136    }
137    /// <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>
138    pub fn conversation_mode(mut self, input: crate::types::ConversationMode) -> Self {
139        self.conversation_mode = ::std::option::Option::Some(input);
140        self
141    }
142    /// <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>
143    pub fn set_conversation_mode(mut self, input: ::std::option::Option<crate::types::ConversationMode>) -> Self {
144        self.conversation_mode = input;
145        self
146    }
147    /// <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>
148    pub fn get_conversation_mode(&self) -> &::std::option::Option<crate::types::ConversationMode> {
149        &self.conversation_mode
150    }
151    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
152    /// This field is required.
153    pub fn request_event_stream(
154        mut self,
155        input: ::aws_smithy_http::event_stream::EventStreamSender<
156            crate::types::StartConversationRequestEventStream,
157            crate::types::error::StartConversationRequestEventStreamError,
158        >,
159    ) -> Self {
160        self.request_event_stream = ::std::option::Option::Some(input);
161        self
162    }
163    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
164    pub fn set_request_event_stream(
165        mut self,
166        input: ::std::option::Option<
167            ::aws_smithy_http::event_stream::EventStreamSender<
168                crate::types::StartConversationRequestEventStream,
169                crate::types::error::StartConversationRequestEventStreamError,
170            >,
171        >,
172    ) -> Self {
173        self.request_event_stream = input;
174        self
175    }
176    /// <p>Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.</p>
177    pub fn get_request_event_stream(
178        &self,
179    ) -> &::std::option::Option<
180        ::aws_smithy_http::event_stream::EventStreamSender<
181            crate::types::StartConversationRequestEventStream,
182            crate::types::error::StartConversationRequestEventStreamError,
183        >,
184    > {
185        &self.request_event_stream
186    }
187    /// Consumes the builder and constructs a [`StartConversationInput`](crate::operation::start_conversation::StartConversationInput).
188    /// This method will fail if any of the following fields are not set:
189    /// - [`request_event_stream`](crate::operation::start_conversation::builders::StartConversationInputBuilder::request_event_stream)
190    pub fn build(
191        self,
192    ) -> ::std::result::Result<crate::operation::start_conversation::StartConversationInput, ::aws_smithy_types::error::operation::BuildError> {
193        ::std::result::Result::Ok(crate::operation::start_conversation::StartConversationInput {
194            bot_id: self.bot_id,
195            bot_alias_id: self.bot_alias_id,
196            locale_id: self.locale_id,
197            session_id: self.session_id,
198            conversation_mode: self.conversation_mode,
199            request_event_stream: self.request_event_stream.ok_or_else(|| {
200                ::aws_smithy_types::error::operation::BuildError::missing_field(
201                    "request_event_stream",
202                    "request_event_stream was not specified but it is required when building StartConversationInput",
203                )
204            })?,
205        })
206    }
207}