aws-sdk-ecr 1.105.0

AWS SDK for Amazon Elastic Container Registry
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 CompleteLayerUploadInput {
    /// <p>The Amazon Web Services account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.</p>
    pub registry_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the repository to associate with the image layer.</p>
    pub repository_name: ::std::option::Option<::std::string::String>,
    /// <p>The upload ID from a previous <code>InitiateLayerUpload</code> operation to associate with the image layer.</p>
    pub upload_id: ::std::option::Option<::std::string::String>,
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub layer_digests: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CompleteLayerUploadInput {
    /// <p>The Amazon Web Services account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.</p>
    pub fn registry_id(&self) -> ::std::option::Option<&str> {
        self.registry_id.as_deref()
    }
    /// <p>The name of the repository to associate with the image layer.</p>
    pub fn repository_name(&self) -> ::std::option::Option<&str> {
        self.repository_name.as_deref()
    }
    /// <p>The upload ID from a previous <code>InitiateLayerUpload</code> operation to associate with the image layer.</p>
    pub fn upload_id(&self) -> ::std::option::Option<&str> {
        self.upload_id.as_deref()
    }
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.layer_digests.is_none()`.
    pub fn layer_digests(&self) -> &[::std::string::String] {
        self.layer_digests.as_deref().unwrap_or_default()
    }
}
impl CompleteLayerUploadInput {
    /// Creates a new builder-style object to manufacture [`CompleteLayerUploadInput`](crate::operation::complete_layer_upload::CompleteLayerUploadInput).
    pub fn builder() -> crate::operation::complete_layer_upload::builders::CompleteLayerUploadInputBuilder {
        crate::operation::complete_layer_upload::builders::CompleteLayerUploadInputBuilder::default()
    }
}

/// A builder for [`CompleteLayerUploadInput`](crate::operation::complete_layer_upload::CompleteLayerUploadInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CompleteLayerUploadInputBuilder {
    pub(crate) registry_id: ::std::option::Option<::std::string::String>,
    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
    pub(crate) upload_id: ::std::option::Option<::std::string::String>,
    pub(crate) layer_digests: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CompleteLayerUploadInputBuilder {
    /// <p>The Amazon Web Services account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.</p>
    pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.registry_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.</p>
    pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.registry_id = input;
        self
    }
    /// <p>The Amazon Web Services account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.</p>
    pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.registry_id
    }
    /// <p>The name of the repository to associate with the image layer.</p>
    /// This field is required.
    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.repository_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the repository to associate with the image layer.</p>
    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.repository_name = input;
        self
    }
    /// <p>The name of the repository to associate with the image layer.</p>
    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.repository_name
    }
    /// <p>The upload ID from a previous <code>InitiateLayerUpload</code> operation to associate with the image layer.</p>
    /// This field is required.
    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.upload_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The upload ID from a previous <code>InitiateLayerUpload</code> operation to associate with the image layer.</p>
    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.upload_id = input;
        self
    }
    /// <p>The upload ID from a previous <code>InitiateLayerUpload</code> operation to associate with the image layer.</p>
    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.upload_id
    }
    /// Appends an item to `layer_digests`.
    ///
    /// To override the contents of this collection use [`set_layer_digests`](Self::set_layer_digests).
    ///
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn layer_digests(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.layer_digests.unwrap_or_default();
        v.push(input.into());
        self.layer_digests = ::std::option::Option::Some(v);
        self
    }
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn set_layer_digests(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.layer_digests = input;
        self
    }
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn get_layer_digests(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.layer_digests
    }
    /// Consumes the builder and constructs a [`CompleteLayerUploadInput`](crate::operation::complete_layer_upload::CompleteLayerUploadInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::complete_layer_upload::CompleteLayerUploadInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::complete_layer_upload::CompleteLayerUploadInput {
            registry_id: self.registry_id,
            repository_name: self.repository_name,
            upload_id: self.upload_id,
            layer_digests: self.layer_digests,
        })
    }
}