1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct QuickResponseData {
7 pub quick_response_arn: ::std::string::String,
9 pub quick_response_id: ::std::string::String,
11 pub knowledge_base_arn: ::std::string::String,
13 pub knowledge_base_id: ::std::string::String,
15 pub name: ::std::string::String,
17 pub content_type: ::std::string::String,
25 pub status: crate::types::QuickResponseStatus,
27 pub created_time: ::aws_smithy_types::DateTime,
29 pub last_modified_time: ::aws_smithy_types::DateTime,
31 pub contents: ::std::option::Option<crate::types::QuickResponseContents>,
33 pub description: ::std::option::Option<::std::string::String>,
35 pub grouping_configuration: ::std::option::Option<crate::types::GroupingConfiguration>,
37 pub shortcut_key: ::std::option::Option<::std::string::String>,
39 pub last_modified_by: ::std::option::Option<::std::string::String>,
41 pub is_active: ::std::option::Option<bool>,
43 pub channels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
45 pub language: ::std::option::Option<::std::string::String>,
47 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
49}
50impl QuickResponseData {
51 pub fn quick_response_arn(&self) -> &str {
53 use std::ops::Deref;
54 self.quick_response_arn.deref()
55 }
56 pub fn quick_response_id(&self) -> &str {
58 use std::ops::Deref;
59 self.quick_response_id.deref()
60 }
61 pub fn knowledge_base_arn(&self) -> &str {
63 use std::ops::Deref;
64 self.knowledge_base_arn.deref()
65 }
66 pub fn knowledge_base_id(&self) -> &str {
68 use std::ops::Deref;
69 self.knowledge_base_id.deref()
70 }
71 pub fn name(&self) -> &str {
73 use std::ops::Deref;
74 self.name.deref()
75 }
76 pub fn content_type(&self) -> &str {
84 use std::ops::Deref;
85 self.content_type.deref()
86 }
87 pub fn status(&self) -> &crate::types::QuickResponseStatus {
89 &self.status
90 }
91 pub fn created_time(&self) -> &::aws_smithy_types::DateTime {
93 &self.created_time
94 }
95 pub fn last_modified_time(&self) -> &::aws_smithy_types::DateTime {
97 &self.last_modified_time
98 }
99 pub fn contents(&self) -> ::std::option::Option<&crate::types::QuickResponseContents> {
101 self.contents.as_ref()
102 }
103 pub fn description(&self) -> ::std::option::Option<&str> {
105 self.description.as_deref()
106 }
107 pub fn grouping_configuration(&self) -> ::std::option::Option<&crate::types::GroupingConfiguration> {
109 self.grouping_configuration.as_ref()
110 }
111 pub fn shortcut_key(&self) -> ::std::option::Option<&str> {
113 self.shortcut_key.as_deref()
114 }
115 pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
117 self.last_modified_by.as_deref()
118 }
119 pub fn is_active(&self) -> ::std::option::Option<bool> {
121 self.is_active
122 }
123 pub fn channels(&self) -> &[::std::string::String] {
127 self.channels.as_deref().unwrap_or_default()
128 }
129 pub fn language(&self) -> ::std::option::Option<&str> {
131 self.language.as_deref()
132 }
133 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
135 self.tags.as_ref()
136 }
137}
138impl QuickResponseData {
139 pub fn builder() -> crate::types::builders::QuickResponseDataBuilder {
141 crate::types::builders::QuickResponseDataBuilder::default()
142 }
143}
144
145#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
147#[non_exhaustive]
148pub struct QuickResponseDataBuilder {
149 pub(crate) quick_response_arn: ::std::option::Option<::std::string::String>,
150 pub(crate) quick_response_id: ::std::option::Option<::std::string::String>,
151 pub(crate) knowledge_base_arn: ::std::option::Option<::std::string::String>,
152 pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
153 pub(crate) name: ::std::option::Option<::std::string::String>,
154 pub(crate) content_type: ::std::option::Option<::std::string::String>,
155 pub(crate) status: ::std::option::Option<crate::types::QuickResponseStatus>,
156 pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
157 pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
158 pub(crate) contents: ::std::option::Option<crate::types::QuickResponseContents>,
159 pub(crate) description: ::std::option::Option<::std::string::String>,
160 pub(crate) grouping_configuration: ::std::option::Option<crate::types::GroupingConfiguration>,
161 pub(crate) shortcut_key: ::std::option::Option<::std::string::String>,
162 pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
163 pub(crate) is_active: ::std::option::Option<bool>,
164 pub(crate) channels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
165 pub(crate) language: ::std::option::Option<::std::string::String>,
166 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
167}
168impl QuickResponseDataBuilder {
169 pub fn quick_response_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.quick_response_arn = ::std::option::Option::Some(input.into());
173 self
174 }
175 pub fn set_quick_response_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.quick_response_arn = input;
178 self
179 }
180 pub fn get_quick_response_arn(&self) -> &::std::option::Option<::std::string::String> {
182 &self.quick_response_arn
183 }
184 pub fn quick_response_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.quick_response_id = ::std::option::Option::Some(input.into());
188 self
189 }
190 pub fn set_quick_response_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.quick_response_id = input;
193 self
194 }
195 pub fn get_quick_response_id(&self) -> &::std::option::Option<::std::string::String> {
197 &self.quick_response_id
198 }
199 pub fn knowledge_base_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.knowledge_base_arn = ::std::option::Option::Some(input.into());
203 self
204 }
205 pub fn set_knowledge_base_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.knowledge_base_arn = input;
208 self
209 }
210 pub fn get_knowledge_base_arn(&self) -> &::std::option::Option<::std::string::String> {
212 &self.knowledge_base_arn
213 }
214 pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217 self.knowledge_base_id = ::std::option::Option::Some(input.into());
218 self
219 }
220 pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222 self.knowledge_base_id = input;
223 self
224 }
225 pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
227 &self.knowledge_base_id
228 }
229 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232 self.name = ::std::option::Option::Some(input.into());
233 self
234 }
235 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237 self.name = input;
238 self
239 }
240 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
242 &self.name
243 }
244 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253 self.content_type = ::std::option::Option::Some(input.into());
254 self
255 }
256 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264 self.content_type = input;
265 self
266 }
267 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
275 &self.content_type
276 }
277 pub fn status(mut self, input: crate::types::QuickResponseStatus) -> Self {
280 self.status = ::std::option::Option::Some(input);
281 self
282 }
283 pub fn set_status(mut self, input: ::std::option::Option<crate::types::QuickResponseStatus>) -> Self {
285 self.status = input;
286 self
287 }
288 pub fn get_status(&self) -> &::std::option::Option<crate::types::QuickResponseStatus> {
290 &self.status
291 }
292 pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
295 self.created_time = ::std::option::Option::Some(input);
296 self
297 }
298 pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
300 self.created_time = input;
301 self
302 }
303 pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
305 &self.created_time
306 }
307 pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
310 self.last_modified_time = ::std::option::Option::Some(input);
311 self
312 }
313 pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
315 self.last_modified_time = input;
316 self
317 }
318 pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
320 &self.last_modified_time
321 }
322 pub fn contents(mut self, input: crate::types::QuickResponseContents) -> Self {
324 self.contents = ::std::option::Option::Some(input);
325 self
326 }
327 pub fn set_contents(mut self, input: ::std::option::Option<crate::types::QuickResponseContents>) -> Self {
329 self.contents = input;
330 self
331 }
332 pub fn get_contents(&self) -> &::std::option::Option<crate::types::QuickResponseContents> {
334 &self.contents
335 }
336 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
338 self.description = ::std::option::Option::Some(input.into());
339 self
340 }
341 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
343 self.description = input;
344 self
345 }
346 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
348 &self.description
349 }
350 pub fn grouping_configuration(mut self, input: crate::types::GroupingConfiguration) -> Self {
352 self.grouping_configuration = ::std::option::Option::Some(input);
353 self
354 }
355 pub fn set_grouping_configuration(mut self, input: ::std::option::Option<crate::types::GroupingConfiguration>) -> Self {
357 self.grouping_configuration = input;
358 self
359 }
360 pub fn get_grouping_configuration(&self) -> &::std::option::Option<crate::types::GroupingConfiguration> {
362 &self.grouping_configuration
363 }
364 pub fn shortcut_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
366 self.shortcut_key = ::std::option::Option::Some(input.into());
367 self
368 }
369 pub fn set_shortcut_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
371 self.shortcut_key = input;
372 self
373 }
374 pub fn get_shortcut_key(&self) -> &::std::option::Option<::std::string::String> {
376 &self.shortcut_key
377 }
378 pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
380 self.last_modified_by = ::std::option::Option::Some(input.into());
381 self
382 }
383 pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
385 self.last_modified_by = input;
386 self
387 }
388 pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
390 &self.last_modified_by
391 }
392 pub fn is_active(mut self, input: bool) -> Self {
394 self.is_active = ::std::option::Option::Some(input);
395 self
396 }
397 pub fn set_is_active(mut self, input: ::std::option::Option<bool>) -> Self {
399 self.is_active = input;
400 self
401 }
402 pub fn get_is_active(&self) -> &::std::option::Option<bool> {
404 &self.is_active
405 }
406 pub fn channels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
412 let mut v = self.channels.unwrap_or_default();
413 v.push(input.into());
414 self.channels = ::std::option::Option::Some(v);
415 self
416 }
417 pub fn set_channels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
419 self.channels = input;
420 self
421 }
422 pub fn get_channels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
424 &self.channels
425 }
426 pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
428 self.language = ::std::option::Option::Some(input.into());
429 self
430 }
431 pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
433 self.language = input;
434 self
435 }
436 pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
438 &self.language
439 }
440 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
446 let mut hash_map = self.tags.unwrap_or_default();
447 hash_map.insert(k.into(), v.into());
448 self.tags = ::std::option::Option::Some(hash_map);
449 self
450 }
451 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
453 self.tags = input;
454 self
455 }
456 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
458 &self.tags
459 }
460 pub fn build(self) -> ::std::result::Result<crate::types::QuickResponseData, ::aws_smithy_types::error::operation::BuildError> {
472 ::std::result::Result::Ok(crate::types::QuickResponseData {
473 quick_response_arn: self.quick_response_arn.ok_or_else(|| {
474 ::aws_smithy_types::error::operation::BuildError::missing_field(
475 "quick_response_arn",
476 "quick_response_arn was not specified but it is required when building QuickResponseData",
477 )
478 })?,
479 quick_response_id: self.quick_response_id.ok_or_else(|| {
480 ::aws_smithy_types::error::operation::BuildError::missing_field(
481 "quick_response_id",
482 "quick_response_id was not specified but it is required when building QuickResponseData",
483 )
484 })?,
485 knowledge_base_arn: self.knowledge_base_arn.ok_or_else(|| {
486 ::aws_smithy_types::error::operation::BuildError::missing_field(
487 "knowledge_base_arn",
488 "knowledge_base_arn was not specified but it is required when building QuickResponseData",
489 )
490 })?,
491 knowledge_base_id: self.knowledge_base_id.ok_or_else(|| {
492 ::aws_smithy_types::error::operation::BuildError::missing_field(
493 "knowledge_base_id",
494 "knowledge_base_id was not specified but it is required when building QuickResponseData",
495 )
496 })?,
497 name: self.name.ok_or_else(|| {
498 ::aws_smithy_types::error::operation::BuildError::missing_field(
499 "name",
500 "name was not specified but it is required when building QuickResponseData",
501 )
502 })?,
503 content_type: self.content_type.ok_or_else(|| {
504 ::aws_smithy_types::error::operation::BuildError::missing_field(
505 "content_type",
506 "content_type was not specified but it is required when building QuickResponseData",
507 )
508 })?,
509 status: self.status.ok_or_else(|| {
510 ::aws_smithy_types::error::operation::BuildError::missing_field(
511 "status",
512 "status was not specified but it is required when building QuickResponseData",
513 )
514 })?,
515 created_time: self.created_time.ok_or_else(|| {
516 ::aws_smithy_types::error::operation::BuildError::missing_field(
517 "created_time",
518 "created_time was not specified but it is required when building QuickResponseData",
519 )
520 })?,
521 last_modified_time: self.last_modified_time.ok_or_else(|| {
522 ::aws_smithy_types::error::operation::BuildError::missing_field(
523 "last_modified_time",
524 "last_modified_time was not specified but it is required when building QuickResponseData",
525 )
526 })?,
527 contents: self.contents,
528 description: self.description,
529 grouping_configuration: self.grouping_configuration,
530 shortcut_key: self.shortcut_key,
531 last_modified_by: self.last_modified_by,
532 is_active: self.is_active,
533 channels: self.channels,
534 language: self.language,
535 tags: self.tags,
536 })
537 }
538}