aws_sdk_datazone/operation/create_data_product_revision/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_data_product_revision::_create_data_product_revision_output::CreateDataProductRevisionOutputBuilder;
3
4pub use crate::operation::create_data_product_revision::_create_data_product_revision_input::CreateDataProductRevisionInputBuilder;
5
6impl crate::operation::create_data_product_revision::builders::CreateDataProductRevisionInputBuilder {
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_data_product_revision::CreateDataProductRevisionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_data_product_revision::CreateDataProductRevisionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_data_product_revision();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDataProductRevision`.
24///
25/// <p>Creates a data product revision.</p>
26/// <p>Prerequisites:</p>
27/// <ul>
28/// <li>
29/// <p>The original data product must exist in the given domain.</p></li>
30/// <li>
31/// <p>User must have permissions on the data product.</p></li>
32/// <li>
33/// <p>The domain must be valid and accessible.</p></li>
34/// <li>
35/// <p>The new revision name must comply with naming constraints (if required).</p></li>
36/// </ul>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct CreateDataProductRevisionFluentBuilder {
39    handle: ::std::sync::Arc<crate::client::Handle>,
40    inner: crate::operation::create_data_product_revision::builders::CreateDataProductRevisionInputBuilder,
41    config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44    crate::client::customize::internal::CustomizableSend<
45        crate::operation::create_data_product_revision::CreateDataProductRevisionOutput,
46        crate::operation::create_data_product_revision::CreateDataProductRevisionError,
47    > for CreateDataProductRevisionFluentBuilder
48{
49    fn send(
50        self,
51        config_override: crate::config::Builder,
52    ) -> crate::client::customize::internal::BoxFuture<
53        crate::client::customize::internal::SendResult<
54            crate::operation::create_data_product_revision::CreateDataProductRevisionOutput,
55            crate::operation::create_data_product_revision::CreateDataProductRevisionError,
56        >,
57    > {
58        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59    }
60}
61impl CreateDataProductRevisionFluentBuilder {
62    /// Creates a new `CreateDataProductRevisionFluentBuilder`.
63    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64        Self {
65            handle,
66            inner: ::std::default::Default::default(),
67            config_override: ::std::option::Option::None,
68        }
69    }
70    /// Access the CreateDataProductRevision as a reference.
71    pub fn as_input(&self) -> &crate::operation::create_data_product_revision::builders::CreateDataProductRevisionInputBuilder {
72        &self.inner
73    }
74    /// Sends the request and returns the response.
75    ///
76    /// If an error occurs, an `SdkError` will be returned with additional details that
77    /// can be matched against.
78    ///
79    /// By default, any retryable failures will be retried twice. Retry behavior
80    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81    /// set when configuring the client.
82    pub async fn send(
83        self,
84    ) -> ::std::result::Result<
85        crate::operation::create_data_product_revision::CreateDataProductRevisionOutput,
86        ::aws_smithy_runtime_api::client::result::SdkError<
87            crate::operation::create_data_product_revision::CreateDataProductRevisionError,
88            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89        >,
90    > {
91        let input = self
92            .inner
93            .build()
94            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95        let runtime_plugins = crate::operation::create_data_product_revision::CreateDataProductRevision::operation_runtime_plugins(
96            self.handle.runtime_plugins.clone(),
97            &self.handle.conf,
98            self.config_override,
99        );
100        crate::operation::create_data_product_revision::CreateDataProductRevision::orchestrate(&runtime_plugins, input).await
101    }
102
103    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104    pub fn customize(
105        self,
106    ) -> crate::client::customize::CustomizableOperation<
107        crate::operation::create_data_product_revision::CreateDataProductRevisionOutput,
108        crate::operation::create_data_product_revision::CreateDataProductRevisionError,
109        Self,
110    > {
111        crate::client::customize::CustomizableOperation::new(self)
112    }
113    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114        self.set_config_override(::std::option::Option::Some(config_override.into()));
115        self
116    }
117
118    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119        self.config_override = config_override;
120        self
121    }
122    /// <p>The ID of the domain where the data product revision is created.</p>
123    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.domain_identifier(input.into());
125        self
126    }
127    /// <p>The ID of the domain where the data product revision is created.</p>
128    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_domain_identifier(input);
130        self
131    }
132    /// <p>The ID of the domain where the data product revision is created.</p>
133    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_domain_identifier()
135    }
136    /// <p>The ID of the data product revision.</p>
137    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.identifier(input.into());
139        self
140    }
141    /// <p>The ID of the data product revision.</p>
142    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_identifier(input);
144        self
145    }
146    /// <p>The ID of the data product revision.</p>
147    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_identifier()
149    }
150    /// <p>The name of the data product revision.</p>
151    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.name(input.into());
153        self
154    }
155    /// <p>The name of the data product revision.</p>
156    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.inner = self.inner.set_name(input);
158        self
159    }
160    /// <p>The name of the data product revision.</p>
161    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
162        self.inner.get_name()
163    }
164    /// <p>The description of the data product revision.</p>
165    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.description(input.into());
167        self
168    }
169    /// <p>The description of the data product revision.</p>
170    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_description(input);
172        self
173    }
174    /// <p>The description of the data product revision.</p>
175    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_description()
177    }
178    ///
179    /// Appends an item to `glossaryTerms`.
180    ///
181    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
182    ///
183    /// <p>The glossary terms of the data product revision.</p>
184    pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.glossary_terms(input.into());
186        self
187    }
188    /// <p>The glossary terms of the data product revision.</p>
189    pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
190        self.inner = self.inner.set_glossary_terms(input);
191        self
192    }
193    /// <p>The glossary terms of the data product revision.</p>
194    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
195        self.inner.get_glossary_terms()
196    }
197    ///
198    /// Appends an item to `items`.
199    ///
200    /// To override the contents of this collection use [`set_items`](Self::set_items).
201    ///
202    /// <p>The data assets of the data product revision.</p>
203    pub fn items(mut self, input: crate::types::DataProductItem) -> Self {
204        self.inner = self.inner.items(input);
205        self
206    }
207    /// <p>The data assets of the data product revision.</p>
208    pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataProductItem>>) -> Self {
209        self.inner = self.inner.set_items(input);
210        self
211    }
212    /// <p>The data assets of the data product revision.</p>
213    pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataProductItem>> {
214        self.inner.get_items()
215    }
216    ///
217    /// Appends an item to `formsInput`.
218    ///
219    /// To override the contents of this collection use [`set_forms_input`](Self::set_forms_input).
220    ///
221    /// <p>The metadata forms of the data product revision.</p>
222    pub fn forms_input(mut self, input: crate::types::FormInput) -> Self {
223        self.inner = self.inner.forms_input(input);
224        self
225    }
226    /// <p>The metadata forms of the data product revision.</p>
227    pub fn set_forms_input(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FormInput>>) -> Self {
228        self.inner = self.inner.set_forms_input(input);
229        self
230    }
231    /// <p>The metadata forms of the data product revision.</p>
232    pub fn get_forms_input(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FormInput>> {
233        self.inner.get_forms_input()
234    }
235    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
236    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237        self.inner = self.inner.client_token(input.into());
238        self
239    }
240    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
241    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242        self.inner = self.inner.set_client_token(input);
243        self
244    }
245    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
246    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
247        self.inner.get_client_token()
248    }
249}