aws_sdk_datazone/operation/create_asset/
_create_asset_input.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)]
5pub struct CreateAssetInput {
6    /// <p>Asset name.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>Amazon DataZone domain where the asset is created.</p>
9    pub domain_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The external identifier of the asset.</p>
11    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
12    pub external_identifier: ::std::option::Option<::std::string::String>,
13    /// <p>The unique identifier of this asset's type.</p>
14    pub type_identifier: ::std::option::Option<::std::string::String>,
15    /// <p>The revision of this asset's type.</p>
16    pub type_revision: ::std::option::Option<::std::string::String>,
17    /// <p>Asset description.</p>
18    pub description: ::std::option::Option<::std::string::String>,
19    /// <p>Glossary terms attached to the asset.</p>
20    pub glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21    /// <p>Metadata forms attached to the asset.</p>
22    pub forms_input: ::std::option::Option<::std::vec::Vec<crate::types::FormInput>>,
23    /// <p>The unique identifier of the project that owns this asset.</p>
24    pub owning_project_identifier: ::std::option::Option<::std::string::String>,
25    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
26    pub prediction_configuration: ::std::option::Option<crate::types::PredictionConfiguration>,
27    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
28    pub client_token: ::std::option::Option<::std::string::String>,
29}
30impl CreateAssetInput {
31    /// <p>Asset name.</p>
32    pub fn name(&self) -> ::std::option::Option<&str> {
33        self.name.as_deref()
34    }
35    /// <p>Amazon DataZone domain where the asset is created.</p>
36    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
37        self.domain_identifier.as_deref()
38    }
39    /// <p>The external identifier of the asset.</p>
40    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
41    pub fn external_identifier(&self) -> ::std::option::Option<&str> {
42        self.external_identifier.as_deref()
43    }
44    /// <p>The unique identifier of this asset's type.</p>
45    pub fn type_identifier(&self) -> ::std::option::Option<&str> {
46        self.type_identifier.as_deref()
47    }
48    /// <p>The revision of this asset's type.</p>
49    pub fn type_revision(&self) -> ::std::option::Option<&str> {
50        self.type_revision.as_deref()
51    }
52    /// <p>Asset description.</p>
53    pub fn description(&self) -> ::std::option::Option<&str> {
54        self.description.as_deref()
55    }
56    /// <p>Glossary terms attached to 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>Metadata forms attached to the asset.</p>
63    ///
64    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.forms_input.is_none()`.
65    pub fn forms_input(&self) -> &[crate::types::FormInput] {
66        self.forms_input.as_deref().unwrap_or_default()
67    }
68    /// <p>The unique identifier of the project that owns this asset.</p>
69    pub fn owning_project_identifier(&self) -> ::std::option::Option<&str> {
70        self.owning_project_identifier.as_deref()
71    }
72    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
73    pub fn prediction_configuration(&self) -> ::std::option::Option<&crate::types::PredictionConfiguration> {
74        self.prediction_configuration.as_ref()
75    }
76    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
77    pub fn client_token(&self) -> ::std::option::Option<&str> {
78        self.client_token.as_deref()
79    }
80}
81impl ::std::fmt::Debug for CreateAssetInput {
82    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
83        let mut formatter = f.debug_struct("CreateAssetInput");
84        formatter.field("name", &"*** Sensitive Data Redacted ***");
85        formatter.field("domain_identifier", &self.domain_identifier);
86        formatter.field("external_identifier", &self.external_identifier);
87        formatter.field("type_identifier", &self.type_identifier);
88        formatter.field("type_revision", &self.type_revision);
89        formatter.field("description", &"*** Sensitive Data Redacted ***");
90        formatter.field("glossary_terms", &self.glossary_terms);
91        formatter.field("forms_input", &"*** Sensitive Data Redacted ***");
92        formatter.field("owning_project_identifier", &self.owning_project_identifier);
93        formatter.field("prediction_configuration", &self.prediction_configuration);
94        formatter.field("client_token", &self.client_token);
95        formatter.finish()
96    }
97}
98impl CreateAssetInput {
99    /// Creates a new builder-style object to manufacture [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
100    pub fn builder() -> crate::operation::create_asset::builders::CreateAssetInputBuilder {
101        crate::operation::create_asset::builders::CreateAssetInputBuilder::default()
102    }
103}
104
105/// A builder for [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
106#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
107#[non_exhaustive]
108pub struct CreateAssetInputBuilder {
109    pub(crate) name: ::std::option::Option<::std::string::String>,
110    pub(crate) domain_identifier: ::std::option::Option<::std::string::String>,
111    pub(crate) external_identifier: ::std::option::Option<::std::string::String>,
112    pub(crate) type_identifier: ::std::option::Option<::std::string::String>,
113    pub(crate) type_revision: ::std::option::Option<::std::string::String>,
114    pub(crate) description: ::std::option::Option<::std::string::String>,
115    pub(crate) glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
116    pub(crate) forms_input: ::std::option::Option<::std::vec::Vec<crate::types::FormInput>>,
117    pub(crate) owning_project_identifier: ::std::option::Option<::std::string::String>,
118    pub(crate) prediction_configuration: ::std::option::Option<crate::types::PredictionConfiguration>,
119    pub(crate) client_token: ::std::option::Option<::std::string::String>,
120}
121impl CreateAssetInputBuilder {
122    /// <p>Asset name.</p>
123    /// This field is required.
124    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.name = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>Asset name.</p>
129    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.name = input;
131        self
132    }
133    /// <p>Asset name.</p>
134    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
135        &self.name
136    }
137    /// <p>Amazon DataZone domain where the asset is created.</p>
138    /// This field is required.
139    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.domain_identifier = ::std::option::Option::Some(input.into());
141        self
142    }
143    /// <p>Amazon DataZone domain where the asset is created.</p>
144    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.domain_identifier = input;
146        self
147    }
148    /// <p>Amazon DataZone domain where the asset is created.</p>
149    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
150        &self.domain_identifier
151    }
152    /// <p>The external identifier of the asset.</p>
153    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
154    pub fn external_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.external_identifier = ::std::option::Option::Some(input.into());
156        self
157    }
158    /// <p>The external identifier of the asset.</p>
159    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
160    pub fn set_external_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.external_identifier = input;
162        self
163    }
164    /// <p>The external identifier of the asset.</p>
165    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
166    pub fn get_external_identifier(&self) -> &::std::option::Option<::std::string::String> {
167        &self.external_identifier
168    }
169    /// <p>The unique identifier of this asset's type.</p>
170    /// This field is required.
171    pub fn type_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.type_identifier = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>The unique identifier of this asset's type.</p>
176    pub fn set_type_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.type_identifier = input;
178        self
179    }
180    /// <p>The unique identifier of this asset's type.</p>
181    pub fn get_type_identifier(&self) -> &::std::option::Option<::std::string::String> {
182        &self.type_identifier
183    }
184    /// <p>The revision of this asset's type.</p>
185    pub fn type_revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.type_revision = ::std::option::Option::Some(input.into());
187        self
188    }
189    /// <p>The revision of this asset's type.</p>
190    pub fn set_type_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.type_revision = input;
192        self
193    }
194    /// <p>The revision of this asset's type.</p>
195    pub fn get_type_revision(&self) -> &::std::option::Option<::std::string::String> {
196        &self.type_revision
197    }
198    /// <p>Asset description.</p>
199    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.description = ::std::option::Option::Some(input.into());
201        self
202    }
203    /// <p>Asset description.</p>
204    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.description = input;
206        self
207    }
208    /// <p>Asset description.</p>
209    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
210        &self.description
211    }
212    /// Appends an item to `glossary_terms`.
213    ///
214    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
215    ///
216    /// <p>Glossary terms attached to the asset.</p>
217    pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        let mut v = self.glossary_terms.unwrap_or_default();
219        v.push(input.into());
220        self.glossary_terms = ::std::option::Option::Some(v);
221        self
222    }
223    /// <p>Glossary terms attached to the asset.</p>
224    pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
225        self.glossary_terms = input;
226        self
227    }
228    /// <p>Glossary terms attached to the asset.</p>
229    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
230        &self.glossary_terms
231    }
232    /// Appends an item to `forms_input`.
233    ///
234    /// To override the contents of this collection use [`set_forms_input`](Self::set_forms_input).
235    ///
236    /// <p>Metadata forms attached to the asset.</p>
237    pub fn forms_input(mut self, input: crate::types::FormInput) -> Self {
238        let mut v = self.forms_input.unwrap_or_default();
239        v.push(input);
240        self.forms_input = ::std::option::Option::Some(v);
241        self
242    }
243    /// <p>Metadata forms attached to the asset.</p>
244    pub fn set_forms_input(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FormInput>>) -> Self {
245        self.forms_input = input;
246        self
247    }
248    /// <p>Metadata forms attached to the asset.</p>
249    pub fn get_forms_input(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FormInput>> {
250        &self.forms_input
251    }
252    /// <p>The unique identifier of the project that owns this asset.</p>
253    /// This field is required.
254    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.owning_project_identifier = ::std::option::Option::Some(input.into());
256        self
257    }
258    /// <p>The unique identifier of the project that owns this asset.</p>
259    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
260        self.owning_project_identifier = input;
261        self
262    }
263    /// <p>The unique identifier of the project that owns this asset.</p>
264    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
265        &self.owning_project_identifier
266    }
267    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
268    pub fn prediction_configuration(mut self, input: crate::types::PredictionConfiguration) -> Self {
269        self.prediction_configuration = ::std::option::Option::Some(input);
270        self
271    }
272    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
273    pub fn set_prediction_configuration(mut self, input: ::std::option::Option<crate::types::PredictionConfiguration>) -> Self {
274        self.prediction_configuration = input;
275        self
276    }
277    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
278    pub fn get_prediction_configuration(&self) -> &::std::option::Option<crate::types::PredictionConfiguration> {
279        &self.prediction_configuration
280    }
281    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
282    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
283        self.client_token = ::std::option::Option::Some(input.into());
284        self
285    }
286    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
287    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.client_token = input;
289        self
290    }
291    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
292    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
293        &self.client_token
294    }
295    /// Consumes the builder and constructs a [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
296    pub fn build(self) -> ::std::result::Result<crate::operation::create_asset::CreateAssetInput, ::aws_smithy_types::error::operation::BuildError> {
297        ::std::result::Result::Ok(crate::operation::create_asset::CreateAssetInput {
298            name: self.name,
299            domain_identifier: self.domain_identifier,
300            external_identifier: self.external_identifier,
301            type_identifier: self.type_identifier,
302            type_revision: self.type_revision,
303            description: self.description,
304            glossary_terms: self.glossary_terms,
305            forms_input: self.forms_input,
306            owning_project_identifier: self.owning_project_identifier,
307            prediction_configuration: self.prediction_configuration,
308            client_token: self.client_token,
309        })
310    }
311}
312impl ::std::fmt::Debug for CreateAssetInputBuilder {
313    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
314        let mut formatter = f.debug_struct("CreateAssetInputBuilder");
315        formatter.field("name", &"*** Sensitive Data Redacted ***");
316        formatter.field("domain_identifier", &self.domain_identifier);
317        formatter.field("external_identifier", &self.external_identifier);
318        formatter.field("type_identifier", &self.type_identifier);
319        formatter.field("type_revision", &self.type_revision);
320        formatter.field("description", &"*** Sensitive Data Redacted ***");
321        formatter.field("glossary_terms", &self.glossary_terms);
322        formatter.field("forms_input", &"*** Sensitive Data Redacted ***");
323        formatter.field("owning_project_identifier", &self.owning_project_identifier);
324        formatter.field("prediction_configuration", &self.prediction_configuration);
325        formatter.field("client_token", &self.client_token);
326        formatter.finish()
327    }
328}