aws_sdk_codeartifact/operation/get_package_version_asset/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_package_version_asset::_get_package_version_asset_output::GetPackageVersionAssetOutputBuilder;
3
4pub use crate::operation::get_package_version_asset::_get_package_version_asset_input::GetPackageVersionAssetInputBuilder;
5
6impl crate::operation::get_package_version_asset::builders::GetPackageVersionAssetInputBuilder {
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_package_version_asset::GetPackageVersionAssetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_package_version_asset::GetPackageVersionAssetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_package_version_asset();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetPackageVersionAsset`.
24///
25/// <p>Returns an asset (or file) that is in a package. For example, for a Maven package version, use <code>GetPackageVersionAsset</code> to download a <code>JAR</code> file, a <code>POM</code> file, or any other assets in the package version.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetPackageVersionAssetFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_package_version_asset::builders::GetPackageVersionAssetInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::get_package_version_asset::GetPackageVersionAssetOutput,
35        crate::operation::get_package_version_asset::GetPackageVersionAssetError,
36    > for GetPackageVersionAssetFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::get_package_version_asset::GetPackageVersionAssetOutput,
44            crate::operation::get_package_version_asset::GetPackageVersionAssetError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl GetPackageVersionAssetFluentBuilder {
51    /// Creates a new `GetPackageVersionAssetFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the GetPackageVersionAsset as a reference.
60    pub fn as_input(&self) -> &crate::operation::get_package_version_asset::builders::GetPackageVersionAssetInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::get_package_version_asset::GetPackageVersionAssetOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::get_package_version_asset::GetPackageVersionAssetError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::get_package_version_asset::GetPackageVersionAsset::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::get_package_version_asset::GetPackageVersionAsset::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::get_package_version_asset::GetPackageVersionAssetOutput,
97        crate::operation::get_package_version_asset::GetPackageVersionAssetError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The name of the domain that contains the repository that contains the package version with the requested asset.</p>
112    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.domain(input.into());
114        self
115    }
116    /// <p>The name of the domain that contains the repository that contains the package version with the requested asset.</p>
117    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_domain(input);
119        self
120    }
121    /// <p>The name of the domain that contains the repository that contains the package version with the requested asset.</p>
122    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_domain()
124    }
125    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
126    pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.domain_owner(input.into());
128        self
129    }
130    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
131    pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_domain_owner(input);
133        self
134    }
135    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
136    pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_domain_owner()
138    }
139    /// <p>The repository that contains the package version with the requested asset.</p>
140    pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.repository(input.into());
142        self
143    }
144    /// <p>The repository that contains the package version with the requested asset.</p>
145    pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_repository(input);
147        self
148    }
149    /// <p>The repository that contains the package version with the requested asset.</p>
150    pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_repository()
152    }
153    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
154    pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
155        self.inner = self.inner.format(input);
156        self
157    }
158    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
159    pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
160        self.inner = self.inner.set_format(input);
161        self
162    }
163    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
164    pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
165        self.inner.get_format()
166    }
167    /// <p>The namespace of the package version with the requested asset file. The package component that specifies its namespace depends on its type. For example:</p><note>
168    /// <p>The namespace is required when requesting assets from package versions of the following formats:</p>
169    /// <ul>
170    /// <li>
171    /// <p>Maven</p></li>
172    /// <li>
173    /// <p>Swift</p></li>
174    /// <li>
175    /// <p>generic</p></li>
176    /// </ul>
177    /// </note>
178    /// <ul>
179    /// <li>
180    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
181    /// <li>
182    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
183    /// <li>
184    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
185    /// <li>
186    /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
187    /// </ul>
188    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.inner = self.inner.namespace(input.into());
190        self
191    }
192    /// <p>The namespace of the package version with the requested asset file. The package component that specifies its namespace depends on its type. For example:</p><note>
193    /// <p>The namespace is required when requesting assets from package versions of the following formats:</p>
194    /// <ul>
195    /// <li>
196    /// <p>Maven</p></li>
197    /// <li>
198    /// <p>Swift</p></li>
199    /// <li>
200    /// <p>generic</p></li>
201    /// </ul>
202    /// </note>
203    /// <ul>
204    /// <li>
205    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
206    /// <li>
207    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
208    /// <li>
209    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
210    /// <li>
211    /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
212    /// </ul>
213    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_namespace(input);
215        self
216    }
217    /// <p>The namespace of the package version with the requested asset file. The package component that specifies its namespace depends on its type. For example:</p><note>
218    /// <p>The namespace is required when requesting assets from package versions of the following formats:</p>
219    /// <ul>
220    /// <li>
221    /// <p>Maven</p></li>
222    /// <li>
223    /// <p>Swift</p></li>
224    /// <li>
225    /// <p>generic</p></li>
226    /// </ul>
227    /// </note>
228    /// <ul>
229    /// <li>
230    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
231    /// <li>
232    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
233    /// <li>
234    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
235    /// <li>
236    /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
237    /// </ul>
238    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
239        self.inner.get_namespace()
240    }
241    /// <p>The name of the package that contains the requested asset.</p>
242    pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
243        self.inner = self.inner.package(input.into());
244        self
245    }
246    /// <p>The name of the package that contains the requested asset.</p>
247    pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248        self.inner = self.inner.set_package(input);
249        self
250    }
251    /// <p>The name of the package that contains the requested asset.</p>
252    pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
253        self.inner.get_package()
254    }
255    /// <p>A string that contains the package version (for example, <code>3.5.2</code>).</p>
256    pub fn package_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257        self.inner = self.inner.package_version(input.into());
258        self
259    }
260    /// <p>A string that contains the package version (for example, <code>3.5.2</code>).</p>
261    pub fn set_package_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262        self.inner = self.inner.set_package_version(input);
263        self
264    }
265    /// <p>A string that contains the package version (for example, <code>3.5.2</code>).</p>
266    pub fn get_package_version(&self) -> &::std::option::Option<::std::string::String> {
267        self.inner.get_package_version()
268    }
269    /// <p>The name of the requested asset.</p>
270    pub fn asset(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.inner = self.inner.asset(input.into());
272        self
273    }
274    /// <p>The name of the requested asset.</p>
275    pub fn set_asset(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.inner = self.inner.set_asset(input);
277        self
278    }
279    /// <p>The name of the requested asset.</p>
280    pub fn get_asset(&self) -> &::std::option::Option<::std::string::String> {
281        self.inner.get_asset()
282    }
283    /// <p>The name of the package version revision that contains the requested asset.</p>
284    pub fn package_version_revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285        self.inner = self.inner.package_version_revision(input.into());
286        self
287    }
288    /// <p>The name of the package version revision that contains the requested asset.</p>
289    pub fn set_package_version_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290        self.inner = self.inner.set_package_version_revision(input);
291        self
292    }
293    /// <p>The name of the package version revision that contains the requested asset.</p>
294    pub fn get_package_version_revision(&self) -> &::std::option::Option<::std::string::String> {
295        self.inner.get_package_version_revision()
296    }
297}