aws_sdk_datazone/operation/create_asset_revision/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_asset_revision::_create_asset_revision_output::CreateAssetRevisionOutputBuilder;
3
4pub use crate::operation::create_asset_revision::_create_asset_revision_input::CreateAssetRevisionInputBuilder;
5
6impl crate::operation::create_asset_revision::builders::CreateAssetRevisionInputBuilder {
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_revision::CreateAssetRevisionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_asset_revision::CreateAssetRevisionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_asset_revision();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAssetRevision`.
24///
25/// <p>Creates a revision of the asset.</p>
26/// <p>Asset revisions represent new versions of existing assets, capturing changes to either the underlying data or its metadata. They maintain a historical record of how assets evolve over time, who made changes, and when those changes occurred. This versioning capability is crucial for governance and compliance, allowing organizations to track changes, understand their impact, and roll back if necessary.</p>
27/// <p>Prerequisites:</p>
28/// <ul>
29/// <li>
30/// <p>Asset must already exist in the domain with identifier.</p></li>
31/// <li>
32/// <p>The form type with correct revision must be registered in the same domain.</p></li>
33/// <li>
34/// <p>The form content must include all required fields (e.g., <code>bucketArn</code> for <code>S3ObjectCollectionForm</code>).</p></li>
35/// <li>
36/// <p>The owning project of the original asset must still exist and be active.</p></li>
37/// <li>
38/// <p>User must have write access to the project and domain.</p></li>
39/// </ul>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct CreateAssetRevisionFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::create_asset_revision::builders::CreateAssetRevisionInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::create_asset_revision::CreateAssetRevisionOutput,
49        crate::operation::create_asset_revision::CreateAssetRevisionError,
50    > for CreateAssetRevisionFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::create_asset_revision::CreateAssetRevisionOutput,
58            crate::operation::create_asset_revision::CreateAssetRevisionError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl CreateAssetRevisionFluentBuilder {
65    /// Creates a new `CreateAssetRevisionFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the CreateAssetRevision as a reference.
74    pub fn as_input(&self) -> &crate::operation::create_asset_revision::builders::CreateAssetRevisionInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::create_asset_revision::CreateAssetRevisionOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::create_asset_revision::CreateAssetRevisionError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::create_asset_revision::CreateAssetRevision::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::create_asset_revision::CreateAssetRevision::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::create_asset_revision::CreateAssetRevisionOutput,
111        crate::operation::create_asset_revision::CreateAssetRevisionError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>Te revised name of the asset.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>Te revised name of the asset.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>Te revised name of the asset.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>The unique identifier of the domain where the asset is being revised.</p>
140    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.domain_identifier(input.into());
142        self
143    }
144    /// <p>The unique identifier of the domain where the asset is being revised.</p>
145    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_domain_identifier(input);
147        self
148    }
149    /// <p>The unique identifier of the domain where the asset is being revised.</p>
150    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_domain_identifier()
152    }
153    /// <p>The identifier of the asset.</p>
154    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.identifier(input.into());
156        self
157    }
158    /// <p>The identifier of the asset.</p>
159    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_identifier(input);
161        self
162    }
163    /// <p>The identifier of the asset.</p>
164    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_identifier()
166    }
167    /// <p>The revision type of the asset.</p>
168    pub fn type_revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.type_revision(input.into());
170        self
171    }
172    /// <p>The revision type of the asset.</p>
173    pub fn set_type_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_type_revision(input);
175        self
176    }
177    /// <p>The revision type of the asset.</p>
178    pub fn get_type_revision(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_type_revision()
180    }
181    /// <p>The revised description of the asset.</p>
182    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.description(input.into());
184        self
185    }
186    /// <p>The revised description of the asset.</p>
187    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_description(input);
189        self
190    }
191    /// <p>The revised description of the asset.</p>
192    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_description()
194    }
195    ///
196    /// Appends an item to `glossaryTerms`.
197    ///
198    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
199    ///
200    /// <p>The glossary terms to be attached to the asset as part of asset revision.</p>
201    pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.glossary_terms(input.into());
203        self
204    }
205    /// <p>The glossary terms to be attached to the asset as part of asset revision.</p>
206    pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
207        self.inner = self.inner.set_glossary_terms(input);
208        self
209    }
210    /// <p>The glossary terms to be attached to the asset as part of asset revision.</p>
211    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
212        self.inner.get_glossary_terms()
213    }
214    ///
215    /// Appends an item to `formsInput`.
216    ///
217    /// To override the contents of this collection use [`set_forms_input`](Self::set_forms_input).
218    ///
219    /// <p>The metadata forms to be attached to the asset as part of asset revision.</p>
220    pub fn forms_input(mut self, input: crate::types::FormInput) -> Self {
221        self.inner = self.inner.forms_input(input);
222        self
223    }
224    /// <p>The metadata forms to be attached to the asset as part of asset revision.</p>
225    pub fn set_forms_input(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FormInput>>) -> Self {
226        self.inner = self.inner.set_forms_input(input);
227        self
228    }
229    /// <p>The metadata forms to be attached to the asset as part of asset revision.</p>
230    pub fn get_forms_input(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FormInput>> {
231        self.inner.get_forms_input()
232    }
233    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
234    pub fn prediction_configuration(mut self, input: crate::types::PredictionConfiguration) -> Self {
235        self.inner = self.inner.prediction_configuration(input);
236        self
237    }
238    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
239    pub fn set_prediction_configuration(mut self, input: ::std::option::Option<crate::types::PredictionConfiguration>) -> Self {
240        self.inner = self.inner.set_prediction_configuration(input);
241        self
242    }
243    /// <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
244    pub fn get_prediction_configuration(&self) -> &::std::option::Option<crate::types::PredictionConfiguration> {
245        self.inner.get_prediction_configuration()
246    }
247    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
248    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
249        self.inner = self.inner.client_token(input.into());
250        self
251    }
252    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
253    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254        self.inner = self.inner.set_client_token(input);
255        self
256    }
257    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
258    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
259        self.inner.get_client_token()
260    }
261}