1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// 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",
)
})?,
})
}
}