aws-sdk-codeartifact 1.100.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::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DisposePackageVersionsOutput {
    /// <p>A list of the package versions that were successfully disposed.</p>
    pub successful_versions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SuccessfulPackageVersionInfo>>,
    /// <p>A <code>PackageVersionError</code> object that contains a map of errors codes for the disposed package versions that failed. The possible error codes are:</p>
    /// <ul>
    /// <li>
    /// <p><code>ALREADY_EXISTS</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_REVISION</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_STATUS</code></p></li>
    /// <li>
    /// <p><code>NOT_ALLOWED</code></p></li>
    /// <li>
    /// <p><code>NOT_FOUND</code></p></li>
    /// <li>
    /// <p><code>SKIPPED</code></p></li>
    /// </ul>
    pub failed_versions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PackageVersionError>>,
    _request_id: Option<String>,
}
impl DisposePackageVersionsOutput {
    /// <p>A list of the package versions that were successfully disposed.</p>
    pub fn successful_versions(
        &self,
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::SuccessfulPackageVersionInfo>> {
        self.successful_versions.as_ref()
    }
    /// <p>A <code>PackageVersionError</code> object that contains a map of errors codes for the disposed package versions that failed. The possible error codes are:</p>
    /// <ul>
    /// <li>
    /// <p><code>ALREADY_EXISTS</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_REVISION</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_STATUS</code></p></li>
    /// <li>
    /// <p><code>NOT_ALLOWED</code></p></li>
    /// <li>
    /// <p><code>NOT_FOUND</code></p></li>
    /// <li>
    /// <p><code>SKIPPED</code></p></li>
    /// </ul>
    pub fn failed_versions(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::PackageVersionError>> {
        self.failed_versions.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for DisposePackageVersionsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DisposePackageVersionsOutput {
    /// Creates a new builder-style object to manufacture [`DisposePackageVersionsOutput`](crate::operation::dispose_package_versions::DisposePackageVersionsOutput).
    pub fn builder() -> crate::operation::dispose_package_versions::builders::DisposePackageVersionsOutputBuilder {
        crate::operation::dispose_package_versions::builders::DisposePackageVersionsOutputBuilder::default()
    }
}

/// A builder for [`DisposePackageVersionsOutput`](crate::operation::dispose_package_versions::DisposePackageVersionsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DisposePackageVersionsOutputBuilder {
    pub(crate) successful_versions:
        ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SuccessfulPackageVersionInfo>>,
    pub(crate) failed_versions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PackageVersionError>>,
    _request_id: Option<String>,
}
impl DisposePackageVersionsOutputBuilder {
    /// Adds a key-value pair to `successful_versions`.
    ///
    /// To override the contents of this collection use [`set_successful_versions`](Self::set_successful_versions).
    ///
    /// <p>A list of the package versions that were successfully disposed.</p>
    pub fn successful_versions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::SuccessfulPackageVersionInfo) -> Self {
        let mut hash_map = self.successful_versions.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.successful_versions = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A list of the package versions that were successfully disposed.</p>
    pub fn set_successful_versions(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SuccessfulPackageVersionInfo>>,
    ) -> Self {
        self.successful_versions = input;
        self
    }
    /// <p>A list of the package versions that were successfully disposed.</p>
    pub fn get_successful_versions(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SuccessfulPackageVersionInfo>> {
        &self.successful_versions
    }
    /// Adds a key-value pair to `failed_versions`.
    ///
    /// To override the contents of this collection use [`set_failed_versions`](Self::set_failed_versions).
    ///
    /// <p>A <code>PackageVersionError</code> object that contains a map of errors codes for the disposed package versions that failed. The possible error codes are:</p>
    /// <ul>
    /// <li>
    /// <p><code>ALREADY_EXISTS</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_REVISION</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_STATUS</code></p></li>
    /// <li>
    /// <p><code>NOT_ALLOWED</code></p></li>
    /// <li>
    /// <p><code>NOT_FOUND</code></p></li>
    /// <li>
    /// <p><code>SKIPPED</code></p></li>
    /// </ul>
    pub fn failed_versions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PackageVersionError) -> Self {
        let mut hash_map = self.failed_versions.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.failed_versions = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A <code>PackageVersionError</code> object that contains a map of errors codes for the disposed package versions that failed. The possible error codes are:</p>
    /// <ul>
    /// <li>
    /// <p><code>ALREADY_EXISTS</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_REVISION</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_STATUS</code></p></li>
    /// <li>
    /// <p><code>NOT_ALLOWED</code></p></li>
    /// <li>
    /// <p><code>NOT_FOUND</code></p></li>
    /// <li>
    /// <p><code>SKIPPED</code></p></li>
    /// </ul>
    pub fn set_failed_versions(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PackageVersionError>>,
    ) -> Self {
        self.failed_versions = input;
        self
    }
    /// <p>A <code>PackageVersionError</code> object that contains a map of errors codes for the disposed package versions that failed. The possible error codes are:</p>
    /// <ul>
    /// <li>
    /// <p><code>ALREADY_EXISTS</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_REVISION</code></p></li>
    /// <li>
    /// <p><code>MISMATCHED_STATUS</code></p></li>
    /// <li>
    /// <p><code>NOT_ALLOWED</code></p></li>
    /// <li>
    /// <p><code>NOT_FOUND</code></p></li>
    /// <li>
    /// <p><code>SKIPPED</code></p></li>
    /// </ul>
    pub fn get_failed_versions(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PackageVersionError>> {
        &self.failed_versions
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DisposePackageVersionsOutput`](crate::operation::dispose_package_versions::DisposePackageVersionsOutput).
    pub fn build(self) -> crate::operation::dispose_package_versions::DisposePackageVersionsOutput {
        crate::operation::dispose_package_versions::DisposePackageVersionsOutput {
            successful_versions: self.successful_versions,
            failed_versions: self.failed_versions,
            _request_id: self._request_id,
        }
    }
}