aws_sdk_datazone/operation/create_asset/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_asset::_create_asset_output::CreateAssetOutputBuilder;
3
4pub use crate::operation::create_asset::_create_asset_input::CreateAssetInputBuilder;
5
6impl crate::operation::create_asset::builders::CreateAssetInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_asset::CreateAssetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_asset::CreateAssetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_asset();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAsset`.
24///
25/// <p>Creates an asset in Amazon DataZone catalog.</p>
26/// <p>Before creating assets, make sure that the following requirements are met:</p>
27/// <ul>
28/// <li>
29/// <p><code>--domain-identifier</code> must refer to an existing domain.</p></li>
30/// <li>
31/// <p><code>--owning-project-identifier</code> must be a valid project within the domain.</p></li>
32/// <li>
33/// <p>Asset type must be created beforehand using <code>create-asset-type</code>, or be a supported system-defined type. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/reference/datazone/create-asset-type.html">create-asset-type</a>.</p></li>
34/// <li>
35/// <p><code>--type-revision</code> (if used) must match a valid revision of the asset type.</p></li>
36/// <li>
37/// <p><code>formsInput</code> is required when it is associated as required in the <code>asset-type</code>. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/reference/datazone/create-form-type.html">create-form-type</a>.</p></li>
38/// <li>
39/// <p>Form content must include all required fields as per the form schema (e.g., <code>bucketArn</code>).</p></li>
40/// </ul>
41/// <p>You must invoke the following pre-requisite commands before invoking this API:</p>
42/// <ul>
43/// <li>
44/// <p><a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html">CreateFormType</a></p></li>
45/// <li>
46/// <p><a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateAssetType.html">CreateAssetType</a></p></li>
47/// </ul>
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct CreateAssetFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::create_asset::builders::CreateAssetInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::create_asset::CreateAssetOutput,
57        crate::operation::create_asset::CreateAssetError,
58    > for CreateAssetFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::create_asset::CreateAssetOutput,
66            crate::operation::create_asset::CreateAssetError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl CreateAssetFluentBuilder {
73    /// Creates a new `CreateAssetFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the CreateAsset as a reference.
82    pub fn as_input(&self) -> &crate::operation::create_asset::builders::CreateAssetInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::create_asset::CreateAssetOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::create_asset::CreateAssetError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::create_asset::CreateAsset::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::create_asset::CreateAsset::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::create_asset::CreateAssetOutput,
119        crate::operation::create_asset::CreateAssetError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    /// <p>Asset name.</p>
134    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.name(input.into());
136        self
137    }
138    /// <p>Asset name.</p>
139    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_name(input);
141        self
142    }
143    /// <p>Asset name.</p>
144    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_name()
146    }
147    /// <p>Amazon DataZone domain where the asset is created.</p>
148    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.domain_identifier(input.into());
150        self
151    }
152    /// <p>Amazon DataZone domain where the asset is created.</p>
153    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_domain_identifier(input);
155        self
156    }
157    /// <p>Amazon DataZone domain where the asset is created.</p>
158    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_domain_identifier()
160    }
161    /// <p>The external identifier of the asset.</p>
162    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
163    pub fn external_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.external_identifier(input.into());
165        self
166    }
167    /// <p>The external identifier of the asset.</p>
168    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
169    pub fn set_external_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_external_identifier(input);
171        self
172    }
173    /// <p>The external identifier of the asset.</p>
174    /// <p>If the value for the <code>externalIdentifier</code> parameter is specified, it must be a unique value.</p>
175    pub fn get_external_identifier(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_external_identifier()
177    }
178    /// <p>The unique identifier of this asset's type.</p>
179    pub fn type_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.inner = self.inner.type_identifier(input.into());
181        self
182    }
183    /// <p>The unique identifier of this asset's type.</p>
184    pub fn set_type_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.inner = self.inner.set_type_identifier(input);
186        self
187    }
188    /// <p>The unique identifier of this asset's type.</p>
189    pub fn get_type_identifier(&self) -> &::std::option::Option<::std::string::String> {
190        self.inner.get_type_identifier()
191    }
192    /// <p>The revision of this asset's type.</p>
193    pub fn type_revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.type_revision(input.into());
195        self
196    }
197    /// <p>The revision of this asset's type.</p>
198    pub fn set_type_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.inner = self.inner.set_type_revision(input);
200        self
201    }
202    /// <p>The revision of this asset's type.</p>
203    pub fn get_type_revision(&self) -> &::std::option::Option<::std::string::String> {
204        self.inner.get_type_revision()
205    }
206    /// <p>Asset description.</p>
207    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.description(input.into());
209        self
210    }
211    /// <p>Asset description.</p>
212    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_description(input);
214        self
215    }
216    /// <p>Asset description.</p>
217    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_description()
219    }
220    ///
221    /// Appends an item to `glossaryTerms`.
222    ///
223    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
224    ///
225    /// <p>Glossary terms attached to the asset.</p>
226    pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.inner = self.inner.glossary_terms(input.into());
228        self
229    }
230    /// <p>Glossary terms attached to the asset.</p>
231    pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
232        self.inner = self.inner.set_glossary_terms(input);
233        self
234    }
235    /// <p>Glossary terms attached to the asset.</p>
236    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
237        self.inner.get_glossary_terms()
238    }
239    ///
240    /// Appends an item to `formsInput`.
241    ///
242    /// To override the contents of this collection use [`set_forms_input`](Self::set_forms_input).
243    ///
244    /// <p>Metadata forms attached to the asset.</p>
245    pub fn forms_input(mut self, input: crate::types::FormInput) -> Self {
246        self.inner = self.inner.forms_input(input);
247        self
248    }
249    /// <p>Metadata forms attached to the asset.</p>
250    pub fn set_forms_input(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FormInput>>) -> Self {
251        self.inner = self.inner.set_forms_input(input);
252        self
253    }
254    /// <p>Metadata forms attached to the asset.</p>
255    pub fn get_forms_input(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FormInput>> {
256        self.inner.get_forms_input()
257    }
258    /// <p>The unique identifier of the project that owns this asset.</p>
259    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260        self.inner = self.inner.owning_project_identifier(input.into());
261        self
262    }
263    /// <p>The unique identifier of the project that owns this asset.</p>
264    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
265        self.inner = self.inner.set_owning_project_identifier(input);
266        self
267    }
268    /// <p>The unique identifier of the project that owns this asset.</p>
269    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
270        self.inner.get_owning_project_identifier()
271    }
272    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
273    pub fn prediction_configuration(mut self, input: crate::types::PredictionConfiguration) -> Self {
274        self.inner = self.inner.prediction_configuration(input);
275        self
276    }
277    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
278    pub fn set_prediction_configuration(mut self, input: ::std::option::Option<crate::types::PredictionConfiguration>) -> Self {
279        self.inner = self.inner.set_prediction_configuration(input);
280        self
281    }
282    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
283    pub fn get_prediction_configuration(&self) -> &::std::option::Option<crate::types::PredictionConfiguration> {
284        self.inner.get_prediction_configuration()
285    }
286    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
287    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288        self.inner = self.inner.client_token(input.into());
289        self
290    }
291    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
292    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
293        self.inner = self.inner.set_client_token(input);
294        self
295    }
296    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
297    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
298        self.inner.get_client_token()
299    }
300}