aws-sdk-ecr 1.114.0

AWS SDK for Amazon Elastic Container Registry
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An object representing an Amazon ECR image layer.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Layer {
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub layer_digest: ::std::option::Option<::std::string::String>,
    /// <p>The availability status of the image layer.</p>
    pub layer_availability: ::std::option::Option<crate::types::LayerAvailability>,
    /// <p>The size, in bytes, of the image layer.</p>
    pub layer_size: ::std::option::Option<i64>,
    /// <p>The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.</p>
    pub media_type: ::std::option::Option<::std::string::String>,
}
impl Layer {
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn layer_digest(&self) -> ::std::option::Option<&str> {
        self.layer_digest.as_deref()
    }
    /// <p>The availability status of the image layer.</p>
    pub fn layer_availability(&self) -> ::std::option::Option<&crate::types::LayerAvailability> {
        self.layer_availability.as_ref()
    }
    /// <p>The size, in bytes, of the image layer.</p>
    pub fn layer_size(&self) -> ::std::option::Option<i64> {
        self.layer_size
    }
    /// <p>The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.</p>
    pub fn media_type(&self) -> ::std::option::Option<&str> {
        self.media_type.as_deref()
    }
}
impl Layer {
    /// Creates a new builder-style object to manufacture [`Layer`](crate::types::Layer).
    pub fn builder() -> crate::types::builders::LayerBuilder {
        crate::types::builders::LayerBuilder::default()
    }
}

/// A builder for [`Layer`](crate::types::Layer).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LayerBuilder {
    pub(crate) layer_digest: ::std::option::Option<::std::string::String>,
    pub(crate) layer_availability: ::std::option::Option<crate::types::LayerAvailability>,
    pub(crate) layer_size: ::std::option::Option<i64>,
    pub(crate) media_type: ::std::option::Option<::std::string::String>,
}
impl LayerBuilder {
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn layer_digest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.layer_digest = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn set_layer_digest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.layer_digest = input;
        self
    }
    /// <p>The <code>sha256</code> digest of the image layer.</p>
    pub fn get_layer_digest(&self) -> &::std::option::Option<::std::string::String> {
        &self.layer_digest
    }
    /// <p>The availability status of the image layer.</p>
    pub fn layer_availability(mut self, input: crate::types::LayerAvailability) -> Self {
        self.layer_availability = ::std::option::Option::Some(input);
        self
    }
    /// <p>The availability status of the image layer.</p>
    pub fn set_layer_availability(mut self, input: ::std::option::Option<crate::types::LayerAvailability>) -> Self {
        self.layer_availability = input;
        self
    }
    /// <p>The availability status of the image layer.</p>
    pub fn get_layer_availability(&self) -> &::std::option::Option<crate::types::LayerAvailability> {
        &self.layer_availability
    }
    /// <p>The size, in bytes, of the image layer.</p>
    pub fn layer_size(mut self, input: i64) -> Self {
        self.layer_size = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size, in bytes, of the image layer.</p>
    pub fn set_layer_size(mut self, input: ::std::option::Option<i64>) -> Self {
        self.layer_size = input;
        self
    }
    /// <p>The size, in bytes, of the image layer.</p>
    pub fn get_layer_size(&self) -> &::std::option::Option<i64> {
        &self.layer_size
    }
    /// <p>The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.</p>
    pub fn media_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.media_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.</p>
    pub fn set_media_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.media_type = input;
        self
    }
    /// <p>The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.</p>
    pub fn get_media_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.media_type
    }
    /// Consumes the builder and constructs a [`Layer`](crate::types::Layer).
    pub fn build(self) -> crate::types::Layer {
        crate::types::Layer {
            layer_digest: self.layer_digest,
            layer_availability: self.layer_availability,
            layer_size: self.layer_size,
            media_type: self.media_type,
        }
    }
}