aws_sdk_codeartifact/operation/dispose_package_versions/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::dispose_package_versions::_dispose_package_versions_output::DisposePackageVersionsOutputBuilder;
3
4pub use crate::operation::dispose_package_versions::_dispose_package_versions_input::DisposePackageVersionsInputBuilder;
5
6impl crate::operation::dispose_package_versions::builders::DisposePackageVersionsInputBuilder {
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::dispose_package_versions::DisposePackageVersionsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::dispose_package_versions::DisposePackageVersionsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.dispose_package_versions();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DisposePackageVersions`.
24///
25/// <p>Deletes the assets in package versions and sets the package versions' status to <code>Disposed</code>. A disposed package version cannot be restored in your repository because its assets are deleted.</p>
26/// <p>To view all disposed package versions in a repository, use <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackageVersions.html">ListPackageVersions</a> and set the <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackageVersions.html#API_ListPackageVersions_RequestSyntax">status</a> parameter to <code>Disposed</code>.</p>
27/// <p>To view information about a disposed package version, use <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribePackageVersion.html">DescribePackageVersion</a>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct DisposePackageVersionsFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::dispose_package_versions::builders::DisposePackageVersionsInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::dispose_package_versions::DisposePackageVersionsOutput,
37 crate::operation::dispose_package_versions::DisposePackageVersionsError,
38 > for DisposePackageVersionsFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::dispose_package_versions::DisposePackageVersionsOutput,
46 crate::operation::dispose_package_versions::DisposePackageVersionsError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl DisposePackageVersionsFluentBuilder {
53 /// Creates a new `DisposePackageVersionsFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the DisposePackageVersions as a reference.
62 pub fn as_input(&self) -> &crate::operation::dispose_package_versions::builders::DisposePackageVersionsInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::dispose_package_versions::DisposePackageVersionsOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::dispose_package_versions::DisposePackageVersionsError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::dispose_package_versions::DisposePackageVersions::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::dispose_package_versions::DisposePackageVersions::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::dispose_package_versions::DisposePackageVersionsOutput,
99 crate::operation::dispose_package_versions::DisposePackageVersionsError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>The name of the domain that contains the repository you want to dispose.</p>
114 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.domain(input.into());
116 self
117 }
118 /// <p>The name of the domain that contains the repository you want to dispose.</p>
119 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_domain(input);
121 self
122 }
123 /// <p>The name of the domain that contains the repository you want to dispose.</p>
124 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_domain()
126 }
127 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
128 pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.domain_owner(input.into());
130 self
131 }
132 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
133 pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_domain_owner(input);
135 self
136 }
137 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
138 pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
139 self.inner.get_domain_owner()
140 }
141 /// <p>The name of the repository that contains the package versions you want to dispose.</p>
142 pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.repository(input.into());
144 self
145 }
146 /// <p>The name of the repository that contains the package versions you want to dispose.</p>
147 pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_repository(input);
149 self
150 }
151 /// <p>The name of the repository that contains the package versions you want to dispose.</p>
152 pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_repository()
154 }
155 /// <p>A format that specifies the type of package versions you want to dispose.</p>
156 pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
157 self.inner = self.inner.format(input);
158 self
159 }
160 /// <p>A format that specifies the type of package versions you want to dispose.</p>
161 pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
162 self.inner = self.inner.set_format(input);
163 self
164 }
165 /// <p>A format that specifies the type of package versions you want to dispose.</p>
166 pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
167 self.inner.get_format()
168 }
169 /// <p>The namespace of the package versions to be disposed. The package component that specifies its namespace depends on its type. For example:</p><note>
170 /// <p>The namespace is required when disposing package versions of the following formats:</p>
171 /// <ul>
172 /// <li>
173 /// <p>Maven</p></li>
174 /// <li>
175 /// <p>Swift</p></li>
176 /// <li>
177 /// <p>generic</p></li>
178 /// </ul>
179 /// </note>
180 /// <ul>
181 /// <li>
182 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
183 /// <li>
184 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
185 /// <li>
186 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
187 /// <li>
188 /// <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>
189 /// </ul>
190 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.inner = self.inner.namespace(input.into());
192 self
193 }
194 /// <p>The namespace of the package versions to be disposed. The package component that specifies its namespace depends on its type. For example:</p><note>
195 /// <p>The namespace is required when disposing package versions of the following formats:</p>
196 /// <ul>
197 /// <li>
198 /// <p>Maven</p></li>
199 /// <li>
200 /// <p>Swift</p></li>
201 /// <li>
202 /// <p>generic</p></li>
203 /// </ul>
204 /// </note>
205 /// <ul>
206 /// <li>
207 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
208 /// <li>
209 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
210 /// <li>
211 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
212 /// <li>
213 /// <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>
214 /// </ul>
215 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.inner = self.inner.set_namespace(input);
217 self
218 }
219 /// <p>The namespace of the package versions to be disposed. The package component that specifies its namespace depends on its type. For example:</p><note>
220 /// <p>The namespace is required when disposing package versions of the following formats:</p>
221 /// <ul>
222 /// <li>
223 /// <p>Maven</p></li>
224 /// <li>
225 /// <p>Swift</p></li>
226 /// <li>
227 /// <p>generic</p></li>
228 /// </ul>
229 /// </note>
230 /// <ul>
231 /// <li>
232 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
233 /// <li>
234 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
235 /// <li>
236 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
237 /// <li>
238 /// <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>
239 /// </ul>
240 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
241 self.inner.get_namespace()
242 }
243 /// <p>The name of the package with the versions you want to dispose.</p>
244 pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245 self.inner = self.inner.package(input.into());
246 self
247 }
248 /// <p>The name of the package with the versions you want to dispose.</p>
249 pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250 self.inner = self.inner.set_package(input);
251 self
252 }
253 /// <p>The name of the package with the versions you want to dispose.</p>
254 pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
255 self.inner.get_package()
256 }
257 ///
258 /// Appends an item to `versions`.
259 ///
260 /// To override the contents of this collection use [`set_versions`](Self::set_versions).
261 ///
262 /// <p>The versions of the package you want to dispose.</p>
263 pub fn versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264 self.inner = self.inner.versions(input.into());
265 self
266 }
267 /// <p>The versions of the package you want to dispose.</p>
268 pub fn set_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
269 self.inner = self.inner.set_versions(input);
270 self
271 }
272 /// <p>The versions of the package you want to dispose.</p>
273 pub fn get_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
274 self.inner.get_versions()
275 }
276 ///
277 /// Adds a key-value pair to `versionRevisions`.
278 ///
279 /// To override the contents of this collection use [`set_version_revisions`](Self::set_version_revisions).
280 ///
281 /// <p>The revisions of the package versions you want to dispose.</p>
282 pub fn version_revisions(
283 mut self,
284 k: impl ::std::convert::Into<::std::string::String>,
285 v: impl ::std::convert::Into<::std::string::String>,
286 ) -> Self {
287 self.inner = self.inner.version_revisions(k.into(), v.into());
288 self
289 }
290 /// <p>The revisions of the package versions you want to dispose.</p>
291 pub fn set_version_revisions(
292 mut self,
293 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
294 ) -> Self {
295 self.inner = self.inner.set_version_revisions(input);
296 self
297 }
298 /// <p>The revisions of the package versions you want to dispose.</p>
299 pub fn get_version_revisions(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
300 self.inner.get_version_revisions()
301 }
302 /// <p>The expected status of the package version to dispose.</p>
303 pub fn expected_status(mut self, input: crate::types::PackageVersionStatus) -> Self {
304 self.inner = self.inner.expected_status(input);
305 self
306 }
307 /// <p>The expected status of the package version to dispose.</p>
308 pub fn set_expected_status(mut self, input: ::std::option::Option<crate::types::PackageVersionStatus>) -> Self {
309 self.inner = self.inner.set_expected_status(input);
310 self
311 }
312 /// <p>The expected status of the package version to dispose.</p>
313 pub fn get_expected_status(&self) -> &::std::option::Option<crate::types::PackageVersionStatus> {
314 self.inner.get_expected_status()
315 }
316}