aws_sdk_codeartifact/operation/publish_package_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::publish_package_version::_publish_package_version_output::PublishPackageVersionOutputBuilder;
3
4pub use crate::operation::publish_package_version::_publish_package_version_input::PublishPackageVersionInputBuilder;
5
6impl crate::operation::publish_package_version::builders::PublishPackageVersionInputBuilder {
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::publish_package_version::PublishPackageVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::publish_package_version::PublishPackageVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.publish_package_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PublishPackageVersion`.
24///
25/// <p>Creates a new package version containing one or more assets (or files).</p>
26/// <p>The <code>unfinished</code> flag can be used to keep the package version in the <code>Unfinished</code> state until all of its assets have been uploaded (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/packages-overview.html#package-version-status.html#package-version-status">Package version status</a> in the <i>CodeArtifact user guide</i>). To set the package version’s status to <code>Published</code>, omit the <code>unfinished</code> flag when uploading the final asset, or set the status using <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdatePackageVersionsStatus.html">UpdatePackageVersionStatus</a>. Once a package version’s status is set to <code>Published</code>, it cannot change back to <code>Unfinished</code>.</p><note>
27/// <p>Only generic packages can be published using this API. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/using-generic.html">Using generic packages</a> in the <i>CodeArtifact User Guide</i>.</p>
28/// </note>
29#[derive(::std::fmt::Debug)]
30pub struct PublishPackageVersionFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::publish_package_version::builders::PublishPackageVersionInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::publish_package_version::PublishPackageVersionOutput,
38        crate::operation::publish_package_version::PublishPackageVersionError,
39    > for PublishPackageVersionFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::publish_package_version::PublishPackageVersionOutput,
47            crate::operation::publish_package_version::PublishPackageVersionError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl PublishPackageVersionFluentBuilder {
54    /// Creates a new `PublishPackageVersionFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the PublishPackageVersion as a reference.
63    pub fn as_input(&self) -> &crate::operation::publish_package_version::builders::PublishPackageVersionInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::publish_package_version::PublishPackageVersionOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::publish_package_version::PublishPackageVersionError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::publish_package_version::PublishPackageVersion::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::publish_package_version::PublishPackageVersion::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::publish_package_version::PublishPackageVersionOutput,
100        crate::operation::publish_package_version::PublishPackageVersionError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
115    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.domain(input.into());
117        self
118    }
119    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
120    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_domain(input);
122        self
123    }
124    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
125    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_domain()
127    }
128    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
129    pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.domain_owner(input.into());
131        self
132    }
133    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
134    pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_domain_owner(input);
136        self
137    }
138    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
139    pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_domain_owner()
141    }
142    /// <p>The name of the repository that the package version will be published to.</p>
143    pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.repository(input.into());
145        self
146    }
147    /// <p>The name of the repository that the package version will be published to.</p>
148    pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_repository(input);
150        self
151    }
152    /// <p>The name of the repository that the package version will be published to.</p>
153    pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_repository()
155    }
156    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
157    /// <p>The only supported value is <code>generic</code>.</p>
158    pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
159        self.inner = self.inner.format(input);
160        self
161    }
162    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
163    /// <p>The only supported value is <code>generic</code>.</p>
164    pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
165        self.inner = self.inner.set_format(input);
166        self
167    }
168    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
169    /// <p>The only supported value is <code>generic</code>.</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 version to publish.</p>
174    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.inner = self.inner.namespace(input.into());
176        self
177    }
178    /// <p>The namespace of the package version to publish.</p>
179    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.inner = self.inner.set_namespace(input);
181        self
182    }
183    /// <p>The namespace of the package version to publish.</p>
184    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
185        self.inner.get_namespace()
186    }
187    /// <p>The name of the package version to publish.</p>
188    pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.inner = self.inner.package(input.into());
190        self
191    }
192    /// <p>The name of the package version to publish.</p>
193    pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.inner = self.inner.set_package(input);
195        self
196    }
197    /// <p>The name of the package version to publish.</p>
198    pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
199        self.inner.get_package()
200    }
201    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
202    pub fn package_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        self.inner = self.inner.package_version(input.into());
204        self
205    }
206    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
207    pub fn set_package_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208        self.inner = self.inner.set_package_version(input);
209        self
210    }
211    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
212    pub fn get_package_version(&self) -> &::std::option::Option<::std::string::String> {
213        self.inner.get_package_version()
214    }
215    /// <p>The content of the asset to publish.</p>
216    pub fn asset_content(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
217        self.inner = self.inner.asset_content(input);
218        self
219    }
220    /// <p>The content of the asset to publish.</p>
221    pub fn set_asset_content(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
222        self.inner = self.inner.set_asset_content(input);
223        self
224    }
225    /// <p>The content of the asset to publish.</p>
226    pub fn get_asset_content(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
227        self.inner.get_asset_content()
228    }
229    /// <p>The name of the asset to publish. Asset names can include Unicode letters and numbers, and the following special characters: <code>~ ! @ ^ &amp; ( ) - ` _ + \[ \] { } ; , . `</code></p>
230    pub fn asset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.inner = self.inner.asset_name(input.into());
232        self
233    }
234    /// <p>The name of the asset to publish. Asset names can include Unicode letters and numbers, and the following special characters: <code>~ ! @ ^ &amp; ( ) - ` _ + \[ \] { } ; , . `</code></p>
235    pub fn set_asset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.inner = self.inner.set_asset_name(input);
237        self
238    }
239    /// <p>The name of the asset to publish. Asset names can include Unicode letters and numbers, and the following special characters: <code>~ ! @ ^ &amp; ( ) - ` _ + \[ \] { } ; , . `</code></p>
240    pub fn get_asset_name(&self) -> &::std::option::Option<::std::string::String> {
241        self.inner.get_asset_name()
242    }
243    /// <p>The SHA256 hash of the <code>assetContent</code> to publish. This value must be calculated by the caller and provided with the request (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/using-generic.html#publishing-generic-packages">Publishing a generic package</a> in the <i>CodeArtifact User Guide</i>).</p>
244    /// <p>This value is used as an integrity check to verify that the <code>assetContent</code> has not changed after it was originally sent.</p>
245    pub fn asset_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246        self.inner = self.inner.asset_sha256(input.into());
247        self
248    }
249    /// <p>The SHA256 hash of the <code>assetContent</code> to publish. This value must be calculated by the caller and provided with the request (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/using-generic.html#publishing-generic-packages">Publishing a generic package</a> in the <i>CodeArtifact User Guide</i>).</p>
250    /// <p>This value is used as an integrity check to verify that the <code>assetContent</code> has not changed after it was originally sent.</p>
251    pub fn set_asset_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252        self.inner = self.inner.set_asset_sha256(input);
253        self
254    }
255    /// <p>The SHA256 hash of the <code>assetContent</code> to publish. This value must be calculated by the caller and provided with the request (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/using-generic.html#publishing-generic-packages">Publishing a generic package</a> in the <i>CodeArtifact User Guide</i>).</p>
256    /// <p>This value is used as an integrity check to verify that the <code>assetContent</code> has not changed after it was originally sent.</p>
257    pub fn get_asset_sha256(&self) -> &::std::option::Option<::std::string::String> {
258        self.inner.get_asset_sha256()
259    }
260    /// <p>Specifies whether the package version should remain in the <code>unfinished</code> state. If omitted, the package version status will be set to <code>Published</code> (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/packages-overview.html#package-version-status">Package version status</a> in the <i>CodeArtifact User Guide</i>).</p>
261    /// <p>Valid values: <code>unfinished</code></p>
262    pub fn unfinished(mut self, input: bool) -> Self {
263        self.inner = self.inner.unfinished(input);
264        self
265    }
266    /// <p>Specifies whether the package version should remain in the <code>unfinished</code> state. If omitted, the package version status will be set to <code>Published</code> (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/packages-overview.html#package-version-status">Package version status</a> in the <i>CodeArtifact User Guide</i>).</p>
267    /// <p>Valid values: <code>unfinished</code></p>
268    pub fn set_unfinished(mut self, input: ::std::option::Option<bool>) -> Self {
269        self.inner = self.inner.set_unfinished(input);
270        self
271    }
272    /// <p>Specifies whether the package version should remain in the <code>unfinished</code> state. If omitted, the package version status will be set to <code>Published</code> (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/packages-overview.html#package-version-status">Package version status</a> in the <i>CodeArtifact User Guide</i>).</p>
273    /// <p>Valid values: <code>unfinished</code></p>
274    pub fn get_unfinished(&self) -> &::std::option::Option<bool> {
275        self.inner.get_unfinished()
276    }
277}