aws_sdk_glue/operation/get_asset/
_get_asset_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetAssetOutput {
7 pub id: ::std::string::String,
9 pub name: ::std::option::Option<::std::string::String>,
11 pub description: ::std::option::Option<::std::string::String>,
13 pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
15 pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
17 pub asset_type_id: ::std::string::String,
19 pub glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21 pub forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
23 pub attachments: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
25 pub iterable_forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
27 _request_id: Option<String>,
28}
29impl GetAssetOutput {
30 pub fn id(&self) -> &str {
32 use std::ops::Deref;
33 self.id.deref()
34 }
35 pub fn name(&self) -> ::std::option::Option<&str> {
37 self.name.as_deref()
38 }
39 pub fn description(&self) -> ::std::option::Option<&str> {
41 self.description.as_deref()
42 }
43 pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
45 self.created_at.as_ref()
46 }
47 pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49 self.updated_at.as_ref()
50 }
51 pub fn asset_type_id(&self) -> &str {
53 use std::ops::Deref;
54 self.asset_type_id.deref()
55 }
56 pub fn glossary_terms(&self) -> &[::std::string::String] {
60 self.glossary_terms.as_deref().unwrap_or_default()
61 }
62 pub fn forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
64 self.forms.as_ref()
65 }
66 pub fn attachments(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
68 self.attachments.as_ref()
69 }
70 pub fn iterable_forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>> {
72 self.iterable_forms.as_ref()
73 }
74}
75impl ::aws_types::request_id::RequestId for GetAssetOutput {
76 fn request_id(&self) -> Option<&str> {
77 self._request_id.as_deref()
78 }
79}
80impl GetAssetOutput {
81 pub fn builder() -> crate::operation::get_asset::builders::GetAssetOutputBuilder {
83 crate::operation::get_asset::builders::GetAssetOutputBuilder::default()
84 }
85}
86
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
89#[non_exhaustive]
90pub struct GetAssetOutputBuilder {
91 pub(crate) id: ::std::option::Option<::std::string::String>,
92 pub(crate) name: ::std::option::Option<::std::string::String>,
93 pub(crate) description: ::std::option::Option<::std::string::String>,
94 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
95 pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
96 pub(crate) asset_type_id: ::std::option::Option<::std::string::String>,
97 pub(crate) glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
98 pub(crate) forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
99 pub(crate) attachments: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
100 pub(crate) iterable_forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
101 _request_id: Option<String>,
102}
103impl GetAssetOutputBuilder {
104 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 self.id = ::std::option::Option::Some(input.into());
108 self
109 }
110 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112 self.id = input;
113 self
114 }
115 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
117 &self.id
118 }
119 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.name = ::std::option::Option::Some(input.into());
122 self
123 }
124 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.name = input;
127 self
128 }
129 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
131 &self.name
132 }
133 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.description = ::std::option::Option::Some(input.into());
136 self
137 }
138 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.description = input;
141 self
142 }
143 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
145 &self.description
146 }
147 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
149 self.created_at = ::std::option::Option::Some(input);
150 self
151 }
152 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
154 self.created_at = input;
155 self
156 }
157 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
159 &self.created_at
160 }
161 pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
163 self.updated_at = ::std::option::Option::Some(input);
164 self
165 }
166 pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
168 self.updated_at = input;
169 self
170 }
171 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
173 &self.updated_at
174 }
175 pub fn asset_type_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 self.asset_type_id = ::std::option::Option::Some(input.into());
179 self
180 }
181 pub fn set_asset_type_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.asset_type_id = input;
184 self
185 }
186 pub fn get_asset_type_id(&self) -> &::std::option::Option<::std::string::String> {
188 &self.asset_type_id
189 }
190 pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196 let mut v = self.glossary_terms.unwrap_or_default();
197 v.push(input.into());
198 self.glossary_terms = ::std::option::Option::Some(v);
199 self
200 }
201 pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
203 self.glossary_terms = input;
204 self
205 }
206 pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
208 &self.glossary_terms
209 }
210 pub fn forms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssetFormEntry) -> Self {
216 let mut hash_map = self.forms.unwrap_or_default();
217 hash_map.insert(k.into(), v);
218 self.forms = ::std::option::Option::Some(hash_map);
219 self
220 }
221 pub fn set_forms(
223 mut self,
224 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
225 ) -> Self {
226 self.forms = input;
227 self
228 }
229 pub fn get_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
231 &self.forms
232 }
233 pub fn attachments(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssetFormEntry) -> Self {
239 let mut hash_map = self.attachments.unwrap_or_default();
240 hash_map.insert(k.into(), v);
241 self.attachments = ::std::option::Option::Some(hash_map);
242 self
243 }
244 pub fn set_attachments(
246 mut self,
247 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
248 ) -> Self {
249 self.attachments = input;
250 self
251 }
252 pub fn get_attachments(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
254 &self.attachments
255 }
256 pub fn iterable_forms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::IterableFormEntry) -> Self {
262 let mut hash_map = self.iterable_forms.unwrap_or_default();
263 hash_map.insert(k.into(), v);
264 self.iterable_forms = ::std::option::Option::Some(hash_map);
265 self
266 }
267 pub fn set_iterable_forms(
269 mut self,
270 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
271 ) -> Self {
272 self.iterable_forms = input;
273 self
274 }
275 pub fn get_iterable_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>> {
277 &self.iterable_forms
278 }
279 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
280 self._request_id = Some(request_id.into());
281 self
282 }
283
284 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
285 self._request_id = request_id;
286 self
287 }
288 pub fn build(self) -> ::std::result::Result<crate::operation::get_asset::GetAssetOutput, ::aws_smithy_types::error::operation::BuildError> {
293 ::std::result::Result::Ok(crate::operation::get_asset::GetAssetOutput {
294 id: self.id.ok_or_else(|| {
295 ::aws_smithy_types::error::operation::BuildError::missing_field(
296 "id",
297 "id was not specified but it is required when building GetAssetOutput",
298 )
299 })?,
300 name: self.name,
301 description: self.description,
302 created_at: self.created_at,
303 updated_at: self.updated_at,
304 asset_type_id: self.asset_type_id.ok_or_else(|| {
305 ::aws_smithy_types::error::operation::BuildError::missing_field(
306 "asset_type_id",
307 "asset_type_id was not specified but it is required when building GetAssetOutput",
308 )
309 })?,
310 glossary_terms: self.glossary_terms,
311 forms: self.forms,
312 attachments: self.attachments,
313 iterable_forms: self.iterable_forms,
314 _request_id: self._request_id,
315 })
316 }
317}