Skip to main content

aws_sdk_lightsail/operation/register_container_image/
_register_container_image_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 RegisterContainerImageInput {
6    /// <p>The name of the container service for which to register a container image.</p>
7    pub service_name: ::std::option::Option<::std::string::String>,
8    /// <p>The label for the container image when it's registered to the container service.</p>
9    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
10    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
11    /// <ul>
12    /// <li>
13    /// <p><code>:container-service-1.<imagelabel>
14    /// .1
15    /// </imagelabel></code></p></li>
16    /// </ul>
17    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
18    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
19    pub label: ::std::option::Option<::std::string::String>,
20    /// <p>The digest of the container image to be registered.</p>
21    pub digest: ::std::option::Option<::std::string::String>,
22}
23impl RegisterContainerImageInput {
24    /// <p>The name of the container service for which to register a container image.</p>
25    pub fn service_name(&self) -> ::std::option::Option<&str> {
26        self.service_name.as_deref()
27    }
28    /// <p>The label for the container image when it's registered to the container service.</p>
29    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
30    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
31    /// <ul>
32    /// <li>
33    /// <p><code>:container-service-1.<imagelabel>
34    /// .1
35    /// </imagelabel></code></p></li>
36    /// </ul>
37    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
38    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
39    pub fn label(&self) -> ::std::option::Option<&str> {
40        self.label.as_deref()
41    }
42    /// <p>The digest of the container image to be registered.</p>
43    pub fn digest(&self) -> ::std::option::Option<&str> {
44        self.digest.as_deref()
45    }
46}
47impl RegisterContainerImageInput {
48    /// Creates a new builder-style object to manufacture [`RegisterContainerImageInput`](crate::operation::register_container_image::RegisterContainerImageInput).
49    pub fn builder() -> crate::operation::register_container_image::builders::RegisterContainerImageInputBuilder {
50        crate::operation::register_container_image::builders::RegisterContainerImageInputBuilder::default()
51    }
52}
53
54/// A builder for [`RegisterContainerImageInput`](crate::operation::register_container_image::RegisterContainerImageInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct RegisterContainerImageInputBuilder {
58    pub(crate) service_name: ::std::option::Option<::std::string::String>,
59    pub(crate) label: ::std::option::Option<::std::string::String>,
60    pub(crate) digest: ::std::option::Option<::std::string::String>,
61}
62impl RegisterContainerImageInputBuilder {
63    /// <p>The name of the container service for which to register a container image.</p>
64    /// This field is required.
65    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.service_name = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The name of the container service for which to register a container image.</p>
70    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.service_name = input;
72        self
73    }
74    /// <p>The name of the container service for which to register a container image.</p>
75    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
76        &self.service_name
77    }
78    /// <p>The label for the container image when it's registered to the container service.</p>
79    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
80    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
81    /// <ul>
82    /// <li>
83    /// <p><code>:container-service-1.<imagelabel>
84    /// .1
85    /// </imagelabel></code></p></li>
86    /// </ul>
87    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
88    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
89    /// This field is required.
90    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.label = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The label for the container image when it's registered to the container service.</p>
95    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
96    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
97    /// <ul>
98    /// <li>
99    /// <p><code>:container-service-1.<imagelabel>
100    /// .1
101    /// </imagelabel></code></p></li>
102    /// </ul>
103    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
104    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
105    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.label = input;
107        self
108    }
109    /// <p>The label for the container image when it's registered to the container service.</p>
110    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
111    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
112    /// <ul>
113    /// <li>
114    /// <p><code>:container-service-1.<imagelabel>
115    /// .1
116    /// </imagelabel></code></p></li>
117    /// </ul>
118    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
119    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
120    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
121        &self.label
122    }
123    /// <p>The digest of the container image to be registered.</p>
124    /// This field is required.
125    pub fn digest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.digest = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The digest of the container image to be registered.</p>
130    pub fn set_digest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.digest = input;
132        self
133    }
134    /// <p>The digest of the container image to be registered.</p>
135    pub fn get_digest(&self) -> &::std::option::Option<::std::string::String> {
136        &self.digest
137    }
138    /// Consumes the builder and constructs a [`RegisterContainerImageInput`](crate::operation::register_container_image::RegisterContainerImageInput).
139    pub fn build(
140        self,
141    ) -> ::std::result::Result<
142        crate::operation::register_container_image::RegisterContainerImageInput,
143        ::aws_smithy_types::error::operation::BuildError,
144    > {
145        ::std::result::Result::Ok(crate::operation::register_container_image::RegisterContainerImageInput {
146            service_name: self.service_name,
147            label: self.label,
148            digest: self.digest,
149        })
150    }
151}