aws_sdk_codeartifact/operation/list_packages/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_packages::_list_packages_output::ListPackagesOutputBuilder;
3
4pub use crate::operation::list_packages::_list_packages_input::ListPackagesInputBuilder;
5
6impl crate::operation::list_packages::builders::ListPackagesInputBuilder {
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::list_packages::ListPackagesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_packages::ListPackagesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_packages();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListPackages`.
24///
25/// <p>Returns a list of <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageSummary.html">PackageSummary</a> objects for packages in a repository that match the request parameters.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListPackagesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_packages::builders::ListPackagesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_packages::ListPackagesOutput,
35        crate::operation::list_packages::ListPackagesError,
36    > for ListPackagesFluentBuilder
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::list_packages::ListPackagesOutput,
44            crate::operation::list_packages::ListPackagesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListPackagesFluentBuilder {
51    /// Creates a new `ListPackagesFluentBuilder`.
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 ListPackages as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_packages::builders::ListPackagesInputBuilder {
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::list_packages::ListPackagesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_packages::ListPackagesError,
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::list_packages::ListPackages::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_packages::ListPackages::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::list_packages::ListPackagesOutput,
97        crate::operation::list_packages::ListPackagesError,
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    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::list_packages::paginator::ListPackagesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_packages::paginator::ListPackagesPaginator {
115        crate::operation::list_packages::paginator::ListPackagesPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The name of the domain that contains the repository that contains the requested packages.</p>
118    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.domain(input.into());
120        self
121    }
122    /// <p>The name of the domain that contains the repository that contains the requested packages.</p>
123    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_domain(input);
125        self
126    }
127    /// <p>The name of the domain that contains the repository that contains the requested packages.</p>
128    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_domain()
130    }
131    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
132    pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.domain_owner(input.into());
134        self
135    }
136    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
137    pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_domain_owner(input);
139        self
140    }
141    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
142    pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_domain_owner()
144    }
145    /// <p>The name of the repository that contains the requested packages.</p>
146    pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.repository(input.into());
148        self
149    }
150    /// <p>The name of the repository that contains the requested packages.</p>
151    pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_repository(input);
153        self
154    }
155    /// <p>The name of the repository that contains the requested packages.</p>
156    pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_repository()
158    }
159    /// <p>The format used to filter requested packages. Only packages from the provided format will be returned.</p>
160    pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
161        self.inner = self.inner.format(input);
162        self
163    }
164    /// <p>The format used to filter requested packages. Only packages from the provided format will be returned.</p>
165    pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
166        self.inner = self.inner.set_format(input);
167        self
168    }
169    /// <p>The format used to filter requested packages. Only packages from the provided format will be returned.</p>
170    pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
171        self.inner.get_format()
172    }
173    /// <p>The namespace prefix used to filter requested packages. Only packages with a namespace that starts with the provided string value are returned. Note that although this option is called <code>--namespace</code> and not <code>--namespace-prefix</code>, it has prefix-matching behavior.</p>
174    /// <p>Each package format uses namespace as follows:</p>
175    /// <ul>
176    /// <li>
177    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
178    /// <li>
179    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
180    /// <li>
181    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
182    /// <li>
183    /// <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>
184    /// </ul>
185    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.namespace(input.into());
187        self
188    }
189    /// <p>The namespace prefix used to filter requested packages. Only packages with a namespace that starts with the provided string value are returned. Note that although this option is called <code>--namespace</code> and not <code>--namespace-prefix</code>, it has prefix-matching behavior.</p>
190    /// <p>Each package format uses namespace as follows:</p>
191    /// <ul>
192    /// <li>
193    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
194    /// <li>
195    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
196    /// <li>
197    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
198    /// <li>
199    /// <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>
200    /// </ul>
201    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_namespace(input);
203        self
204    }
205    /// <p>The namespace prefix used to filter requested packages. Only packages with a namespace that starts with the provided string value are returned. Note that although this option is called <code>--namespace</code> and not <code>--namespace-prefix</code>, it has prefix-matching behavior.</p>
206    /// <p>Each package format uses namespace as follows:</p>
207    /// <ul>
208    /// <li>
209    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
210    /// <li>
211    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
212    /// <li>
213    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
214    /// <li>
215    /// <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>
216    /// </ul>
217    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_namespace()
219    }
220    /// <p>A prefix used to filter requested packages. Only packages with names that start with <code>packagePrefix</code> are returned.</p>
221    pub fn package_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.inner = self.inner.package_prefix(input.into());
223        self
224    }
225    /// <p>A prefix used to filter requested packages. Only packages with names that start with <code>packagePrefix</code> are returned.</p>
226    pub fn set_package_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227        self.inner = self.inner.set_package_prefix(input);
228        self
229    }
230    /// <p>A prefix used to filter requested packages. Only packages with names that start with <code>packagePrefix</code> are returned.</p>
231    pub fn get_package_prefix(&self) -> &::std::option::Option<::std::string::String> {
232        self.inner.get_package_prefix()
233    }
234    /// <p>The maximum number of results to return per page.</p>
235    pub fn max_results(mut self, input: i32) -> Self {
236        self.inner = self.inner.max_results(input);
237        self
238    }
239    /// <p>The maximum number of results to return per page.</p>
240    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
241        self.inner = self.inner.set_max_results(input);
242        self
243    }
244    /// <p>The maximum number of results to return per page.</p>
245    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
246        self.inner.get_max_results()
247    }
248    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
249    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250        self.inner = self.inner.next_token(input.into());
251        self
252    }
253    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
254    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255        self.inner = self.inner.set_next_token(input);
256        self
257    }
258    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
259    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_next_token()
261    }
262    /// <p>The value of the <code>Publish</code> package origin control restriction used to filter requested packages. Only packages with the provided restriction are returned. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageOriginRestrictions.html">PackageOriginRestrictions</a>.</p>
263    pub fn publish(mut self, input: crate::types::AllowPublish) -> Self {
264        self.inner = self.inner.publish(input);
265        self
266    }
267    /// <p>The value of the <code>Publish</code> package origin control restriction used to filter requested packages. Only packages with the provided restriction are returned. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageOriginRestrictions.html">PackageOriginRestrictions</a>.</p>
268    pub fn set_publish(mut self, input: ::std::option::Option<crate::types::AllowPublish>) -> Self {
269        self.inner = self.inner.set_publish(input);
270        self
271    }
272    /// <p>The value of the <code>Publish</code> package origin control restriction used to filter requested packages. Only packages with the provided restriction are returned. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageOriginRestrictions.html">PackageOriginRestrictions</a>.</p>
273    pub fn get_publish(&self) -> &::std::option::Option<crate::types::AllowPublish> {
274        self.inner.get_publish()
275    }
276    /// <p>The value of the <code>Upstream</code> package origin control restriction used to filter requested packages. Only packages with the provided restriction are returned. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageOriginRestrictions.html">PackageOriginRestrictions</a>.</p>
277    pub fn upstream(mut self, input: crate::types::AllowUpstream) -> Self {
278        self.inner = self.inner.upstream(input);
279        self
280    }
281    /// <p>The value of the <code>Upstream</code> package origin control restriction used to filter requested packages. Only packages with the provided restriction are returned. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageOriginRestrictions.html">PackageOriginRestrictions</a>.</p>
282    pub fn set_upstream(mut self, input: ::std::option::Option<crate::types::AllowUpstream>) -> Self {
283        self.inner = self.inner.set_upstream(input);
284        self
285    }
286    /// <p>The value of the <code>Upstream</code> package origin control restriction used to filter requested packages. Only packages with the provided restriction are returned. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageOriginRestrictions.html">PackageOriginRestrictions</a>.</p>
287    pub fn get_upstream(&self) -> &::std::option::Option<crate::types::AllowUpstream> {
288        self.inner.get_upstream()
289    }
290}