Skip to main content

aws_sdk_glue/operation/get_asset/
_get_asset_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The asset metadata returned by the <code>GetAsset</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetAssetOutput {
7    /// <p>The unique identifier of the asset.</p>
8    pub id: ::std::string::String,
9    /// <p>The name of the asset.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The description of the asset.</p>
12    pub description: ::std::option::Option<::std::string::String>,
13    /// <p>The timestamp at which the asset was created.</p>
14    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
15    /// <p>The timestamp at which the asset was last updated.</p>
16    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
17    /// <p>The identifier of the asset type for this asset.</p>
18    pub asset_type_id: ::std::string::String,
19    /// <p>The identifiers of the glossary terms associated with the asset.</p>
20    pub glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21    /// <p>The forms on the asset, keyed by form name.</p>
22    pub forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
23    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
24    pub attachments: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
25    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
26    pub iterable_forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
27    _request_id: Option<String>,
28}
29impl GetAssetOutput {
30    /// <p>The unique identifier of the asset.</p>
31    pub fn id(&self) -> &str {
32        use std::ops::Deref;
33        self.id.deref()
34    }
35    /// <p>The name of the asset.</p>
36    pub fn name(&self) -> ::std::option::Option<&str> {
37        self.name.as_deref()
38    }
39    /// <p>The description of the asset.</p>
40    pub fn description(&self) -> ::std::option::Option<&str> {
41        self.description.as_deref()
42    }
43    /// <p>The timestamp at which the asset was created.</p>
44    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
45        self.created_at.as_ref()
46    }
47    /// <p>The timestamp at which the asset was last updated.</p>
48    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49        self.updated_at.as_ref()
50    }
51    /// <p>The identifier of the asset type for this asset.</p>
52    pub fn asset_type_id(&self) -> &str {
53        use std::ops::Deref;
54        self.asset_type_id.deref()
55    }
56    /// <p>The identifiers of the glossary terms associated with the asset.</p>
57    ///
58    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.glossary_terms.is_none()`.
59    pub fn glossary_terms(&self) -> &[::std::string::String] {
60        self.glossary_terms.as_deref().unwrap_or_default()
61    }
62    /// <p>The forms on the asset, keyed by form name.</p>
63    pub fn forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
64        self.forms.as_ref()
65    }
66    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
67    pub fn attachments(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
68        self.attachments.as_ref()
69    }
70    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
71    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    /// Creates a new builder-style object to manufacture [`GetAssetOutput`](crate::operation::get_asset::GetAssetOutput).
82    pub fn builder() -> crate::operation::get_asset::builders::GetAssetOutputBuilder {
83        crate::operation::get_asset::builders::GetAssetOutputBuilder::default()
84    }
85}
86
87/// A builder for [`GetAssetOutput`](crate::operation::get_asset::GetAssetOutput).
88#[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    /// <p>The unique identifier of the asset.</p>
105    /// This field is required.
106    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    /// <p>The unique identifier of the asset.</p>
111    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.id = input;
113        self
114    }
115    /// <p>The unique identifier of the asset.</p>
116    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
117        &self.id
118    }
119    /// <p>The name of the asset.</p>
120    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    /// <p>The name of the asset.</p>
125    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.name = input;
127        self
128    }
129    /// <p>The name of the asset.</p>
130    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
131        &self.name
132    }
133    /// <p>The description of the asset.</p>
134    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    /// <p>The description of the asset.</p>
139    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.description = input;
141        self
142    }
143    /// <p>The description of the asset.</p>
144    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
145        &self.description
146    }
147    /// <p>The timestamp at which the asset was created.</p>
148    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    /// <p>The timestamp at which the asset was created.</p>
153    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    /// <p>The timestamp at which the asset was created.</p>
158    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
159        &self.created_at
160    }
161    /// <p>The timestamp at which the asset was last updated.</p>
162    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    /// <p>The timestamp at which the asset was last updated.</p>
167    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    /// <p>The timestamp at which the asset was last updated.</p>
172    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
173        &self.updated_at
174    }
175    /// <p>The identifier of the asset type for this asset.</p>
176    /// This field is required.
177    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    /// <p>The identifier of the asset type for this asset.</p>
182    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    /// <p>The identifier of the asset type for this asset.</p>
187    pub fn get_asset_type_id(&self) -> &::std::option::Option<::std::string::String> {
188        &self.asset_type_id
189    }
190    /// Appends an item to `glossary_terms`.
191    ///
192    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
193    ///
194    /// <p>The identifiers of the glossary terms associated with the asset.</p>
195    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    /// <p>The identifiers of the glossary terms associated with the asset.</p>
202    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    /// <p>The identifiers of the glossary terms associated with the asset.</p>
207    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
208        &self.glossary_terms
209    }
210    /// Adds a key-value pair to `forms`.
211    ///
212    /// To override the contents of this collection use [`set_forms`](Self::set_forms).
213    ///
214    /// <p>The forms on the asset, keyed by form name.</p>
215    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    /// <p>The forms on the asset, keyed by form name.</p>
222    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    /// <p>The forms on the asset, keyed by form name.</p>
230    pub fn get_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
231        &self.forms
232    }
233    /// Adds a key-value pair to `attachments`.
234    ///
235    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
236    ///
237    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
238    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    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
245    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    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
253    pub fn get_attachments(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
254        &self.attachments
255    }
256    /// Adds a key-value pair to `iterable_forms`.
257    ///
258    /// To override the contents of this collection use [`set_iterable_forms`](Self::set_iterable_forms).
259    ///
260    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
261    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    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
268    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    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
276    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    /// Consumes the builder and constructs a [`GetAssetOutput`](crate::operation::get_asset::GetAssetOutput).
289    /// This method will fail if any of the following fields are not set:
290    /// - [`id`](crate::operation::get_asset::builders::GetAssetOutputBuilder::id)
291    /// - [`asset_type_id`](crate::operation::get_asset::builders::GetAssetOutputBuilder::asset_type_id)
292    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}