Skip to main content

aws_sdk_elementalinference/operation/update_dictionary/
_update_dictionary_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateDictionaryOutput {
6    /// <p>The updated or original name of the dictionary.</p>
7    pub name: ::std::string::String,
8    /// <p>The ARN of the dictionary.</p>
9    pub arn: ::std::string::String,
10    /// <p>The ID of the dictionary.</p>
11    pub id: ::std::string::String,
12    /// <p>The updated or original language of the dictionary.</p>
13    pub language: crate::types::DictionaryLanguage,
14    /// <p>The current status of the dictionary.</p>
15    pub status: crate::types::DictionaryStatus,
16    /// <p>A list of feed IDs that reference this dictionary.</p>
17    pub references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18    /// <p>Any tags associated with the dictionary.</p>
19    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20    _request_id: Option<String>,
21}
22impl UpdateDictionaryOutput {
23    /// <p>The updated or original name of the dictionary.</p>
24    pub fn name(&self) -> &str {
25        use std::ops::Deref;
26        self.name.deref()
27    }
28    /// <p>The ARN of the dictionary.</p>
29    pub fn arn(&self) -> &str {
30        use std::ops::Deref;
31        self.arn.deref()
32    }
33    /// <p>The ID of the dictionary.</p>
34    pub fn id(&self) -> &str {
35        use std::ops::Deref;
36        self.id.deref()
37    }
38    /// <p>The updated or original language of the dictionary.</p>
39    pub fn language(&self) -> &crate::types::DictionaryLanguage {
40        &self.language
41    }
42    /// <p>The current status of the dictionary.</p>
43    pub fn status(&self) -> &crate::types::DictionaryStatus {
44        &self.status
45    }
46    /// <p>A list of feed IDs that reference this dictionary.</p>
47    ///
48    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.references.is_none()`.
49    pub fn references(&self) -> &[::std::string::String] {
50        self.references.as_deref().unwrap_or_default()
51    }
52    /// <p>Any tags associated with the dictionary.</p>
53    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54        self.tags.as_ref()
55    }
56}
57impl ::aws_types::request_id::RequestId for UpdateDictionaryOutput {
58    fn request_id(&self) -> Option<&str> {
59        self._request_id.as_deref()
60    }
61}
62impl UpdateDictionaryOutput {
63    /// Creates a new builder-style object to manufacture [`UpdateDictionaryOutput`](crate::operation::update_dictionary::UpdateDictionaryOutput).
64    pub fn builder() -> crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder {
65        crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::default()
66    }
67}
68
69/// A builder for [`UpdateDictionaryOutput`](crate::operation::update_dictionary::UpdateDictionaryOutput).
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
71#[non_exhaustive]
72pub struct UpdateDictionaryOutputBuilder {
73    pub(crate) name: ::std::option::Option<::std::string::String>,
74    pub(crate) arn: ::std::option::Option<::std::string::String>,
75    pub(crate) id: ::std::option::Option<::std::string::String>,
76    pub(crate) language: ::std::option::Option<crate::types::DictionaryLanguage>,
77    pub(crate) status: ::std::option::Option<crate::types::DictionaryStatus>,
78    pub(crate) references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
79    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
80    _request_id: Option<String>,
81}
82impl UpdateDictionaryOutputBuilder {
83    /// <p>The updated or original name of the dictionary.</p>
84    /// This field is required.
85    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.name = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The updated or original name of the dictionary.</p>
90    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.name = input;
92        self
93    }
94    /// <p>The updated or original name of the dictionary.</p>
95    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
96        &self.name
97    }
98    /// <p>The ARN of the dictionary.</p>
99    /// This field is required.
100    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.arn = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The ARN of the dictionary.</p>
105    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.arn = input;
107        self
108    }
109    /// <p>The ARN of the dictionary.</p>
110    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
111        &self.arn
112    }
113    /// <p>The ID of the dictionary.</p>
114    /// This field is required.
115    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.id = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The ID of the dictionary.</p>
120    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.id = input;
122        self
123    }
124    /// <p>The ID of the dictionary.</p>
125    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
126        &self.id
127    }
128    /// <p>The updated or original language of the dictionary.</p>
129    /// This field is required.
130    pub fn language(mut self, input: crate::types::DictionaryLanguage) -> Self {
131        self.language = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p>The updated or original language of the dictionary.</p>
135    pub fn set_language(mut self, input: ::std::option::Option<crate::types::DictionaryLanguage>) -> Self {
136        self.language = input;
137        self
138    }
139    /// <p>The updated or original language of the dictionary.</p>
140    pub fn get_language(&self) -> &::std::option::Option<crate::types::DictionaryLanguage> {
141        &self.language
142    }
143    /// <p>The current status of the dictionary.</p>
144    /// This field is required.
145    pub fn status(mut self, input: crate::types::DictionaryStatus) -> Self {
146        self.status = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>The current status of the dictionary.</p>
150    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DictionaryStatus>) -> Self {
151        self.status = input;
152        self
153    }
154    /// <p>The current status of the dictionary.</p>
155    pub fn get_status(&self) -> &::std::option::Option<crate::types::DictionaryStatus> {
156        &self.status
157    }
158    /// Appends an item to `references`.
159    ///
160    /// To override the contents of this collection use [`set_references`](Self::set_references).
161    ///
162    /// <p>A list of feed IDs that reference this dictionary.</p>
163    pub fn references(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        let mut v = self.references.unwrap_or_default();
165        v.push(input.into());
166        self.references = ::std::option::Option::Some(v);
167        self
168    }
169    /// <p>A list of feed IDs that reference this dictionary.</p>
170    pub fn set_references(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
171        self.references = input;
172        self
173    }
174    /// <p>A list of feed IDs that reference this dictionary.</p>
175    pub fn get_references(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
176        &self.references
177    }
178    /// Adds a key-value pair to `tags`.
179    ///
180    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
181    ///
182    /// <p>Any tags associated with the dictionary.</p>
183    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
184        let mut hash_map = self.tags.unwrap_or_default();
185        hash_map.insert(k.into(), v.into());
186        self.tags = ::std::option::Option::Some(hash_map);
187        self
188    }
189    /// <p>Any tags associated with the dictionary.</p>
190    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
191        self.tags = input;
192        self
193    }
194    /// <p>Any tags associated with the dictionary.</p>
195    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
196        &self.tags
197    }
198    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
199        self._request_id = Some(request_id.into());
200        self
201    }
202
203    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
204        self._request_id = request_id;
205        self
206    }
207    /// Consumes the builder and constructs a [`UpdateDictionaryOutput`](crate::operation::update_dictionary::UpdateDictionaryOutput).
208    /// This method will fail if any of the following fields are not set:
209    /// - [`name`](crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::name)
210    /// - [`arn`](crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::arn)
211    /// - [`id`](crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::id)
212    /// - [`language`](crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::language)
213    /// - [`status`](crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::status)
214    pub fn build(
215        self,
216    ) -> ::std::result::Result<crate::operation::update_dictionary::UpdateDictionaryOutput, ::aws_smithy_types::error::operation::BuildError> {
217        ::std::result::Result::Ok(crate::operation::update_dictionary::UpdateDictionaryOutput {
218            name: self.name.ok_or_else(|| {
219                ::aws_smithy_types::error::operation::BuildError::missing_field(
220                    "name",
221                    "name was not specified but it is required when building UpdateDictionaryOutput",
222                )
223            })?,
224            arn: self.arn.ok_or_else(|| {
225                ::aws_smithy_types::error::operation::BuildError::missing_field(
226                    "arn",
227                    "arn was not specified but it is required when building UpdateDictionaryOutput",
228                )
229            })?,
230            id: self.id.ok_or_else(|| {
231                ::aws_smithy_types::error::operation::BuildError::missing_field(
232                    "id",
233                    "id was not specified but it is required when building UpdateDictionaryOutput",
234                )
235            })?,
236            language: self.language.ok_or_else(|| {
237                ::aws_smithy_types::error::operation::BuildError::missing_field(
238                    "language",
239                    "language was not specified but it is required when building UpdateDictionaryOutput",
240                )
241            })?,
242            status: self.status.ok_or_else(|| {
243                ::aws_smithy_types::error::operation::BuildError::missing_field(
244                    "status",
245                    "status was not specified but it is required when building UpdateDictionaryOutput",
246                )
247            })?,
248            references: self.references,
249            tags: self.tags,
250            _request_id: self._request_id,
251        })
252    }
253}