aws_sdk_ecrpublic/operation/batch_check_layer_availability/
_batch_check_layer_availability_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct BatchCheckLayerAvailabilityInput {
6    /// <p>The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.</p>
7    pub registry_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the repository that's associated with the image layers to check.</p>
9    pub repository_name: ::std::option::Option<::std::string::String>,
10    /// <p>The digests of the image layers to check.</p>
11    pub layer_digests: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12}
13impl BatchCheckLayerAvailabilityInput {
14    /// <p>The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.</p>
15    pub fn registry_id(&self) -> ::std::option::Option<&str> {
16        self.registry_id.as_deref()
17    }
18    /// <p>The name of the repository that's associated with the image layers to check.</p>
19    pub fn repository_name(&self) -> ::std::option::Option<&str> {
20        self.repository_name.as_deref()
21    }
22    /// <p>The digests of the image layers to check.</p>
23    ///
24    /// 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()`.
25    pub fn layer_digests(&self) -> &[::std::string::String] {
26        self.layer_digests.as_deref().unwrap_or_default()
27    }
28}
29impl BatchCheckLayerAvailabilityInput {
30    /// Creates a new builder-style object to manufacture [`BatchCheckLayerAvailabilityInput`](crate::operation::batch_check_layer_availability::BatchCheckLayerAvailabilityInput).
31    pub fn builder() -> crate::operation::batch_check_layer_availability::builders::BatchCheckLayerAvailabilityInputBuilder {
32        crate::operation::batch_check_layer_availability::builders::BatchCheckLayerAvailabilityInputBuilder::default()
33    }
34}
35
36/// A builder for [`BatchCheckLayerAvailabilityInput`](crate::operation::batch_check_layer_availability::BatchCheckLayerAvailabilityInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct BatchCheckLayerAvailabilityInputBuilder {
40    pub(crate) registry_id: ::std::option::Option<::std::string::String>,
41    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
42    pub(crate) layer_digests: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43}
44impl BatchCheckLayerAvailabilityInputBuilder {
45    /// <p>The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.</p>
46    pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.registry_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.</p>
51    pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.registry_id = input;
53        self
54    }
55    /// <p>The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.</p>
56    pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.registry_id
58    }
59    /// <p>The name of the repository that's associated with the image layers to check.</p>
60    /// This field is required.
61    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.repository_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the repository that's associated with the image layers to check.</p>
66    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.repository_name = input;
68        self
69    }
70    /// <p>The name of the repository that's associated with the image layers to check.</p>
71    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.repository_name
73    }
74    /// Appends an item to `layer_digests`.
75    ///
76    /// To override the contents of this collection use [`set_layer_digests`](Self::set_layer_digests).
77    ///
78    /// <p>The digests of the image layers to check.</p>
79    pub fn layer_digests(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        let mut v = self.layer_digests.unwrap_or_default();
81        v.push(input.into());
82        self.layer_digests = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>The digests of the image layers to check.</p>
86    pub fn set_layer_digests(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
87        self.layer_digests = input;
88        self
89    }
90    /// <p>The digests of the image layers to check.</p>
91    pub fn get_layer_digests(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92        &self.layer_digests
93    }
94    /// Consumes the builder and constructs a [`BatchCheckLayerAvailabilityInput`](crate::operation::batch_check_layer_availability::BatchCheckLayerAvailabilityInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<
98        crate::operation::batch_check_layer_availability::BatchCheckLayerAvailabilityInput,
99        ::aws_smithy_types::error::operation::BuildError,
100    > {
101        ::std::result::Result::Ok(crate::operation::batch_check_layer_availability::BatchCheckLayerAvailabilityInput {
102            registry_id: self.registry_id,
103            repository_name: self.repository_name,
104            layer_digests: self.layer_digests,
105        })
106    }
107}