aws_sdk_codeartifact/operation/update_package_versions_status/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_package_versions_status::_update_package_versions_status_output::UpdatePackageVersionsStatusOutputBuilder;
3
4pub use crate::operation::update_package_versions_status::_update_package_versions_status_input::UpdatePackageVersionsStatusInputBuilder;
5
6impl crate::operation::update_package_versions_status::builders::UpdatePackageVersionsStatusInputBuilder {
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::update_package_versions_status::UpdatePackageVersionsStatusOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_package_versions_status::UpdatePackageVersionsStatusError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_package_versions_status();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdatePackageVersionsStatus`.
24///
25/// <p>Updates the status of one or more versions of a package. Using <code>UpdatePackageVersionsStatus</code>, you can update the status of package versions to <code>Archived</code>, <code>Published</code>, or <code>Unlisted</code>. To set the status of a package version to <code>Disposed</code>, use <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisposePackageVersions.html">DisposePackageVersions</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdatePackageVersionsStatusFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_package_versions_status::builders::UpdatePackageVersionsStatusInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_package_versions_status::UpdatePackageVersionsStatusOutput,
35        crate::operation::update_package_versions_status::UpdatePackageVersionsStatusError,
36    > for UpdatePackageVersionsStatusFluentBuilder
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::update_package_versions_status::UpdatePackageVersionsStatusOutput,
44            crate::operation::update_package_versions_status::UpdatePackageVersionsStatusError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdatePackageVersionsStatusFluentBuilder {
51    /// Creates a new `UpdatePackageVersionsStatusFluentBuilder`.
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 UpdatePackageVersionsStatus as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_package_versions_status::builders::UpdatePackageVersionsStatusInputBuilder {
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::update_package_versions_status::UpdatePackageVersionsStatusOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_package_versions_status::UpdatePackageVersionsStatusError,
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::update_package_versions_status::UpdatePackageVersionsStatus::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_package_versions_status::UpdatePackageVersionsStatus::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::update_package_versions_status::UpdatePackageVersionsStatusOutput,
97        crate::operation::update_package_versions_status::UpdatePackageVersionsStatusError,
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 versions with a status to be updated.</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 versions with a status to be updated.</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 versions with a status to be updated.</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 versions with the status you want to update.</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 versions with the status you want to update.</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 versions with the status you want to update.</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 with the statuses to update.</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 with the statuses to update.</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 with the statuses to update.</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 to be updated. The package component that specifies its namespace depends on its type. For example:</p>
168    /// <ul>
169    /// <li>
170    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
171    /// <li>
172    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
173    /// <li>
174    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
175    /// <li>
176    /// <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>
177    /// </ul>
178    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.namespace(input.into());
180        self
181    }
182    /// <p>The namespace of the package version to be updated. The package component that specifies its namespace depends on its type. For example:</p>
183    /// <ul>
184    /// <li>
185    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
186    /// <li>
187    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
188    /// <li>
189    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
190    /// <li>
191    /// <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>
192    /// </ul>
193    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.inner = self.inner.set_namespace(input);
195        self
196    }
197    /// <p>The namespace of the package version to be updated. The package component that specifies its namespace depends on its type. For example:</p>
198    /// <ul>
199    /// <li>
200    /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
201    /// <li>
202    /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
203    /// <li>
204    /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
205    /// <li>
206    /// <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>
207    /// </ul>
208    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_namespace()
210    }
211    /// <p>The name of the package with the version statuses to update.</p>
212    pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.package(input.into());
214        self
215    }
216    /// <p>The name of the package with the version statuses to update.</p>
217    pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_package(input);
219        self
220    }
221    /// <p>The name of the package with the version statuses to update.</p>
222    pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_package()
224    }
225    ///
226    /// Appends an item to `versions`.
227    ///
228    /// To override the contents of this collection use [`set_versions`](Self::set_versions).
229    ///
230    /// <p>An array of strings that specify the versions of the package with the statuses to update.</p>
231    pub fn versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.versions(input.into());
233        self
234    }
235    /// <p>An array of strings that specify the versions of the package with the statuses to update.</p>
236    pub fn set_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
237        self.inner = self.inner.set_versions(input);
238        self
239    }
240    /// <p>An array of strings that specify the versions of the package with the statuses to update.</p>
241    pub fn get_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
242        self.inner.get_versions()
243    }
244    ///
245    /// Adds a key-value pair to `versionRevisions`.
246    ///
247    /// To override the contents of this collection use [`set_version_revisions`](Self::set_version_revisions).
248    ///
249    /// <p>A map of package versions and package version revisions. The map <code>key</code> is the package version (for example, <code>3.5.2</code>), and the map <code>value</code> is the package version revision.</p>
250    pub fn version_revisions(
251        mut self,
252        k: impl ::std::convert::Into<::std::string::String>,
253        v: impl ::std::convert::Into<::std::string::String>,
254    ) -> Self {
255        self.inner = self.inner.version_revisions(k.into(), v.into());
256        self
257    }
258    /// <p>A map of package versions and package version revisions. The map <code>key</code> is the package version (for example, <code>3.5.2</code>), and the map <code>value</code> is the package version revision.</p>
259    pub fn set_version_revisions(
260        mut self,
261        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
262    ) -> Self {
263        self.inner = self.inner.set_version_revisions(input);
264        self
265    }
266    /// <p>A map of package versions and package version revisions. The map <code>key</code> is the package version (for example, <code>3.5.2</code>), and the map <code>value</code> is the package version revision.</p>
267    pub fn get_version_revisions(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
268        self.inner.get_version_revisions()
269    }
270    /// <p>The package version’s expected status before it is updated. If <code>expectedStatus</code> is provided, the package version's status is updated only if its status at the time <code>UpdatePackageVersionsStatus</code> is called matches <code>expectedStatus</code>.</p>
271    pub fn expected_status(mut self, input: crate::types::PackageVersionStatus) -> Self {
272        self.inner = self.inner.expected_status(input);
273        self
274    }
275    /// <p>The package version’s expected status before it is updated. If <code>expectedStatus</code> is provided, the package version's status is updated only if its status at the time <code>UpdatePackageVersionsStatus</code> is called matches <code>expectedStatus</code>.</p>
276    pub fn set_expected_status(mut self, input: ::std::option::Option<crate::types::PackageVersionStatus>) -> Self {
277        self.inner = self.inner.set_expected_status(input);
278        self
279    }
280    /// <p>The package version’s expected status before it is updated. If <code>expectedStatus</code> is provided, the package version's status is updated only if its status at the time <code>UpdatePackageVersionsStatus</code> is called matches <code>expectedStatus</code>.</p>
281    pub fn get_expected_status(&self) -> &::std::option::Option<crate::types::PackageVersionStatus> {
282        self.inner.get_expected_status()
283    }
284    /// <p>The status you want to change the package version status to.</p>
285    pub fn target_status(mut self, input: crate::types::PackageVersionStatus) -> Self {
286        self.inner = self.inner.target_status(input);
287        self
288    }
289    /// <p>The status you want to change the package version status to.</p>
290    pub fn set_target_status(mut self, input: ::std::option::Option<crate::types::PackageVersionStatus>) -> Self {
291        self.inner = self.inner.set_target_status(input);
292        self
293    }
294    /// <p>The status you want to change the package version status to.</p>
295    pub fn get_target_status(&self) -> &::std::option::Option<crate::types::PackageVersionStatus> {
296        self.inner.get_target_status()
297    }
298}