aws_sdk_ecr/operation/put_image/
_put_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 PutImageInput {
6    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.</p>
7    pub registry_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the repository in which to put the image.</p>
9    pub repository_name: ::std::option::Option<::std::string::String>,
10    /// <p>The image manifest corresponding to the image to be uploaded.</p>
11    pub image_manifest: ::std::option::Option<::std::string::String>,
12    /// <p>The media type of the image manifest. If you push an image manifest that does not contain the <code>mediaType</code> field, you must specify the <code>imageManifestMediaType</code> in the request.</p>
13    pub image_manifest_media_type: ::std::option::Option<::std::string::String>,
14    /// <p>The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.</p>
15    pub image_tag: ::std::option::Option<::std::string::String>,
16    /// <p>The image digest of the image manifest corresponding to the image.</p>
17    pub image_digest: ::std::option::Option<::std::string::String>,
18}
19impl PutImageInput {
20    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.</p>
21    pub fn registry_id(&self) -> ::std::option::Option<&str> {
22        self.registry_id.as_deref()
23    }
24    /// <p>The name of the repository in which to put the image.</p>
25    pub fn repository_name(&self) -> ::std::option::Option<&str> {
26        self.repository_name.as_deref()
27    }
28    /// <p>The image manifest corresponding to the image to be uploaded.</p>
29    pub fn image_manifest(&self) -> ::std::option::Option<&str> {
30        self.image_manifest.as_deref()
31    }
32    /// <p>The media type of the image manifest. If you push an image manifest that does not contain the <code>mediaType</code> field, you must specify the <code>imageManifestMediaType</code> in the request.</p>
33    pub fn image_manifest_media_type(&self) -> ::std::option::Option<&str> {
34        self.image_manifest_media_type.as_deref()
35    }
36    /// <p>The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.</p>
37    pub fn image_tag(&self) -> ::std::option::Option<&str> {
38        self.image_tag.as_deref()
39    }
40    /// <p>The image digest of the image manifest corresponding to the image.</p>
41    pub fn image_digest(&self) -> ::std::option::Option<&str> {
42        self.image_digest.as_deref()
43    }
44}
45impl PutImageInput {
46    /// Creates a new builder-style object to manufacture [`PutImageInput`](crate::operation::put_image::PutImageInput).
47    pub fn builder() -> crate::operation::put_image::builders::PutImageInputBuilder {
48        crate::operation::put_image::builders::PutImageInputBuilder::default()
49    }
50}
51
52/// A builder for [`PutImageInput`](crate::operation::put_image::PutImageInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct PutImageInputBuilder {
56    pub(crate) registry_id: ::std::option::Option<::std::string::String>,
57    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
58    pub(crate) image_manifest: ::std::option::Option<::std::string::String>,
59    pub(crate) image_manifest_media_type: ::std::option::Option<::std::string::String>,
60    pub(crate) image_tag: ::std::option::Option<::std::string::String>,
61    pub(crate) image_digest: ::std::option::Option<::std::string::String>,
62}
63impl PutImageInputBuilder {
64    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.</p>
65    pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.registry_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.</p>
70    pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.registry_id = input;
72        self
73    }
74    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.</p>
75    pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.registry_id
77    }
78    /// <p>The name of the repository in which to put the image.</p>
79    /// This field is required.
80    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.repository_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the repository in which to put the image.</p>
85    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.repository_name = input;
87        self
88    }
89    /// <p>The name of the repository in which to put the image.</p>
90    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.repository_name
92    }
93    /// <p>The image manifest corresponding to the image to be uploaded.</p>
94    /// This field is required.
95    pub fn image_manifest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.image_manifest = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The image manifest corresponding to the image to be uploaded.</p>
100    pub fn set_image_manifest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.image_manifest = input;
102        self
103    }
104    /// <p>The image manifest corresponding to the image to be uploaded.</p>
105    pub fn get_image_manifest(&self) -> &::std::option::Option<::std::string::String> {
106        &self.image_manifest
107    }
108    /// <p>The media type of the image manifest. If you push an image manifest that does not contain the <code>mediaType</code> field, you must specify the <code>imageManifestMediaType</code> in the request.</p>
109    pub fn image_manifest_media_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.image_manifest_media_type = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The media type of the image manifest. If you push an image manifest that does not contain the <code>mediaType</code> field, you must specify the <code>imageManifestMediaType</code> in the request.</p>
114    pub fn set_image_manifest_media_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.image_manifest_media_type = input;
116        self
117    }
118    /// <p>The media type of the image manifest. If you push an image manifest that does not contain the <code>mediaType</code> field, you must specify the <code>imageManifestMediaType</code> in the request.</p>
119    pub fn get_image_manifest_media_type(&self) -> &::std::option::Option<::std::string::String> {
120        &self.image_manifest_media_type
121    }
122    /// <p>The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.</p>
123    pub fn image_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.image_tag = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.</p>
128    pub fn set_image_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.image_tag = input;
130        self
131    }
132    /// <p>The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.</p>
133    pub fn get_image_tag(&self) -> &::std::option::Option<::std::string::String> {
134        &self.image_tag
135    }
136    /// <p>The image digest of the image manifest corresponding to the image.</p>
137    pub fn image_digest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.image_digest = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The image digest of the image manifest corresponding to the image.</p>
142    pub fn set_image_digest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.image_digest = input;
144        self
145    }
146    /// <p>The image digest of the image manifest corresponding to the image.</p>
147    pub fn get_image_digest(&self) -> &::std::option::Option<::std::string::String> {
148        &self.image_digest
149    }
150    /// Consumes the builder and constructs a [`PutImageInput`](crate::operation::put_image::PutImageInput).
151    pub fn build(self) -> ::std::result::Result<crate::operation::put_image::PutImageInput, ::aws_smithy_types::error::operation::BuildError> {
152        ::std::result::Result::Ok(crate::operation::put_image::PutImageInput {
153            registry_id: self.registry_id,
154            repository_name: self.repository_name,
155            image_manifest: self.image_manifest,
156            image_manifest_media_type: self.image_manifest_media_type,
157            image_tag: self.image_tag,
158            image_digest: self.image_digest,
159        })
160    }
161}