aws_sdk_datazone/operation/create_data_product/
builders.rs

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