aws_sdk_elementalinference/operation/update_dictionary/
_update_dictionary_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateDictionaryOutput {
6 pub name: ::std::string::String,
8 pub arn: ::std::string::String,
10 pub id: ::std::string::String,
12 pub language: crate::types::DictionaryLanguage,
14 pub status: crate::types::DictionaryStatus,
16 pub references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20 _request_id: Option<String>,
21}
22impl UpdateDictionaryOutput {
23 pub fn name(&self) -> &str {
25 use std::ops::Deref;
26 self.name.deref()
27 }
28 pub fn arn(&self) -> &str {
30 use std::ops::Deref;
31 self.arn.deref()
32 }
33 pub fn id(&self) -> &str {
35 use std::ops::Deref;
36 self.id.deref()
37 }
38 pub fn language(&self) -> &crate::types::DictionaryLanguage {
40 &self.language
41 }
42 pub fn status(&self) -> &crate::types::DictionaryStatus {
44 &self.status
45 }
46 pub fn references(&self) -> &[::std::string::String] {
50 self.references.as_deref().unwrap_or_default()
51 }
52 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 pub fn builder() -> crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder {
65 crate::operation::update_dictionary::builders::UpdateDictionaryOutputBuilder::default()
66 }
67}
68
69#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.name = input;
92 self
93 }
94 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
96 &self.name
97 }
98 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.arn = input;
107 self
108 }
109 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
111 &self.arn
112 }
113 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 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.id = input;
122 self
123 }
124 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
126 &self.id
127 }
128 pub fn language(mut self, input: crate::types::DictionaryLanguage) -> Self {
131 self.language = ::std::option::Option::Some(input);
132 self
133 }
134 pub fn set_language(mut self, input: ::std::option::Option<crate::types::DictionaryLanguage>) -> Self {
136 self.language = input;
137 self
138 }
139 pub fn get_language(&self) -> &::std::option::Option<crate::types::DictionaryLanguage> {
141 &self.language
142 }
143 pub fn status(mut self, input: crate::types::DictionaryStatus) -> Self {
146 self.status = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_status(mut self, input: ::std::option::Option<crate::types::DictionaryStatus>) -> Self {
151 self.status = input;
152 self
153 }
154 pub fn get_status(&self) -> &::std::option::Option<crate::types::DictionaryStatus> {
156 &self.status
157 }
158 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 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 pub fn get_references(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
176 &self.references
177 }
178 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 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 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 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}