aws_sdk_codeartifact/operation/list_package_versions/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_package_versions::_list_package_versions_output::ListPackageVersionsOutputBuilder;
3
4pub use crate::operation::list_package_versions::_list_package_versions_input::ListPackageVersionsInputBuilder;
5
6impl crate::operation::list_package_versions::builders::ListPackageVersionsInputBuilder {
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_package_versions::ListPackageVersionsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_package_versions::ListPackageVersionsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_package_versions();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListPackageVersions`.
24///
25/// <p>Returns a list of <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionSummary.html">PackageVersionSummary</a> objects for package versions in a repository that match the request parameters. Package versions of all statuses will be returned by default when calling <code>list-package-versions</code> with no <code>--status</code> parameter.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListPackageVersionsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::list_package_versions::builders::ListPackageVersionsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::list_package_versions::ListPackageVersionsOutput,
35 crate::operation::list_package_versions::ListPackageVersionsError,
36 > for ListPackageVersionsFluentBuilder
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_package_versions::ListPackageVersionsOutput,
44 crate::operation::list_package_versions::ListPackageVersionsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl ListPackageVersionsFluentBuilder {
51 /// Creates a new `ListPackageVersionsFluentBuilder`.
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 ListPackageVersions as a reference.
60 pub fn as_input(&self) -> &crate::operation::list_package_versions::builders::ListPackageVersionsInputBuilder {
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_package_versions::ListPackageVersionsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::list_package_versions::ListPackageVersionsError,
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_package_versions::ListPackageVersions::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::list_package_versions::ListPackageVersions::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_package_versions::ListPackageVersionsOutput,
97 crate::operation::list_package_versions::ListPackageVersionsError,
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_package_versions::paginator::ListPackageVersionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114 pub fn into_paginator(self) -> crate::operation::list_package_versions::paginator::ListPackageVersionsPaginator {
115 crate::operation::list_package_versions::paginator::ListPackageVersionsPaginator::new(self.handle, self.inner)
116 }
117 /// <p>The name of the domain that contains the repository that contains the requested package versions.</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 package versions.</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 package versions.</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 package versions.</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 package versions.</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 package versions.</p>
156 pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_repository()
158 }
159 /// <p>The format of the package versions you want to list.</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 of the package versions you want to list.</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 of the package versions you want to list.</p>
170 pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
171 self.inner.get_format()
172 }
173 /// <p>The namespace of the package that contains the requested package versions. The package component that specifies its namespace depends on its type. For example:</p><note>
174 /// <p>The namespace is required when deleting package versions of the following formats:</p>
175 /// <ul>
176 /// <li>
177 /// <p>Maven</p></li>
178 /// <li>
179 /// <p>Swift</p></li>
180 /// <li>
181 /// <p>generic</p></li>
182 /// </ul>
183 /// </note>
184 /// <ul>
185 /// <li>
186 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
187 /// <li>
188 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
189 /// <li>
190 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
191 /// <li>
192 /// <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>
193 /// </ul>
194 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195 self.inner = self.inner.namespace(input.into());
196 self
197 }
198 /// <p>The namespace of the package that contains the requested package versions. The package component that specifies its namespace depends on its type. For example:</p><note>
199 /// <p>The namespace is required when deleting package versions of the following formats:</p>
200 /// <ul>
201 /// <li>
202 /// <p>Maven</p></li>
203 /// <li>
204 /// <p>Swift</p></li>
205 /// <li>
206 /// <p>generic</p></li>
207 /// </ul>
208 /// </note>
209 /// <ul>
210 /// <li>
211 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
212 /// <li>
213 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
214 /// <li>
215 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
216 /// <li>
217 /// <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>
218 /// </ul>
219 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220 self.inner = self.inner.set_namespace(input);
221 self
222 }
223 /// <p>The namespace of the package that contains the requested package versions. The package component that specifies its namespace depends on its type. For example:</p><note>
224 /// <p>The namespace is required when deleting package versions of the following formats:</p>
225 /// <ul>
226 /// <li>
227 /// <p>Maven</p></li>
228 /// <li>
229 /// <p>Swift</p></li>
230 /// <li>
231 /// <p>generic</p></li>
232 /// </ul>
233 /// </note>
234 /// <ul>
235 /// <li>
236 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
237 /// <li>
238 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
239 /// <li>
240 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
241 /// <li>
242 /// <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>
243 /// </ul>
244 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
245 self.inner.get_namespace()
246 }
247 /// <p>The name of the package for which you want to request package versions.</p>
248 pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
249 self.inner = self.inner.package(input.into());
250 self
251 }
252 /// <p>The name of the package for which you want to request package versions.</p>
253 pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254 self.inner = self.inner.set_package(input);
255 self
256 }
257 /// <p>The name of the package for which you want to request package versions.</p>
258 pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
259 self.inner.get_package()
260 }
261 /// <p>A string that filters the requested package versions by status.</p>
262 pub fn status(mut self, input: crate::types::PackageVersionStatus) -> Self {
263 self.inner = self.inner.status(input);
264 self
265 }
266 /// <p>A string that filters the requested package versions by status.</p>
267 pub fn set_status(mut self, input: ::std::option::Option<crate::types::PackageVersionStatus>) -> Self {
268 self.inner = self.inner.set_status(input);
269 self
270 }
271 /// <p>A string that filters the requested package versions by status.</p>
272 pub fn get_status(&self) -> &::std::option::Option<crate::types::PackageVersionStatus> {
273 self.inner.get_status()
274 }
275 /// <p>How to sort the requested list of package versions.</p>
276 pub fn sort_by(mut self, input: crate::types::PackageVersionSortType) -> Self {
277 self.inner = self.inner.sort_by(input);
278 self
279 }
280 /// <p>How to sort the requested list of package versions.</p>
281 pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::PackageVersionSortType>) -> Self {
282 self.inner = self.inner.set_sort_by(input);
283 self
284 }
285 /// <p>How to sort the requested list of package versions.</p>
286 pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::PackageVersionSortType> {
287 self.inner.get_sort_by()
288 }
289 /// <p>The maximum number of results to return per page.</p>
290 pub fn max_results(mut self, input: i32) -> Self {
291 self.inner = self.inner.max_results(input);
292 self
293 }
294 /// <p>The maximum number of results to return per page.</p>
295 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
296 self.inner = self.inner.set_max_results(input);
297 self
298 }
299 /// <p>The maximum number of results to return per page.</p>
300 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
301 self.inner.get_max_results()
302 }
303 /// <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>
304 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305 self.inner = self.inner.next_token(input.into());
306 self
307 }
308 /// <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>
309 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310 self.inner = self.inner.set_next_token(input);
311 self
312 }
313 /// <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>
314 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
315 self.inner.get_next_token()
316 }
317 /// <p>The <code>originType</code> used to filter package versions. Only package versions with the provided <code>originType</code> will be returned.</p>
318 pub fn origin_type(mut self, input: crate::types::PackageVersionOriginType) -> Self {
319 self.inner = self.inner.origin_type(input);
320 self
321 }
322 /// <p>The <code>originType</code> used to filter package versions. Only package versions with the provided <code>originType</code> will be returned.</p>
323 pub fn set_origin_type(mut self, input: ::std::option::Option<crate::types::PackageVersionOriginType>) -> Self {
324 self.inner = self.inner.set_origin_type(input);
325 self
326 }
327 /// <p>The <code>originType</code> used to filter package versions. Only package versions with the provided <code>originType</code> will be returned.</p>
328 pub fn get_origin_type(&self) -> &::std::option::Option<crate::types::PackageVersionOriginType> {
329 self.inner.get_origin_type()
330 }
331}