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
// 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 BatchDetectSentimentOutput {
/// <p>A list of objects containing the results of the operation. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If all of the documents contain an error, the <code>ResultList</code> is empty.</p>
pub result_list: ::std::vec::Vec<crate::types::BatchDetectSentimentItemResult>,
/// <p>A list containing one object for each document that contained an error. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If there are no errors in the batch, the <code>ErrorList</code> is empty.</p>
pub error_list: ::std::vec::Vec<crate::types::BatchItemError>,
_request_id: Option<String>,
}
impl BatchDetectSentimentOutput {
/// <p>A list of objects containing the results of the operation. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If all of the documents contain an error, the <code>ResultList</code> is empty.</p>
pub fn result_list(&self) -> &[crate::types::BatchDetectSentimentItemResult] {
use std::ops::Deref;
self.result_list.deref()
}
/// <p>A list containing one object for each document that contained an error. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If there are no errors in the batch, the <code>ErrorList</code> is empty.</p>
pub fn error_list(&self) -> &[crate::types::BatchItemError] {
use std::ops::Deref;
self.error_list.deref()
}
}
impl ::std::fmt::Debug for BatchDetectSentimentOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("BatchDetectSentimentOutput");
formatter.field("result_list", &"*** Sensitive Data Redacted ***");
formatter.field("error_list", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for BatchDetectSentimentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl BatchDetectSentimentOutput {
/// Creates a new builder-style object to manufacture [`BatchDetectSentimentOutput`](crate::operation::batch_detect_sentiment::BatchDetectSentimentOutput).
pub fn builder() -> crate::operation::batch_detect_sentiment::builders::BatchDetectSentimentOutputBuilder {
crate::operation::batch_detect_sentiment::builders::BatchDetectSentimentOutputBuilder::default()
}
}
/// A builder for [`BatchDetectSentimentOutput`](crate::operation::batch_detect_sentiment::BatchDetectSentimentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct BatchDetectSentimentOutputBuilder {
pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::BatchDetectSentimentItemResult>>,
pub(crate) error_list: ::std::option::Option<::std::vec::Vec<crate::types::BatchItemError>>,
_request_id: Option<String>,
}
impl BatchDetectSentimentOutputBuilder {
/// Appends an item to `result_list`.
///
/// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
///
/// <p>A list of objects containing the results of the operation. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If all of the documents contain an error, the <code>ResultList</code> is empty.</p>
pub fn result_list(mut self, input: crate::types::BatchDetectSentimentItemResult) -> Self {
let mut v = self.result_list.unwrap_or_default();
v.push(input);
self.result_list = ::std::option::Option::Some(v);
self
}
/// <p>A list of objects containing the results of the operation. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If all of the documents contain an error, the <code>ResultList</code> is empty.</p>
pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchDetectSentimentItemResult>>) -> Self {
self.result_list = input;
self
}
/// <p>A list of objects containing the results of the operation. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If all of the documents contain an error, the <code>ResultList</code> is empty.</p>
pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchDetectSentimentItemResult>> {
&self.result_list
}
/// Appends an item to `error_list`.
///
/// To override the contents of this collection use [`set_error_list`](Self::set_error_list).
///
/// <p>A list containing one object for each document that contained an error. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If there are no errors in the batch, the <code>ErrorList</code> is empty.</p>
pub fn error_list(mut self, input: crate::types::BatchItemError) -> Self {
let mut v = self.error_list.unwrap_or_default();
v.push(input);
self.error_list = ::std::option::Option::Some(v);
self
}
/// <p>A list containing one object for each document that contained an error. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If there are no errors in the batch, the <code>ErrorList</code> is empty.</p>
pub fn set_error_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchItemError>>) -> Self {
self.error_list = input;
self
}
/// <p>A list containing one object for each document that contained an error. The results are sorted in ascending order by the <code>Index</code> field and match the order of the documents in the input list. If there are no errors in the batch, the <code>ErrorList</code> is empty.</p>
pub fn get_error_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchItemError>> {
&self.error_list
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`BatchDetectSentimentOutput`](crate::operation::batch_detect_sentiment::BatchDetectSentimentOutput).
/// This method will fail if any of the following fields are not set:
/// - [`result_list`](crate::operation::batch_detect_sentiment::builders::BatchDetectSentimentOutputBuilder::result_list)
/// - [`error_list`](crate::operation::batch_detect_sentiment::builders::BatchDetectSentimentOutputBuilder::error_list)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::batch_detect_sentiment::BatchDetectSentimentOutput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::batch_detect_sentiment::BatchDetectSentimentOutput {
result_list: self.result_list.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"result_list",
"result_list was not specified but it is required when building BatchDetectSentimentOutput",
)
})?,
error_list: self.error_list.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"error_list",
"error_list was not specified but it is required when building BatchDetectSentimentOutput",
)
})?,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for BatchDetectSentimentOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("BatchDetectSentimentOutputBuilder");
formatter.field("result_list", &"*** Sensitive Data Redacted ***");
formatter.field("error_list", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}