aws_sdk_datazone/operation/get_asset/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_asset::_get_asset_output::GetAssetOutputBuilder;
3
4pub use crate::operation::get_asset::_get_asset_input::GetAssetInputBuilder;
5
6impl crate::operation::get_asset::builders::GetAssetInputBuilder {
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::get_asset::GetAssetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_asset::GetAssetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_asset();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetAsset`.
24///
25/// <p>Gets an Amazon DataZone asset.</p>
26/// <p>An asset is the fundamental building block in Amazon DataZone, representing any data resource that needs to be cataloged and managed. It can take many forms, from Amazon S3 buckets and database tables to dashboards and machine learning models. Each asset contains comprehensive metadata about the resource, including its location, schema, ownership, and lineage information. Assets are essential for organizing and managing data resources across an organization, making them discoverable and usable while maintaining proper governance.</p>
27/// <p>Before using the Amazon DataZone GetAsset command, ensure the following prerequisites are met:</p>
28/// <ul>
29/// <li>
30/// <p>Domain identifier must exist and be valid</p></li>
31/// <li>
32/// <p>Asset identifier must exist</p></li>
33/// <li>
34/// <p>User must have the required permissions to perform the action</p></li>
35/// </ul>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct GetAssetFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::get_asset::builders::GetAssetInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl crate::client::customize::internal::CustomizableSend<crate::operation::get_asset::GetAssetOutput, crate::operation::get_asset::GetAssetError>
43    for GetAssetFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<crate::operation::get_asset::GetAssetOutput, crate::operation::get_asset::GetAssetError>,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl GetAssetFluentBuilder {
55    /// Creates a new `GetAssetFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the GetAsset as a reference.
64    pub fn as_input(&self) -> &crate::operation::get_asset::builders::GetAssetInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::get_asset::GetAssetOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::get_asset::GetAssetError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::get_asset::GetAsset::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::get_asset::GetAsset::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_asset::GetAssetOutput, crate::operation::get_asset::GetAssetError, Self>
100    {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The ID of the Amazon DataZone domain to which the asset belongs.</p>
113    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.domain_identifier(input.into());
115        self
116    }
117    /// <p>The ID of the Amazon DataZone domain to which the asset belongs.</p>
118    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_domain_identifier(input);
120        self
121    }
122    /// <p>The ID of the Amazon DataZone domain to which the asset belongs.</p>
123    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_domain_identifier()
125    }
126    /// <p>The ID of the Amazon DataZone asset.</p>
127    /// <p>This parameter supports either the value of <code>assetId</code> or <code>externalIdentifier</code> as input. If you are passing the value of <code>externalIdentifier</code>, you must prefix this value with <code>externalIdentifer%2F</code>.</p>
128    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.identifier(input.into());
130        self
131    }
132    /// <p>The ID of the Amazon DataZone asset.</p>
133    /// <p>This parameter supports either the value of <code>assetId</code> or <code>externalIdentifier</code> as input. If you are passing the value of <code>externalIdentifier</code>, you must prefix this value with <code>externalIdentifer%2F</code>.</p>
134    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_identifier(input);
136        self
137    }
138    /// <p>The ID of the Amazon DataZone asset.</p>
139    /// <p>This parameter supports either the value of <code>assetId</code> or <code>externalIdentifier</code> as input. If you are passing the value of <code>externalIdentifier</code>, you must prefix this value with <code>externalIdentifer%2F</code>.</p>
140    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_identifier()
142    }
143    /// <p>The revision of the Amazon DataZone asset.</p>
144    pub fn revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.revision(input.into());
146        self
147    }
148    /// <p>The revision of the Amazon DataZone asset.</p>
149    pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_revision(input);
151        self
152    }
153    /// <p>The revision of the Amazon DataZone asset.</p>
154    pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_revision()
156    }
157}