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