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
// 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)]
pub struct BatchDetectEntitiesInput {
/// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.</p>
pub text_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.</p>
pub language_code: ::std::option::Option<crate::types::LanguageCode>,
}
impl BatchDetectEntitiesInput {
/// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.</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 `.text_list.is_none()`.
pub fn text_list(&self) -> &[::std::string::String] {
self.text_list.as_deref().unwrap_or_default()
}
/// <p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.</p>
pub fn language_code(&self) -> ::std::option::Option<&crate::types::LanguageCode> {
self.language_code.as_ref()
}
}
impl ::std::fmt::Debug for BatchDetectEntitiesInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("BatchDetectEntitiesInput");
formatter.field("text_list", &"*** Sensitive Data Redacted ***");
formatter.field("language_code", &self.language_code);
formatter.finish()
}
}
impl BatchDetectEntitiesInput {
/// Creates a new builder-style object to manufacture [`BatchDetectEntitiesInput`](crate::operation::batch_detect_entities::BatchDetectEntitiesInput).
pub fn builder() -> crate::operation::batch_detect_entities::builders::BatchDetectEntitiesInputBuilder {
crate::operation::batch_detect_entities::builders::BatchDetectEntitiesInputBuilder::default()
}
}
/// A builder for [`BatchDetectEntitiesInput`](crate::operation::batch_detect_entities::BatchDetectEntitiesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct BatchDetectEntitiesInputBuilder {
pub(crate) text_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) language_code: ::std::option::Option<crate::types::LanguageCode>,
}
impl BatchDetectEntitiesInputBuilder {
/// Appends an item to `text_list`.
///
/// To override the contents of this collection use [`set_text_list`](Self::set_text_list).
///
/// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.</p>
pub fn text_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.text_list.unwrap_or_default();
v.push(input.into());
self.text_list = ::std::option::Option::Some(v);
self
}
/// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.</p>
pub fn set_text_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.text_list = input;
self
}
/// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.</p>
pub fn get_text_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.text_list
}
/// <p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.</p>
/// This field is required.
pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
self.language_code = ::std::option::Option::Some(input);
self
}
/// <p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.</p>
pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::LanguageCode>) -> Self {
self.language_code = input;
self
}
/// <p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.</p>
pub fn get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
&self.language_code
}
/// Consumes the builder and constructs a [`BatchDetectEntitiesInput`](crate::operation::batch_detect_entities::BatchDetectEntitiesInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::batch_detect_entities::BatchDetectEntitiesInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::batch_detect_entities::BatchDetectEntitiesInput {
text_list: self.text_list,
language_code: self.language_code,
})
}
}
impl ::std::fmt::Debug for BatchDetectEntitiesInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("BatchDetectEntitiesInputBuilder");
formatter.field("text_list", &"*** Sensitive Data Redacted ***");
formatter.field("language_code", &self.language_code);
formatter.finish()
}
}