aws-sdk-codeartifact 1.101.0

AWS SDK for CodeArtifact
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct PublishPackageVersionInput {
    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
    pub domain: ::std::option::Option<::std::string::String>,
    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
    pub domain_owner: ::std::option::Option<::std::string::String>,
    /// <p>The name of the repository that the package version will be published to.</p>
    pub repository: ::std::option::Option<::std::string::String>,
    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
    /// <p>The only supported value is <code>generic</code>.</p>
    pub format: ::std::option::Option<crate::types::PackageFormat>,
    /// <p>The namespace of the package version to publish.</p>
    pub namespace: ::std::option::Option<::std::string::String>,
    /// <p>The name of the package version to publish.</p>
    pub package: ::std::option::Option<::std::string::String>,
    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
    pub package_version: ::std::option::Option<::std::string::String>,
    /// <p>The content of the asset to publish.</p>
    pub asset_content: ::aws_smithy_types::byte_stream::ByteStream,
    /// <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>
    pub asset_name: ::std::option::Option<::std::string::String>,
    /// <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>
    /// <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>
    pub asset_sha256: ::std::option::Option<::std::string::String>,
    /// <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>
    /// <p>Valid values: <code>unfinished</code></p>
    pub unfinished: ::std::option::Option<bool>,
}
impl PublishPackageVersionInput {
    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
    pub fn domain(&self) -> ::std::option::Option<&str> {
        self.domain.as_deref()
    }
    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
    pub fn domain_owner(&self) -> ::std::option::Option<&str> {
        self.domain_owner.as_deref()
    }
    /// <p>The name of the repository that the package version will be published to.</p>
    pub fn repository(&self) -> ::std::option::Option<&str> {
        self.repository.as_deref()
    }
    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
    /// <p>The only supported value is <code>generic</code>.</p>
    pub fn format(&self) -> ::std::option::Option<&crate::types::PackageFormat> {
        self.format.as_ref()
    }
    /// <p>The namespace of the package version to publish.</p>
    pub fn namespace(&self) -> ::std::option::Option<&str> {
        self.namespace.as_deref()
    }
    /// <p>The name of the package version to publish.</p>
    pub fn package(&self) -> ::std::option::Option<&str> {
        self.package.as_deref()
    }
    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
    pub fn package_version(&self) -> ::std::option::Option<&str> {
        self.package_version.as_deref()
    }
    /// <p>The content of the asset to publish.</p>
    pub fn asset_content(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
        &self.asset_content
    }
    /// <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>
    pub fn asset_name(&self) -> ::std::option::Option<&str> {
        self.asset_name.as_deref()
    }
    /// <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>
    /// <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>
    pub fn asset_sha256(&self) -> ::std::option::Option<&str> {
        self.asset_sha256.as_deref()
    }
    /// <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>
    /// <p>Valid values: <code>unfinished</code></p>
    pub fn unfinished(&self) -> ::std::option::Option<bool> {
        self.unfinished
    }
}
impl PublishPackageVersionInput {
    /// Creates a new builder-style object to manufacture [`PublishPackageVersionInput`](crate::operation::publish_package_version::PublishPackageVersionInput).
    pub fn builder() -> crate::operation::publish_package_version::builders::PublishPackageVersionInputBuilder {
        crate::operation::publish_package_version::builders::PublishPackageVersionInputBuilder::default()
    }
}

/// A builder for [`PublishPackageVersionInput`](crate::operation::publish_package_version::PublishPackageVersionInput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PublishPackageVersionInputBuilder {
    pub(crate) domain: ::std::option::Option<::std::string::String>,
    pub(crate) domain_owner: ::std::option::Option<::std::string::String>,
    pub(crate) repository: ::std::option::Option<::std::string::String>,
    pub(crate) format: ::std::option::Option<crate::types::PackageFormat>,
    pub(crate) namespace: ::std::option::Option<::std::string::String>,
    pub(crate) package: ::std::option::Option<::std::string::String>,
    pub(crate) package_version: ::std::option::Option<::std::string::String>,
    pub(crate) asset_content: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
    pub(crate) asset_name: ::std::option::Option<::std::string::String>,
    pub(crate) asset_sha256: ::std::option::Option<::std::string::String>,
    pub(crate) unfinished: ::std::option::Option<bool>,
}
impl PublishPackageVersionInputBuilder {
    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
    /// This field is required.
    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain = input;
        self
    }
    /// <p>The name of the domain that contains the repository that contains the package version to publish.</p>
    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain
    }
    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
    pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_owner = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
    pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_owner = input;
        self
    }
    /// <p>The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.</p>
    pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_owner
    }
    /// <p>The name of the repository that the package version will be published to.</p>
    /// This field is required.
    pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.repository = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the repository that the package version will be published to.</p>
    pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.repository = input;
        self
    }
    /// <p>The name of the repository that the package version will be published to.</p>
    pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
        &self.repository
    }
    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
    /// <p>The only supported value is <code>generic</code>.</p>
    /// This field is required.
    pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
        self.format = ::std::option::Option::Some(input);
        self
    }
    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
    /// <p>The only supported value is <code>generic</code>.</p>
    pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
        self.format = input;
        self
    }
    /// <p>A format that specifies the type of the package version with the requested asset file.</p>
    /// <p>The only supported value is <code>generic</code>.</p>
    pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
        &self.format
    }
    /// <p>The namespace of the package version to publish.</p>
    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.namespace = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The namespace of the package version to publish.</p>
    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.namespace = input;
        self
    }
    /// <p>The namespace of the package version to publish.</p>
    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
        &self.namespace
    }
    /// <p>The name of the package version to publish.</p>
    /// This field is required.
    pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.package = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the package version to publish.</p>
    pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.package = input;
        self
    }
    /// <p>The name of the package version to publish.</p>
    pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
        &self.package
    }
    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
    /// This field is required.
    pub fn package_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.package_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
    pub fn set_package_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.package_version = input;
        self
    }
    /// <p>The package version to publish (for example, <code>3.5.2</code>).</p>
    pub fn get_package_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.package_version
    }
    /// <p>The content of the asset to publish.</p>
    /// This field is required.
    pub fn asset_content(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
        self.asset_content = ::std::option::Option::Some(input);
        self
    }
    /// <p>The content of the asset to publish.</p>
    pub fn set_asset_content(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
        self.asset_content = input;
        self
    }
    /// <p>The content of the asset to publish.</p>
    pub fn get_asset_content(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
        &self.asset_content
    }
    /// <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>
    /// This field is required.
    pub fn asset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asset_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_asset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asset_name = input;
        self
    }
    /// <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>
    pub fn get_asset_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_name
    }
    /// <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>
    /// <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>
    /// This field is required.
    pub fn asset_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asset_sha256 = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    /// <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>
    pub fn set_asset_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asset_sha256 = input;
        self
    }
    /// <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>
    /// <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>
    pub fn get_asset_sha256(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_sha256
    }
    /// <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>
    /// <p>Valid values: <code>unfinished</code></p>
    pub fn unfinished(mut self, input: bool) -> Self {
        self.unfinished = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    /// <p>Valid values: <code>unfinished</code></p>
    pub fn set_unfinished(mut self, input: ::std::option::Option<bool>) -> Self {
        self.unfinished = input;
        self
    }
    /// <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>
    /// <p>Valid values: <code>unfinished</code></p>
    pub fn get_unfinished(&self) -> &::std::option::Option<bool> {
        &self.unfinished
    }
    /// Consumes the builder and constructs a [`PublishPackageVersionInput`](crate::operation::publish_package_version::PublishPackageVersionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::publish_package_version::PublishPackageVersionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::publish_package_version::PublishPackageVersionInput {
            domain: self.domain,
            domain_owner: self.domain_owner,
            repository: self.repository,
            format: self.format,
            namespace: self.namespace,
            package: self.package,
            package_version: self.package_version,
            asset_content: self.asset_content.unwrap_or_default(),
            asset_name: self.asset_name,
            asset_sha256: self.asset_sha256,
            unfinished: self.unfinished,
        })
    }
}