aws_sdk_ecr/operation/describe_images/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_images::_describe_images_output::DescribeImagesOutputBuilder;
3
4pub use crate::operation::describe_images::_describe_images_input::DescribeImagesInputBuilder;
5
6impl crate::operation::describe_images::builders::DescribeImagesInputBuilder {
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::describe_images::DescribeImagesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_images::DescribeImagesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_images();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeImages`.
24///
25/// <p>Returns metadata about the images in a repository.</p><note>
26/// <p>Starting with Docker version 1.9, the Docker client compresses image layers before pushing them to a V2 Docker registry. The output of the <code>docker images</code> command shows the uncompressed image size. Therefore, Docker might return a larger image than the image shown in the Amazon Web Services Management Console.</p>
27/// </note> <important>
28/// <p>The new version of Amazon ECR <i>Basic Scanning</i> doesn't use the <code>ImageDetail$imageScanFindingsSummary</code> and <code>ImageDetail$imageScanStatus</code> attributes from the API response to return scan results. Use the <code>DescribeImageScanFindings</code> API instead. For more information about Amazon Web Services native basic scanning, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html"> Scan images for software vulnerabilities in Amazon ECR</a>.</p>
29/// </important>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct DescribeImagesFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::describe_images::builders::DescribeImagesInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37 crate::client::customize::internal::CustomizableSend<
38 crate::operation::describe_images::DescribeImagesOutput,
39 crate::operation::describe_images::DescribeImagesError,
40 > for DescribeImagesFluentBuilder
41{
42 fn send(
43 self,
44 config_override: crate::config::Builder,
45 ) -> crate::client::customize::internal::BoxFuture<
46 crate::client::customize::internal::SendResult<
47 crate::operation::describe_images::DescribeImagesOutput,
48 crate::operation::describe_images::DescribeImagesError,
49 >,
50 > {
51 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52 }
53}
54impl DescribeImagesFluentBuilder {
55 /// Creates a new `DescribeImagesFluentBuilder`.
56 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57 Self {
58 handle,
59 inner: ::std::default::Default::default(),
60 config_override: ::std::option::Option::None,
61 }
62 }
63 /// Access the DescribeImages as a reference.
64 pub fn as_input(&self) -> &crate::operation::describe_images::builders::DescribeImagesInputBuilder {
65 &self.inner
66 }
67 /// Sends the request and returns the response.
68 ///
69 /// If an error occurs, an `SdkError` will be returned with additional details that
70 /// can be matched against.
71 ///
72 /// By default, any retryable failures will be retried twice. Retry behavior
73 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74 /// set when configuring the client.
75 pub async fn send(
76 self,
77 ) -> ::std::result::Result<
78 crate::operation::describe_images::DescribeImagesOutput,
79 ::aws_smithy_runtime_api::client::result::SdkError<
80 crate::operation::describe_images::DescribeImagesError,
81 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82 >,
83 > {
84 let input = self
85 .inner
86 .build()
87 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88 let runtime_plugins = crate::operation::describe_images::DescribeImages::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::describe_images::DescribeImages::orchestrate(&runtime_plugins, input).await
94 }
95
96 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97 pub fn customize(
98 self,
99 ) -> crate::client::customize::CustomizableOperation<
100 crate::operation::describe_images::DescribeImagesOutput,
101 crate::operation::describe_images::DescribeImagesError,
102 Self,
103 > {
104 crate::client::customize::CustomizableOperation::new(self)
105 }
106 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107 self.set_config_override(::std::option::Option::Some(config_override.into()));
108 self
109 }
110
111 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112 self.config_override = config_override;
113 self
114 }
115 /// Create a paginator for this request
116 ///
117 /// Paginators are used by calling [`send().await`](crate::operation::describe_images::paginator::DescribeImagesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
118 pub fn into_paginator(self) -> crate::operation::describe_images::paginator::DescribeImagesPaginator {
119 crate::operation::describe_images::paginator::DescribeImagesPaginator::new(self.handle, self.inner)
120 }
121 /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.</p>
122 pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.inner = self.inner.registry_id(input.into());
124 self
125 }
126 /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.</p>
127 pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_registry_id(input);
129 self
130 }
131 /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.</p>
132 pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
133 self.inner.get_registry_id()
134 }
135 /// <p>The repository that contains the images to describe.</p>
136 pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.repository_name(input.into());
138 self
139 }
140 /// <p>The repository that contains the images to describe.</p>
141 pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_repository_name(input);
143 self
144 }
145 /// <p>The repository that contains the images to describe.</p>
146 pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_repository_name()
148 }
149 ///
150 /// Appends an item to `imageIds`.
151 ///
152 /// To override the contents of this collection use [`set_image_ids`](Self::set_image_ids).
153 ///
154 /// <p>The list of image IDs for the requested repository.</p>
155 pub fn image_ids(mut self, input: crate::types::ImageIdentifier) -> Self {
156 self.inner = self.inner.image_ids(input);
157 self
158 }
159 /// <p>The list of image IDs for the requested repository.</p>
160 pub fn set_image_ids(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImageIdentifier>>) -> Self {
161 self.inner = self.inner.set_image_ids(input);
162 self
163 }
164 /// <p>The list of image IDs for the requested repository.</p>
165 pub fn get_image_ids(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageIdentifier>> {
166 self.inner.get_image_ids()
167 }
168 /// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeImages</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
169 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170 self.inner = self.inner.next_token(input.into());
171 self
172 }
173 /// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeImages</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
174 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.inner = self.inner.set_next_token(input);
176 self
177 }
178 /// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeImages</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
179 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
180 self.inner.get_next_token()
181 }
182 /// <p>The maximum number of repository results returned by <code>DescribeImages</code> in paginated output. When this parameter is used, <code>DescribeImages</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeImages</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 1000. If this parameter is not used, then <code>DescribeImages</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
183 pub fn max_results(mut self, input: i32) -> Self {
184 self.inner = self.inner.max_results(input);
185 self
186 }
187 /// <p>The maximum number of repository results returned by <code>DescribeImages</code> in paginated output. When this parameter is used, <code>DescribeImages</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeImages</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 1000. If this parameter is not used, then <code>DescribeImages</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
188 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
189 self.inner = self.inner.set_max_results(input);
190 self
191 }
192 /// <p>The maximum number of repository results returned by <code>DescribeImages</code> in paginated output. When this parameter is used, <code>DescribeImages</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeImages</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 1000. If this parameter is not used, then <code>DescribeImages</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
193 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
194 self.inner.get_max_results()
195 }
196 /// <p>The filter key and value with which to filter your <code>DescribeImages</code> results.</p>
197 pub fn filter(mut self, input: crate::types::DescribeImagesFilter) -> Self {
198 self.inner = self.inner.filter(input);
199 self
200 }
201 /// <p>The filter key and value with which to filter your <code>DescribeImages</code> results.</p>
202 pub fn set_filter(mut self, input: ::std::option::Option<crate::types::DescribeImagesFilter>) -> Self {
203 self.inner = self.inner.set_filter(input);
204 self
205 }
206 /// <p>The filter key and value with which to filter your <code>DescribeImages</code> results.</p>
207 pub fn get_filter(&self) -> &::std::option::Option<crate::types::DescribeImagesFilter> {
208 self.inner.get_filter()
209 }
210}