aws_sdk_ecr/operation/put_image/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_image::_put_image_output::PutImageOutputBuilder;
3
4pub use crate::operation::put_image::_put_image_input::PutImageInputBuilder;
5
6impl crate::operation::put_image::builders::PutImageInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::put_image::PutImageOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_image::PutImageError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_image();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutImage`.
24///
25/// <p>Creates or updates the image manifest and tags associated with an image.</p>
26/// <p>When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image.</p><note>
27/// <p>This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the <code>docker</code> CLI to pull, tag, and push images.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct PutImageFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::put_image::builders::PutImageInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl crate::client::customize::internal::CustomizableSend<crate::operation::put_image::PutImageOutput, crate::operation::put_image::PutImageError>
36    for PutImageFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<crate::operation::put_image::PutImageOutput, crate::operation::put_image::PutImageError>,
43    > {
44        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45    }
46}
47impl PutImageFluentBuilder {
48    /// Creates a new `PutImageFluentBuilder`.
49    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50        Self {
51            handle,
52            inner: ::std::default::Default::default(),
53            config_override: ::std::option::Option::None,
54        }
55    }
56    /// Access the PutImage as a reference.
57    pub fn as_input(&self) -> &crate::operation::put_image::builders::PutImageInputBuilder {
58        &self.inner
59    }
60    /// Sends the request and returns the response.
61    ///
62    /// If an error occurs, an `SdkError` will be returned with additional details that
63    /// can be matched against.
64    ///
65    /// By default, any retryable failures will be retried twice. Retry behavior
66    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67    /// set when configuring the client.
68    pub async fn send(
69        self,
70    ) -> ::std::result::Result<
71        crate::operation::put_image::PutImageOutput,
72        ::aws_smithy_runtime_api::client::result::SdkError<
73            crate::operation::put_image::PutImageError,
74            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75        >,
76    > {
77        let input = self
78            .inner
79            .build()
80            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81        let runtime_plugins = crate::operation::put_image::PutImage::operation_runtime_plugins(
82            self.handle.runtime_plugins.clone(),
83            &self.handle.conf,
84            self.config_override,
85        );
86        crate::operation::put_image::PutImage::orchestrate(&runtime_plugins, input).await
87    }
88
89    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
90    pub fn customize(
91        self,
92    ) -> crate::client::customize::CustomizableOperation<crate::operation::put_image::PutImageOutput, crate::operation::put_image::PutImageError, Self>
93    {
94        crate::client::customize::CustomizableOperation::new(self)
95    }
96    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
97        self.set_config_override(::std::option::Option::Some(config_override.into()));
98        self
99    }
100
101    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
102        self.config_override = config_override;
103        self
104    }
105    /// <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>
106    pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.inner = self.inner.registry_id(input.into());
108        self
109    }
110    /// <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>
111    pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.inner = self.inner.set_registry_id(input);
113        self
114    }
115    /// <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>
116    pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
117        self.inner.get_registry_id()
118    }
119    /// <p>The name of the repository in which to put the image.</p>
120    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.repository_name(input.into());
122        self
123    }
124    /// <p>The name of the repository in which to put the image.</p>
125    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_repository_name(input);
127        self
128    }
129    /// <p>The name of the repository in which to put the image.</p>
130    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_repository_name()
132    }
133    /// <p>The image manifest corresponding to the image to be uploaded.</p>
134    pub fn image_manifest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.image_manifest(input.into());
136        self
137    }
138    /// <p>The image manifest corresponding to the image to be uploaded.</p>
139    pub fn set_image_manifest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_image_manifest(input);
141        self
142    }
143    /// <p>The image manifest corresponding to the image to be uploaded.</p>
144    pub fn get_image_manifest(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_image_manifest()
146    }
147    /// <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>
148    pub fn image_manifest_media_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.image_manifest_media_type(input.into());
150        self
151    }
152    /// <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>
153    pub fn set_image_manifest_media_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_image_manifest_media_type(input);
155        self
156    }
157    /// <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>
158    pub fn get_image_manifest_media_type(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_image_manifest_media_type()
160    }
161    /// <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>
162    pub fn image_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.image_tag(input.into());
164        self
165    }
166    /// <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>
167    pub fn set_image_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_image_tag(input);
169        self
170    }
171    /// <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>
172    pub fn get_image_tag(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_image_tag()
174    }
175    /// <p>The image digest of the image manifest corresponding to the image.</p>
176    pub fn image_digest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.image_digest(input.into());
178        self
179    }
180    /// <p>The image digest of the image manifest corresponding to the image.</p>
181    pub fn set_image_digest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_image_digest(input);
183        self
184    }
185    /// <p>The image digest of the image manifest corresponding to the image.</p>
186    pub fn get_image_digest(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_image_digest()
188    }
189}