aws_sdk_codeartifact/operation/delete_package_versions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_package_versions::_delete_package_versions_output::DeletePackageVersionsOutputBuilder;
3
4pub use crate::operation::delete_package_versions::_delete_package_versions_input::DeletePackageVersionsInputBuilder;
5
6impl crate::operation::delete_package_versions::builders::DeletePackageVersionsInputBuilder {
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::delete_package_versions::DeletePackageVersionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_package_versions::DeletePackageVersionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_package_versions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeletePackageVersions`.
24///
25/// <p>Deletes one or more versions of a package. A deleted package version cannot be restored in your repository. If you want to remove a package version from your repository and be able to restore it later, set its status to <code>Archived</code>. Archived packages cannot be downloaded from a repository and don't show up with list package APIs (for example, <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackageVersions.html">ListPackageVersions</a>), but you can restore them using <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdatePackageVersionsStatus.html">UpdatePackageVersionsStatus</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DeletePackageVersionsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::delete_package_versions::builders::DeletePackageVersionsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::delete_package_versions::DeletePackageVersionsOutput,
35        crate::operation::delete_package_versions::DeletePackageVersionsError,
36    > for DeletePackageVersionsFluentBuilder
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::delete_package_versions::DeletePackageVersionsOutput,
44            crate::operation::delete_package_versions::DeletePackageVersionsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DeletePackageVersionsFluentBuilder {
51    /// Creates a new `DeletePackageVersionsFluentBuilder`.
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 DeletePackageVersions as a reference.
60    pub fn as_input(&self) -> &crate::operation::delete_package_versions::builders::DeletePackageVersionsInputBuilder {
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::delete_package_versions::DeletePackageVersionsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::delete_package_versions::DeletePackageVersionsError,
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::delete_package_versions::DeletePackageVersions::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::delete_package_versions::DeletePackageVersions::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::delete_package_versions::DeletePackageVersionsOutput,
97        crate::operation::delete_package_versions::DeletePackageVersionsError,
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 package to delete.</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 package to delete.</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 package to delete.</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 name of the repository that contains the package versions to delete.</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 name of the repository that contains the package versions to delete.</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 name of the repository that contains the package versions to delete.</p>
150    pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_repository()
152    }
153    /// <p>The format of the package versions to delete.</p>
154    pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
155        self.inner = self.inner.format(input);
156        self
157    }
158    /// <p>The format of the package versions to delete.</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>The format of the package versions to delete.</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 versions to be deleted. The package component that specifies its namespace depends on its type. For example:</p><note>
168    /// <p>The namespace is required when deleting 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 versions to be deleted. The package component that specifies its namespace depends on its type. For example:</p><note>
193    /// <p>The namespace is required when deleting 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 versions to be deleted. The package component that specifies its namespace depends on its type. For example:</p><note>
218    /// <p>The namespace is required when deleting 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 with the versions to delete.</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 with the versions to delete.</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 with the versions to delete.</p>
252    pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
253        self.inner.get_package()
254    }
255    ///
256    /// Appends an item to `versions`.
257    ///
258    /// To override the contents of this collection use [`set_versions`](Self::set_versions).
259    ///
260    /// <p>An array of strings that specify the versions of the package to delete.</p>
261    pub fn versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
262        self.inner = self.inner.versions(input.into());
263        self
264    }
265    /// <p>An array of strings that specify the versions of the package to delete.</p>
266    pub fn set_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
267        self.inner = self.inner.set_versions(input);
268        self
269    }
270    /// <p>An array of strings that specify the versions of the package to delete.</p>
271    pub fn get_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
272        self.inner.get_versions()
273    }
274    /// <p>The expected status of the package version to delete.</p>
275    pub fn expected_status(mut self, input: crate::types::PackageVersionStatus) -> Self {
276        self.inner = self.inner.expected_status(input);
277        self
278    }
279    /// <p>The expected status of the package version to delete.</p>
280    pub fn set_expected_status(mut self, input: ::std::option::Option<crate::types::PackageVersionStatus>) -> Self {
281        self.inner = self.inner.set_expected_status(input);
282        self
283    }
284    /// <p>The expected status of the package version to delete.</p>
285    pub fn get_expected_status(&self) -> &::std::option::Option<crate::types::PackageVersionStatus> {
286        self.inner.get_expected_status()
287    }
288}