aws_sdk_cloudsearchdomain/operation/upload_documents/
_upload_documents_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the response to an <code>UploadDocuments</code> request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UploadDocumentsOutput {
7    /// <p>The status of an <code>UploadDocumentsRequest</code>.</p>
8    pub status: ::std::option::Option<::std::string::String>,
9    /// <p>The number of documents that were added to the search domain.</p>
10    pub adds: i64,
11    /// <p>The number of documents that were deleted from the search domain.</p>
12    pub deletes: i64,
13    /// <p>Any warnings returned by the document service about the documents being uploaded.</p>
14    pub warnings: ::std::option::Option<::std::vec::Vec<crate::types::DocumentServiceWarning>>,
15    _request_id: Option<String>,
16}
17impl UploadDocumentsOutput {
18    /// <p>The status of an <code>UploadDocumentsRequest</code>.</p>
19    pub fn status(&self) -> ::std::option::Option<&str> {
20        self.status.as_deref()
21    }
22    /// <p>The number of documents that were added to the search domain.</p>
23    pub fn adds(&self) -> i64 {
24        self.adds
25    }
26    /// <p>The number of documents that were deleted from the search domain.</p>
27    pub fn deletes(&self) -> i64 {
28        self.deletes
29    }
30    /// <p>Any warnings returned by the document service about the documents being uploaded.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.warnings.is_none()`.
33    pub fn warnings(&self) -> &[crate::types::DocumentServiceWarning] {
34        self.warnings.as_deref().unwrap_or_default()
35    }
36}
37impl ::aws_types::request_id::RequestId for UploadDocumentsOutput {
38    fn request_id(&self) -> Option<&str> {
39        self._request_id.as_deref()
40    }
41}
42impl UploadDocumentsOutput {
43    /// Creates a new builder-style object to manufacture [`UploadDocumentsOutput`](crate::operation::upload_documents::UploadDocumentsOutput).
44    pub fn builder() -> crate::operation::upload_documents::builders::UploadDocumentsOutputBuilder {
45        crate::operation::upload_documents::builders::UploadDocumentsOutputBuilder::default()
46    }
47}
48
49/// A builder for [`UploadDocumentsOutput`](crate::operation::upload_documents::UploadDocumentsOutput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct UploadDocumentsOutputBuilder {
53    pub(crate) status: ::std::option::Option<::std::string::String>,
54    pub(crate) adds: ::std::option::Option<i64>,
55    pub(crate) deletes: ::std::option::Option<i64>,
56    pub(crate) warnings: ::std::option::Option<::std::vec::Vec<crate::types::DocumentServiceWarning>>,
57    _request_id: Option<String>,
58}
59impl UploadDocumentsOutputBuilder {
60    /// <p>The status of an <code>UploadDocumentsRequest</code>.</p>
61    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.status = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The status of an <code>UploadDocumentsRequest</code>.</p>
66    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.status = input;
68        self
69    }
70    /// <p>The status of an <code>UploadDocumentsRequest</code>.</p>
71    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
72        &self.status
73    }
74    /// <p>The number of documents that were added to the search domain.</p>
75    pub fn adds(mut self, input: i64) -> Self {
76        self.adds = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The number of documents that were added to the search domain.</p>
80    pub fn set_adds(mut self, input: ::std::option::Option<i64>) -> Self {
81        self.adds = input;
82        self
83    }
84    /// <p>The number of documents that were added to the search domain.</p>
85    pub fn get_adds(&self) -> &::std::option::Option<i64> {
86        &self.adds
87    }
88    /// <p>The number of documents that were deleted from the search domain.</p>
89    pub fn deletes(mut self, input: i64) -> Self {
90        self.deletes = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The number of documents that were deleted from the search domain.</p>
94    pub fn set_deletes(mut self, input: ::std::option::Option<i64>) -> Self {
95        self.deletes = input;
96        self
97    }
98    /// <p>The number of documents that were deleted from the search domain.</p>
99    pub fn get_deletes(&self) -> &::std::option::Option<i64> {
100        &self.deletes
101    }
102    /// Appends an item to `warnings`.
103    ///
104    /// To override the contents of this collection use [`set_warnings`](Self::set_warnings).
105    ///
106    /// <p>Any warnings returned by the document service about the documents being uploaded.</p>
107    pub fn warnings(mut self, input: crate::types::DocumentServiceWarning) -> Self {
108        let mut v = self.warnings.unwrap_or_default();
109        v.push(input);
110        self.warnings = ::std::option::Option::Some(v);
111        self
112    }
113    /// <p>Any warnings returned by the document service about the documents being uploaded.</p>
114    pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentServiceWarning>>) -> Self {
115        self.warnings = input;
116        self
117    }
118    /// <p>Any warnings returned by the document service about the documents being uploaded.</p>
119    pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentServiceWarning>> {
120        &self.warnings
121    }
122    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
123        self._request_id = Some(request_id.into());
124        self
125    }
126
127    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
128        self._request_id = request_id;
129        self
130    }
131    /// Consumes the builder and constructs a [`UploadDocumentsOutput`](crate::operation::upload_documents::UploadDocumentsOutput).
132    pub fn build(self) -> crate::operation::upload_documents::UploadDocumentsOutput {
133        crate::operation::upload_documents::UploadDocumentsOutput {
134            status: self.status,
135            adds: self.adds.unwrap_or_default(),
136            deletes: self.deletes.unwrap_or_default(),
137            warnings: self.warnings,
138            _request_id: self._request_id,
139        }
140    }
141}