rusoto_ecr/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl EcrClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "ecr", &self.region, request_uri);
31        request.set_endpoint_prefix("api.ecr".to_string());
32
33        request.set_content_type("application/x-amz-json-1.1".to_owned());
34
35        request
36    }
37
38    async fn sign_and_dispatch<E>(
39        &self,
40        request: SignedRequest,
41        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
42    ) -> Result<HttpResponse, RusotoError<E>> {
43        let mut response = self.client.sign_and_dispatch(request).await?;
44        if !response.status.is_success() {
45            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
46            return Err(from_response(response));
47        }
48
49        Ok(response)
50    }
51}
52
53use serde_json;
54/// <p>This data type is used in the <a>ImageScanFinding</a> data type.</p>
55#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
56#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
57pub struct Attribute {
58    /// <p>The attribute key.</p>
59    #[serde(rename = "key")]
60    pub key: String,
61    /// <p>The value assigned to the attribute key.</p>
62    #[serde(rename = "value")]
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub value: Option<String>,
65}
66
67/// <p>An object representing authorization data for an Amazon ECR registry.</p>
68#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
69#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
70pub struct AuthorizationData {
71    /// <p>A base64-encoded string that contains authorization data for the specified Amazon ECR registry. When the string is decoded, it is presented in the format <code>user:password</code> for private registry authentication using <code>docker login</code>.</p>
72    #[serde(rename = "authorizationToken")]
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub authorization_token: Option<String>,
75    /// <p>The Unix time in seconds and milliseconds when the authorization token expires. Authorization tokens are valid for 12 hours.</p>
76    #[serde(rename = "expiresAt")]
77    #[serde(skip_serializing_if = "Option::is_none")]
78    pub expires_at: Option<f64>,
79    /// <p>The registry URL to use for this authorization token in a <code>docker login</code> command. The Amazon ECR registry URL format is <code>https://aws_account_id.dkr.ecr.region.amazonaws.com</code>. For example, <code>https://012345678910.dkr.ecr.us-east-1.amazonaws.com</code>.. </p>
80    #[serde(rename = "proxyEndpoint")]
81    #[serde(skip_serializing_if = "Option::is_none")]
82    pub proxy_endpoint: Option<String>,
83}
84
85#[derive(Clone, Debug, Default, PartialEq, Serialize)]
86#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
87pub struct BatchCheckLayerAvailabilityRequest {
88    /// <p>The digests of the image layers to check.</p>
89    #[serde(rename = "layerDigests")]
90    pub layer_digests: Vec<String>,
91    /// <p>The AWS account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.</p>
92    #[serde(rename = "registryId")]
93    #[serde(skip_serializing_if = "Option::is_none")]
94    pub registry_id: Option<String>,
95    /// <p>The name of the repository that is associated with the image layers to check.</p>
96    #[serde(rename = "repositoryName")]
97    pub repository_name: String,
98}
99
100#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
101#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
102pub struct BatchCheckLayerAvailabilityResponse {
103    /// <p>Any failures associated with the call.</p>
104    #[serde(rename = "failures")]
105    #[serde(skip_serializing_if = "Option::is_none")]
106    pub failures: Option<Vec<LayerFailure>>,
107    /// <p>A list of image layer objects corresponding to the image layer references in the request.</p>
108    #[serde(rename = "layers")]
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub layers: Option<Vec<Layer>>,
111}
112
113/// <p>Deletes specified images within a specified repository. Images are specified with either the <code>imageTag</code> or <code>imageDigest</code>.</p>
114#[derive(Clone, Debug, Default, PartialEq, Serialize)]
115#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
116pub struct BatchDeleteImageRequest {
117    /// <p>A list of image ID references that correspond to images to delete. The format of the <code>imageIds</code> reference is <code>imageTag=tag</code> or <code>imageDigest=digest</code>.</p>
118    #[serde(rename = "imageIds")]
119    pub image_ids: Vec<ImageIdentifier>,
120    /// <p>The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed.</p>
121    #[serde(rename = "registryId")]
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub registry_id: Option<String>,
124    /// <p>The repository that contains the image to delete.</p>
125    #[serde(rename = "repositoryName")]
126    pub repository_name: String,
127}
128
129#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
130#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
131pub struct BatchDeleteImageResponse {
132    /// <p>Any failures associated with the call.</p>
133    #[serde(rename = "failures")]
134    #[serde(skip_serializing_if = "Option::is_none")]
135    pub failures: Option<Vec<ImageFailure>>,
136    /// <p>The image IDs of the deleted images.</p>
137    #[serde(rename = "imageIds")]
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub image_ids: Option<Vec<ImageIdentifier>>,
140}
141
142#[derive(Clone, Debug, Default, PartialEq, Serialize)]
143#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
144pub struct BatchGetImageRequest {
145    /// <p>The accepted media types for the request.</p> <p>Valid values: <code>application/vnd.docker.distribution.manifest.v1+json</code> | <code>application/vnd.docker.distribution.manifest.v2+json</code> | <code>application/vnd.oci.image.manifest.v1+json</code> </p>
146    #[serde(rename = "acceptedMediaTypes")]
147    #[serde(skip_serializing_if = "Option::is_none")]
148    pub accepted_media_types: Option<Vec<String>>,
149    /// <p>A list of image ID references that correspond to images to describe. The format of the <code>imageIds</code> reference is <code>imageTag=tag</code> or <code>imageDigest=digest</code>.</p>
150    #[serde(rename = "imageIds")]
151    pub image_ids: Vec<ImageIdentifier>,
152    /// <p>The AWS account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed.</p>
153    #[serde(rename = "registryId")]
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub registry_id: Option<String>,
156    /// <p>The repository that contains the images to describe.</p>
157    #[serde(rename = "repositoryName")]
158    pub repository_name: String,
159}
160
161#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
162#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
163pub struct BatchGetImageResponse {
164    /// <p>Any failures associated with the call.</p>
165    #[serde(rename = "failures")]
166    #[serde(skip_serializing_if = "Option::is_none")]
167    pub failures: Option<Vec<ImageFailure>>,
168    /// <p>A list of image objects corresponding to the image references in the request.</p>
169    #[serde(rename = "images")]
170    #[serde(skip_serializing_if = "Option::is_none")]
171    pub images: Option<Vec<Image>>,
172}
173
174#[derive(Clone, Debug, Default, PartialEq, Serialize)]
175#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
176pub struct CompleteLayerUploadRequest {
177    /// <p>The <code>sha256</code> digest of the image layer.</p>
178    #[serde(rename = "layerDigests")]
179    pub layer_digests: Vec<String>,
180    /// <p>The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.</p>
181    #[serde(rename = "registryId")]
182    #[serde(skip_serializing_if = "Option::is_none")]
183    pub registry_id: Option<String>,
184    /// <p>The name of the repository to associate with the image layer.</p>
185    #[serde(rename = "repositoryName")]
186    pub repository_name: String,
187    /// <p>The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the image layer.</p>
188    #[serde(rename = "uploadId")]
189    pub upload_id: String,
190}
191
192#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
193#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
194pub struct CompleteLayerUploadResponse {
195    /// <p>The <code>sha256</code> digest of the image layer.</p>
196    #[serde(rename = "layerDigest")]
197    #[serde(skip_serializing_if = "Option::is_none")]
198    pub layer_digest: Option<String>,
199    /// <p>The registry ID associated with the request.</p>
200    #[serde(rename = "registryId")]
201    #[serde(skip_serializing_if = "Option::is_none")]
202    pub registry_id: Option<String>,
203    /// <p>The repository name associated with the request.</p>
204    #[serde(rename = "repositoryName")]
205    #[serde(skip_serializing_if = "Option::is_none")]
206    pub repository_name: Option<String>,
207    /// <p>The upload ID associated with the layer.</p>
208    #[serde(rename = "uploadId")]
209    #[serde(skip_serializing_if = "Option::is_none")]
210    pub upload_id: Option<String>,
211}
212
213#[derive(Clone, Debug, Default, PartialEq, Serialize)]
214#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
215pub struct CreateRepositoryRequest {
216    /// <p>The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>
217    #[serde(rename = "imageScanningConfiguration")]
218    #[serde(skip_serializing_if = "Option::is_none")]
219    pub image_scanning_configuration: Option<ImageScanningConfiguration>,
220    /// <p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>
221    #[serde(rename = "imageTagMutability")]
222    #[serde(skip_serializing_if = "Option::is_none")]
223    pub image_tag_mutability: Option<String>,
224    /// <p>The name to use for the repository. The repository name may be specified on its own (such as <code>nginx-web-app</code>) or it can be prepended with a namespace to group the repository into a category (such as <code>project-a/nginx-web-app</code>).</p>
225    #[serde(rename = "repositoryName")]
226    pub repository_name: String,
227    /// <p>The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
228    #[serde(rename = "tags")]
229    #[serde(skip_serializing_if = "Option::is_none")]
230    pub tags: Option<Vec<Tag>>,
231}
232
233#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
234#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
235pub struct CreateRepositoryResponse {
236    /// <p>The repository that was created.</p>
237    #[serde(rename = "repository")]
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub repository: Option<Repository>,
240}
241
242#[derive(Clone, Debug, Default, PartialEq, Serialize)]
243#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
244pub struct DeleteLifecyclePolicyRequest {
245    /// <p>The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
246    #[serde(rename = "registryId")]
247    #[serde(skip_serializing_if = "Option::is_none")]
248    pub registry_id: Option<String>,
249    /// <p>The name of the repository.</p>
250    #[serde(rename = "repositoryName")]
251    pub repository_name: String,
252}
253
254#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
255#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
256pub struct DeleteLifecyclePolicyResponse {
257    /// <p>The time stamp of the last time that the lifecycle policy was run.</p>
258    #[serde(rename = "lastEvaluatedAt")]
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub last_evaluated_at: Option<f64>,
261    /// <p>The JSON lifecycle policy text.</p>
262    #[serde(rename = "lifecyclePolicyText")]
263    #[serde(skip_serializing_if = "Option::is_none")]
264    pub lifecycle_policy_text: Option<String>,
265    /// <p>The registry ID associated with the request.</p>
266    #[serde(rename = "registryId")]
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub registry_id: Option<String>,
269    /// <p>The repository name associated with the request.</p>
270    #[serde(rename = "repositoryName")]
271    #[serde(skip_serializing_if = "Option::is_none")]
272    pub repository_name: Option<String>,
273}
274
275#[derive(Clone, Debug, Default, PartialEq, Serialize)]
276#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
277pub struct DeleteRepositoryPolicyRequest {
278    /// <p>The AWS account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.</p>
279    #[serde(rename = "registryId")]
280    #[serde(skip_serializing_if = "Option::is_none")]
281    pub registry_id: Option<String>,
282    /// <p>The name of the repository that is associated with the repository policy to delete.</p>
283    #[serde(rename = "repositoryName")]
284    pub repository_name: String,
285}
286
287#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
288#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
289pub struct DeleteRepositoryPolicyResponse {
290    /// <p>The JSON repository policy that was deleted from the repository.</p>
291    #[serde(rename = "policyText")]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub policy_text: Option<String>,
294    /// <p>The registry ID associated with the request.</p>
295    #[serde(rename = "registryId")]
296    #[serde(skip_serializing_if = "Option::is_none")]
297    pub registry_id: Option<String>,
298    /// <p>The repository name associated with the request.</p>
299    #[serde(rename = "repositoryName")]
300    #[serde(skip_serializing_if = "Option::is_none")]
301    pub repository_name: Option<String>,
302}
303
304#[derive(Clone, Debug, Default, PartialEq, Serialize)]
305#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
306pub struct DeleteRepositoryRequest {
307    /// <p> If a repository contains images, forces the deletion.</p>
308    #[serde(rename = "force")]
309    #[serde(skip_serializing_if = "Option::is_none")]
310    pub force: Option<bool>,
311    /// <p>The AWS account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.</p>
312    #[serde(rename = "registryId")]
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub registry_id: Option<String>,
315    /// <p>The name of the repository to delete.</p>
316    #[serde(rename = "repositoryName")]
317    pub repository_name: String,
318}
319
320#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
321#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
322pub struct DeleteRepositoryResponse {
323    /// <p>The repository that was deleted.</p>
324    #[serde(rename = "repository")]
325    #[serde(skip_serializing_if = "Option::is_none")]
326    pub repository: Option<Repository>,
327}
328
329#[derive(Clone, Debug, Default, PartialEq, Serialize)]
330#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
331pub struct DescribeImageScanFindingsRequest {
332    #[serde(rename = "imageId")]
333    pub image_id: ImageIdentifier,
334    /// <p>The maximum number of image scan results returned by <code>DescribeImageScanFindings</code> in paginated output. When this parameter is used, <code>DescribeImageScanFindings</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>DescribeImageScanFindings</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>DescribeImageScanFindings</code> returns up to 100 results and a <code>nextToken</code> value, if applicable.</p>
335    #[serde(rename = "maxResults")]
336    #[serde(skip_serializing_if = "Option::is_none")]
337    pub max_results: Option<i64>,
338    /// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeImageScanFindings</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 null when there are no more results to return.</p>
339    #[serde(rename = "nextToken")]
340    #[serde(skip_serializing_if = "Option::is_none")]
341    pub next_token: Option<String>,
342    /// <p>The AWS account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed.</p>
343    #[serde(rename = "registryId")]
344    #[serde(skip_serializing_if = "Option::is_none")]
345    pub registry_id: Option<String>,
346    /// <p>The repository for the image for which to describe the scan findings.</p>
347    #[serde(rename = "repositoryName")]
348    pub repository_name: String,
349}
350
351#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
352#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
353pub struct DescribeImageScanFindingsResponse {
354    #[serde(rename = "imageId")]
355    #[serde(skip_serializing_if = "Option::is_none")]
356    pub image_id: Option<ImageIdentifier>,
357    /// <p>The information contained in the image scan findings.</p>
358    #[serde(rename = "imageScanFindings")]
359    #[serde(skip_serializing_if = "Option::is_none")]
360    pub image_scan_findings: Option<ImageScanFindings>,
361    /// <p>The current state of the scan.</p>
362    #[serde(rename = "imageScanStatus")]
363    #[serde(skip_serializing_if = "Option::is_none")]
364    pub image_scan_status: Option<ImageScanStatus>,
365    /// <p>The <code>nextToken</code> value to include in a future <code>DescribeImageScanFindings</code> request. When the results of a <code>DescribeImageScanFindings</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.</p>
366    #[serde(rename = "nextToken")]
367    #[serde(skip_serializing_if = "Option::is_none")]
368    pub next_token: Option<String>,
369    /// <p>The registry ID associated with the request.</p>
370    #[serde(rename = "registryId")]
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub registry_id: Option<String>,
373    /// <p>The repository name associated with the request.</p>
374    #[serde(rename = "repositoryName")]
375    #[serde(skip_serializing_if = "Option::is_none")]
376    pub repository_name: Option<String>,
377}
378
379/// <p>An object representing a filter on a <a>DescribeImages</a> operation.</p>
380#[derive(Clone, Debug, Default, PartialEq, Serialize)]
381#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
382pub struct DescribeImagesFilter {
383    /// <p>The tag status with which to filter your <a>DescribeImages</a> results. You can filter results based on whether they are <code>TAGGED</code> or <code>UNTAGGED</code>.</p>
384    #[serde(rename = "tagStatus")]
385    #[serde(skip_serializing_if = "Option::is_none")]
386    pub tag_status: Option<String>,
387}
388
389#[derive(Clone, Debug, Default, PartialEq, Serialize)]
390#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
391pub struct DescribeImagesRequest {
392    /// <p>The filter key and value with which to filter your <code>DescribeImages</code> results.</p>
393    #[serde(rename = "filter")]
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub filter: Option<DescribeImagesFilter>,
396    /// <p>The list of image IDs for the requested repository.</p>
397    #[serde(rename = "imageIds")]
398    #[serde(skip_serializing_if = "Option::is_none")]
399    pub image_ids: Option<Vec<ImageIdentifier>>,
400    /// <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>
401    #[serde(rename = "maxResults")]
402    #[serde(skip_serializing_if = "Option::is_none")]
403    pub max_results: Option<i64>,
404    /// <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>
405    #[serde(rename = "nextToken")]
406    #[serde(skip_serializing_if = "Option::is_none")]
407    pub next_token: Option<String>,
408    /// <p>The AWS 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>
409    #[serde(rename = "registryId")]
410    #[serde(skip_serializing_if = "Option::is_none")]
411    pub registry_id: Option<String>,
412    /// <p>The repository that contains the images to describe.</p>
413    #[serde(rename = "repositoryName")]
414    pub repository_name: String,
415}
416
417#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
418#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
419pub struct DescribeImagesResponse {
420    /// <p>A list of <a>ImageDetail</a> objects that contain data about the image.</p>
421    #[serde(rename = "imageDetails")]
422    #[serde(skip_serializing_if = "Option::is_none")]
423    pub image_details: Option<Vec<ImageDetail>>,
424    /// <p>The <code>nextToken</code> value to include in a future <code>DescribeImages</code> request. When the results of a <code>DescribeImages</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
425    #[serde(rename = "nextToken")]
426    #[serde(skip_serializing_if = "Option::is_none")]
427    pub next_token: Option<String>,
428}
429
430#[derive(Clone, Debug, Default, PartialEq, Serialize)]
431#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
432pub struct DescribeRepositoriesRequest {
433    /// <p>The maximum number of repository results returned by <code>DescribeRepositories</code> in paginated output. When this parameter is used, <code>DescribeRepositories</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>DescribeRepositories</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>DescribeRepositories</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. This option cannot be used when you specify repositories with <code>repositoryNames</code>.</p>
434    #[serde(rename = "maxResults")]
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub max_results: Option<i64>,
437    /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeRepositories</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 repositories with <code>repositoryNames</code>.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p>
438    #[serde(rename = "nextToken")]
439    #[serde(skip_serializing_if = "Option::is_none")]
440    pub next_token: Option<String>,
441    /// <p>The AWS account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.</p>
442    #[serde(rename = "registryId")]
443    #[serde(skip_serializing_if = "Option::is_none")]
444    pub registry_id: Option<String>,
445    /// <p>A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.</p>
446    #[serde(rename = "repositoryNames")]
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub repository_names: Option<Vec<String>>,
449}
450
451#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
452#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
453pub struct DescribeRepositoriesResponse {
454    /// <p>The <code>nextToken</code> value to include in a future <code>DescribeRepositories</code> request. When the results of a <code>DescribeRepositories</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
455    #[serde(rename = "nextToken")]
456    #[serde(skip_serializing_if = "Option::is_none")]
457    pub next_token: Option<String>,
458    /// <p>A list of repository objects corresponding to valid repositories.</p>
459    #[serde(rename = "repositories")]
460    #[serde(skip_serializing_if = "Option::is_none")]
461    pub repositories: Option<Vec<Repository>>,
462}
463
464#[derive(Clone, Debug, Default, PartialEq, Serialize)]
465#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
466pub struct GetAuthorizationTokenRequest {
467    /// <p>A list of AWS account IDs that are associated with the registries for which to get AuthorizationData objects. If you do not specify a registry, the default registry is assumed.</p>
468    #[serde(rename = "registryIds")]
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub registry_ids: Option<Vec<String>>,
471}
472
473#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
474#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
475pub struct GetAuthorizationTokenResponse {
476    /// <p>A list of authorization token data objects that correspond to the <code>registryIds</code> values in the request.</p>
477    #[serde(rename = "authorizationData")]
478    #[serde(skip_serializing_if = "Option::is_none")]
479    pub authorization_data: Option<Vec<AuthorizationData>>,
480}
481
482#[derive(Clone, Debug, Default, PartialEq, Serialize)]
483#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
484pub struct GetDownloadUrlForLayerRequest {
485    /// <p>The digest of the image layer to download.</p>
486    #[serde(rename = "layerDigest")]
487    pub layer_digest: String,
488    /// <p>The AWS account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed.</p>
489    #[serde(rename = "registryId")]
490    #[serde(skip_serializing_if = "Option::is_none")]
491    pub registry_id: Option<String>,
492    /// <p>The name of the repository that is associated with the image layer to download.</p>
493    #[serde(rename = "repositoryName")]
494    pub repository_name: String,
495}
496
497#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
498#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
499pub struct GetDownloadUrlForLayerResponse {
500    /// <p>The pre-signed Amazon S3 download URL for the requested layer.</p>
501    #[serde(rename = "downloadUrl")]
502    #[serde(skip_serializing_if = "Option::is_none")]
503    pub download_url: Option<String>,
504    /// <p>The digest of the image layer to download.</p>
505    #[serde(rename = "layerDigest")]
506    #[serde(skip_serializing_if = "Option::is_none")]
507    pub layer_digest: Option<String>,
508}
509
510#[derive(Clone, Debug, Default, PartialEq, Serialize)]
511#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
512pub struct GetLifecyclePolicyPreviewRequest {
513    /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
514    #[serde(rename = "filter")]
515    #[serde(skip_serializing_if = "Option::is_none")]
516    pub filter: Option<LifecyclePolicyPreviewFilter>,
517    /// <p>The list of imageIDs to be included.</p>
518    #[serde(rename = "imageIds")]
519    #[serde(skip_serializing_if = "Option::is_none")]
520    pub image_ids: Option<Vec<ImageIdentifier>>,
521    /// <p>The maximum number of repository results returned by <code>GetLifecyclePolicyPreviewRequest</code> in&#x2028; paginated output. When this parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns&#x2028; <code>maxResults</code> results in a single page along with a <code>nextToken</code>&#x2028; response element. The remaining results of the initial request can be seen by sending&#x2028; another <code>GetLifecyclePolicyPreviewRequest</code> request with the returned <code>nextToken</code>&#x2028; value. This value can be between 1 and 1000. If this&#x2028; parameter is not used, then <code>GetLifecyclePolicyPreviewRequest</code> returns up to&#x2028; 100 results and a <code>nextToken</code> value, if&#x2028; applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
522    #[serde(rename = "maxResults")]
523    #[serde(skip_serializing_if = "Option::is_none")]
524    pub max_results: Option<i64>,
525    /// <p>The <code>nextToken</code> value returned from a previous paginated&#x2028; <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code> was used and the&#x2028; results exceeded the value of that parameter. Pagination continues from the end of the&#x2028; previous results that returned the <code>nextToken</code> value. This value is&#x2028; <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>
526    #[serde(rename = "nextToken")]
527    #[serde(skip_serializing_if = "Option::is_none")]
528    pub next_token: Option<String>,
529    /// <p>The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
530    #[serde(rename = "registryId")]
531    #[serde(skip_serializing_if = "Option::is_none")]
532    pub registry_id: Option<String>,
533    /// <p>The name of the repository.</p>
534    #[serde(rename = "repositoryName")]
535    pub repository_name: String,
536}
537
538#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
539#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
540pub struct GetLifecyclePolicyPreviewResponse {
541    /// <p>The JSON lifecycle policy text.</p>
542    #[serde(rename = "lifecyclePolicyText")]
543    #[serde(skip_serializing_if = "Option::is_none")]
544    pub lifecycle_policy_text: Option<String>,
545    /// <p>The <code>nextToken</code> value to include in a future <code>GetLifecyclePolicyPreview</code> request. When the results of a <code>GetLifecyclePolicyPreview</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
546    #[serde(rename = "nextToken")]
547    #[serde(skip_serializing_if = "Option::is_none")]
548    pub next_token: Option<String>,
549    /// <p>The results of the lifecycle policy preview request.</p>
550    #[serde(rename = "previewResults")]
551    #[serde(skip_serializing_if = "Option::is_none")]
552    pub preview_results: Option<Vec<LifecyclePolicyPreviewResult>>,
553    /// <p>The registry ID associated with the request.</p>
554    #[serde(rename = "registryId")]
555    #[serde(skip_serializing_if = "Option::is_none")]
556    pub registry_id: Option<String>,
557    /// <p>The repository name associated with the request.</p>
558    #[serde(rename = "repositoryName")]
559    #[serde(skip_serializing_if = "Option::is_none")]
560    pub repository_name: Option<String>,
561    /// <p>The status of the lifecycle policy preview request.</p>
562    #[serde(rename = "status")]
563    #[serde(skip_serializing_if = "Option::is_none")]
564    pub status: Option<String>,
565    /// <p>The list of images that is returned as a result of the action.</p>
566    #[serde(rename = "summary")]
567    #[serde(skip_serializing_if = "Option::is_none")]
568    pub summary: Option<LifecyclePolicyPreviewSummary>,
569}
570
571#[derive(Clone, Debug, Default, PartialEq, Serialize)]
572#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
573pub struct GetLifecyclePolicyRequest {
574    /// <p>The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
575    #[serde(rename = "registryId")]
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub registry_id: Option<String>,
578    /// <p>The name of the repository.</p>
579    #[serde(rename = "repositoryName")]
580    pub repository_name: String,
581}
582
583#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
584#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
585pub struct GetLifecyclePolicyResponse {
586    /// <p>The time stamp of the last time that the lifecycle policy was run.</p>
587    #[serde(rename = "lastEvaluatedAt")]
588    #[serde(skip_serializing_if = "Option::is_none")]
589    pub last_evaluated_at: Option<f64>,
590    /// <p>The JSON lifecycle policy text.</p>
591    #[serde(rename = "lifecyclePolicyText")]
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub lifecycle_policy_text: Option<String>,
594    /// <p>The registry ID associated with the request.</p>
595    #[serde(rename = "registryId")]
596    #[serde(skip_serializing_if = "Option::is_none")]
597    pub registry_id: Option<String>,
598    /// <p>The repository name associated with the request.</p>
599    #[serde(rename = "repositoryName")]
600    #[serde(skip_serializing_if = "Option::is_none")]
601    pub repository_name: Option<String>,
602}
603
604#[derive(Clone, Debug, Default, PartialEq, Serialize)]
605#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
606pub struct GetRepositoryPolicyRequest {
607    /// <p>The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
608    #[serde(rename = "registryId")]
609    #[serde(skip_serializing_if = "Option::is_none")]
610    pub registry_id: Option<String>,
611    /// <p>The name of the repository with the policy to retrieve.</p>
612    #[serde(rename = "repositoryName")]
613    pub repository_name: String,
614}
615
616#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
617#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
618pub struct GetRepositoryPolicyResponse {
619    /// <p>The JSON repository policy text associated with the repository.</p>
620    #[serde(rename = "policyText")]
621    #[serde(skip_serializing_if = "Option::is_none")]
622    pub policy_text: Option<String>,
623    /// <p>The registry ID associated with the request.</p>
624    #[serde(rename = "registryId")]
625    #[serde(skip_serializing_if = "Option::is_none")]
626    pub registry_id: Option<String>,
627    /// <p>The repository name associated with the request.</p>
628    #[serde(rename = "repositoryName")]
629    #[serde(skip_serializing_if = "Option::is_none")]
630    pub repository_name: Option<String>,
631}
632
633/// <p>An object representing an Amazon ECR image.</p>
634#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
635#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
636pub struct Image {
637    /// <p>An object containing the image tag and image digest associated with an image.</p>
638    #[serde(rename = "imageId")]
639    #[serde(skip_serializing_if = "Option::is_none")]
640    pub image_id: Option<ImageIdentifier>,
641    /// <p>The image manifest associated with the image.</p>
642    #[serde(rename = "imageManifest")]
643    #[serde(skip_serializing_if = "Option::is_none")]
644    pub image_manifest: Option<String>,
645    /// <p>The media type associated with the image manifest.</p>
646    #[serde(rename = "imageManifestMediaType")]
647    #[serde(skip_serializing_if = "Option::is_none")]
648    pub image_manifest_media_type: Option<String>,
649    /// <p>The AWS account ID associated with the registry containing the image.</p>
650    #[serde(rename = "registryId")]
651    #[serde(skip_serializing_if = "Option::is_none")]
652    pub registry_id: Option<String>,
653    /// <p>The name of the repository associated with the image.</p>
654    #[serde(rename = "repositoryName")]
655    #[serde(skip_serializing_if = "Option::is_none")]
656    pub repository_name: Option<String>,
657}
658
659/// <p>An object that describes an image returned by a <a>DescribeImages</a> operation.</p>
660#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
661#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
662pub struct ImageDetail {
663    /// <p>The <code>sha256</code> digest of the image manifest.</p>
664    #[serde(rename = "imageDigest")]
665    #[serde(skip_serializing_if = "Option::is_none")]
666    pub image_digest: Option<String>,
667    /// <p>The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository. </p>
668    #[serde(rename = "imagePushedAt")]
669    #[serde(skip_serializing_if = "Option::is_none")]
670    pub image_pushed_at: Option<f64>,
671    /// <p>A summary of the last completed image scan.</p>
672    #[serde(rename = "imageScanFindingsSummary")]
673    #[serde(skip_serializing_if = "Option::is_none")]
674    pub image_scan_findings_summary: Option<ImageScanFindingsSummary>,
675    /// <p>The current state of the scan.</p>
676    #[serde(rename = "imageScanStatus")]
677    #[serde(skip_serializing_if = "Option::is_none")]
678    pub image_scan_status: Option<ImageScanStatus>,
679    /// <p><p>The size, in bytes, of the image in the repository.</p> <p>If the image is a manifest list, this will be the max size of all manifests in the list.</p> <note> <p>Beginning 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, so it may return a larger image size than the image sizes returned by <a>DescribeImages</a>.</p> </note></p>
680    #[serde(rename = "imageSizeInBytes")]
681    #[serde(skip_serializing_if = "Option::is_none")]
682    pub image_size_in_bytes: Option<i64>,
683    /// <p>The list of tags associated with this image.</p>
684    #[serde(rename = "imageTags")]
685    #[serde(skip_serializing_if = "Option::is_none")]
686    pub image_tags: Option<Vec<String>>,
687    /// <p>The AWS account ID associated with the registry to which this image belongs.</p>
688    #[serde(rename = "registryId")]
689    #[serde(skip_serializing_if = "Option::is_none")]
690    pub registry_id: Option<String>,
691    /// <p>The name of the repository to which this image belongs.</p>
692    #[serde(rename = "repositoryName")]
693    #[serde(skip_serializing_if = "Option::is_none")]
694    pub repository_name: Option<String>,
695}
696
697/// <p>An object representing an Amazon ECR image failure.</p>
698#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
699#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
700pub struct ImageFailure {
701    /// <p>The code associated with the failure.</p>
702    #[serde(rename = "failureCode")]
703    #[serde(skip_serializing_if = "Option::is_none")]
704    pub failure_code: Option<String>,
705    /// <p>The reason for the failure.</p>
706    #[serde(rename = "failureReason")]
707    #[serde(skip_serializing_if = "Option::is_none")]
708    pub failure_reason: Option<String>,
709    /// <p>The image ID associated with the failure.</p>
710    #[serde(rename = "imageId")]
711    #[serde(skip_serializing_if = "Option::is_none")]
712    pub image_id: Option<ImageIdentifier>,
713}
714
715/// <p>An object with identifying information for an Amazon ECR image.</p>
716#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
717pub struct ImageIdentifier {
718    /// <p>The <code>sha256</code> digest of the image manifest.</p>
719    #[serde(rename = "imageDigest")]
720    #[serde(skip_serializing_if = "Option::is_none")]
721    pub image_digest: Option<String>,
722    /// <p>The tag used for the image.</p>
723    #[serde(rename = "imageTag")]
724    #[serde(skip_serializing_if = "Option::is_none")]
725    pub image_tag: Option<String>,
726}
727
728/// <p>Contains information about an image scan finding.</p>
729#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
730#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
731pub struct ImageScanFinding {
732    /// <p>A collection of attributes of the host from which the finding is generated.</p>
733    #[serde(rename = "attributes")]
734    #[serde(skip_serializing_if = "Option::is_none")]
735    pub attributes: Option<Vec<Attribute>>,
736    /// <p>The description of the finding.</p>
737    #[serde(rename = "description")]
738    #[serde(skip_serializing_if = "Option::is_none")]
739    pub description: Option<String>,
740    /// <p>The name associated with the finding, usually a CVE number.</p>
741    #[serde(rename = "name")]
742    #[serde(skip_serializing_if = "Option::is_none")]
743    pub name: Option<String>,
744    /// <p>The finding severity.</p>
745    #[serde(rename = "severity")]
746    #[serde(skip_serializing_if = "Option::is_none")]
747    pub severity: Option<String>,
748    /// <p>A link containing additional details about the security vulnerability.</p>
749    #[serde(rename = "uri")]
750    #[serde(skip_serializing_if = "Option::is_none")]
751    pub uri: Option<String>,
752}
753
754/// <p>The details of an image scan.</p>
755#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
756#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
757pub struct ImageScanFindings {
758    /// <p>The image vulnerability counts, sorted by severity.</p>
759    #[serde(rename = "findingSeverityCounts")]
760    #[serde(skip_serializing_if = "Option::is_none")]
761    pub finding_severity_counts: Option<::std::collections::HashMap<String, i64>>,
762    /// <p>The findings from the image scan.</p>
763    #[serde(rename = "findings")]
764    #[serde(skip_serializing_if = "Option::is_none")]
765    pub findings: Option<Vec<ImageScanFinding>>,
766    /// <p>The time of the last completed image scan.</p>
767    #[serde(rename = "imageScanCompletedAt")]
768    #[serde(skip_serializing_if = "Option::is_none")]
769    pub image_scan_completed_at: Option<f64>,
770    /// <p>The time when the vulnerability data was last scanned.</p>
771    #[serde(rename = "vulnerabilitySourceUpdatedAt")]
772    #[serde(skip_serializing_if = "Option::is_none")]
773    pub vulnerability_source_updated_at: Option<f64>,
774}
775
776/// <p>A summary of the last completed image scan.</p>
777#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
778#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
779pub struct ImageScanFindingsSummary {
780    /// <p>The image vulnerability counts, sorted by severity.</p>
781    #[serde(rename = "findingSeverityCounts")]
782    #[serde(skip_serializing_if = "Option::is_none")]
783    pub finding_severity_counts: Option<::std::collections::HashMap<String, i64>>,
784    /// <p>The time of the last completed image scan.</p>
785    #[serde(rename = "imageScanCompletedAt")]
786    #[serde(skip_serializing_if = "Option::is_none")]
787    pub image_scan_completed_at: Option<f64>,
788    /// <p>The time when the vulnerability data was last scanned.</p>
789    #[serde(rename = "vulnerabilitySourceUpdatedAt")]
790    #[serde(skip_serializing_if = "Option::is_none")]
791    pub vulnerability_source_updated_at: Option<f64>,
792}
793
794/// <p>The current status of an image scan.</p>
795#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
796#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
797pub struct ImageScanStatus {
798    /// <p>The description of the image scan status.</p>
799    #[serde(rename = "description")]
800    #[serde(skip_serializing_if = "Option::is_none")]
801    pub description: Option<String>,
802    /// <p>The current state of an image scan.</p>
803    #[serde(rename = "status")]
804    #[serde(skip_serializing_if = "Option::is_none")]
805    pub status: Option<String>,
806}
807
808/// <p>The image scanning configuration for a repository.</p>
809#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
810pub struct ImageScanningConfiguration {
811    /// <p>The setting that determines whether images are scanned after being pushed to a repository. If set to <code>true</code>, images will be scanned after being pushed. If this parameter is not specified, it will default to <code>false</code> and images will not be scanned unless a scan is manually started with the <a>StartImageScan</a> API.</p>
812    #[serde(rename = "scanOnPush")]
813    #[serde(skip_serializing_if = "Option::is_none")]
814    pub scan_on_push: Option<bool>,
815}
816
817#[derive(Clone, Debug, Default, PartialEq, Serialize)]
818#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
819pub struct InitiateLayerUploadRequest {
820    /// <p>The AWS account ID associated with the registry to which you intend to upload layers. If you do not specify a registry, the default registry is assumed.</p>
821    #[serde(rename = "registryId")]
822    #[serde(skip_serializing_if = "Option::is_none")]
823    pub registry_id: Option<String>,
824    /// <p>The name of the repository to which you intend to upload layers.</p>
825    #[serde(rename = "repositoryName")]
826    pub repository_name: String,
827}
828
829#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
830#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
831pub struct InitiateLayerUploadResponse {
832    /// <p>The size, in bytes, that Amazon ECR expects future layer part uploads to be.</p>
833    #[serde(rename = "partSize")]
834    #[serde(skip_serializing_if = "Option::is_none")]
835    pub part_size: Option<i64>,
836    /// <p>The upload ID for the layer upload. This parameter is passed to further <a>UploadLayerPart</a> and <a>CompleteLayerUpload</a> operations.</p>
837    #[serde(rename = "uploadId")]
838    #[serde(skip_serializing_if = "Option::is_none")]
839    pub upload_id: Option<String>,
840}
841
842/// <p>An object representing an Amazon ECR image layer.</p>
843#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
844#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
845pub struct Layer {
846    /// <p>The availability status of the image layer.</p>
847    #[serde(rename = "layerAvailability")]
848    #[serde(skip_serializing_if = "Option::is_none")]
849    pub layer_availability: Option<String>,
850    /// <p>The <code>sha256</code> digest of the image layer.</p>
851    #[serde(rename = "layerDigest")]
852    #[serde(skip_serializing_if = "Option::is_none")]
853    pub layer_digest: Option<String>,
854    /// <p>The size, in bytes, of the image layer.</p>
855    #[serde(rename = "layerSize")]
856    #[serde(skip_serializing_if = "Option::is_none")]
857    pub layer_size: Option<i64>,
858    /// <p>The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.</p>
859    #[serde(rename = "mediaType")]
860    #[serde(skip_serializing_if = "Option::is_none")]
861    pub media_type: Option<String>,
862}
863
864/// <p>An object representing an Amazon ECR image layer failure.</p>
865#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
866#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
867pub struct LayerFailure {
868    /// <p>The failure code associated with the failure.</p>
869    #[serde(rename = "failureCode")]
870    #[serde(skip_serializing_if = "Option::is_none")]
871    pub failure_code: Option<String>,
872    /// <p>The reason for the failure.</p>
873    #[serde(rename = "failureReason")]
874    #[serde(skip_serializing_if = "Option::is_none")]
875    pub failure_reason: Option<String>,
876    /// <p>The layer digest associated with the failure.</p>
877    #[serde(rename = "layerDigest")]
878    #[serde(skip_serializing_if = "Option::is_none")]
879    pub layer_digest: Option<String>,
880}
881
882/// <p>The filter for the lifecycle policy preview.</p>
883#[derive(Clone, Debug, Default, PartialEq, Serialize)]
884#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
885pub struct LifecyclePolicyPreviewFilter {
886    /// <p>The tag status of the image.</p>
887    #[serde(rename = "tagStatus")]
888    #[serde(skip_serializing_if = "Option::is_none")]
889    pub tag_status: Option<String>,
890}
891
892/// <p>The result of the lifecycle policy preview.</p>
893#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
894#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
895pub struct LifecyclePolicyPreviewResult {
896    /// <p>The type of action to be taken.</p>
897    #[serde(rename = "action")]
898    #[serde(skip_serializing_if = "Option::is_none")]
899    pub action: Option<LifecyclePolicyRuleAction>,
900    /// <p>The priority of the applied rule.</p>
901    #[serde(rename = "appliedRulePriority")]
902    #[serde(skip_serializing_if = "Option::is_none")]
903    pub applied_rule_priority: Option<i64>,
904    /// <p>The <code>sha256</code> digest of the image manifest.</p>
905    #[serde(rename = "imageDigest")]
906    #[serde(skip_serializing_if = "Option::is_none")]
907    pub image_digest: Option<String>,
908    /// <p>The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.</p>
909    #[serde(rename = "imagePushedAt")]
910    #[serde(skip_serializing_if = "Option::is_none")]
911    pub image_pushed_at: Option<f64>,
912    /// <p>The list of tags associated with this image.</p>
913    #[serde(rename = "imageTags")]
914    #[serde(skip_serializing_if = "Option::is_none")]
915    pub image_tags: Option<Vec<String>>,
916}
917
918/// <p>The summary of the lifecycle policy preview request.</p>
919#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
920#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
921pub struct LifecyclePolicyPreviewSummary {
922    /// <p>The number of expiring images.</p>
923    #[serde(rename = "expiringImageTotalCount")]
924    #[serde(skip_serializing_if = "Option::is_none")]
925    pub expiring_image_total_count: Option<i64>,
926}
927
928/// <p>The type of action to be taken.</p>
929#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
930#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
931pub struct LifecyclePolicyRuleAction {
932    /// <p>The type of action to be taken.</p>
933    #[serde(rename = "type")]
934    #[serde(skip_serializing_if = "Option::is_none")]
935    pub type_: Option<String>,
936}
937
938/// <p>An object representing a filter on a <a>ListImages</a> operation.</p>
939#[derive(Clone, Debug, Default, PartialEq, Serialize)]
940#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
941pub struct ListImagesFilter {
942    /// <p>The tag status with which to filter your <a>ListImages</a> results. You can filter results based on whether they are <code>TAGGED</code> or <code>UNTAGGED</code>.</p>
943    #[serde(rename = "tagStatus")]
944    #[serde(skip_serializing_if = "Option::is_none")]
945    pub tag_status: Option<String>,
946}
947
948#[derive(Clone, Debug, Default, PartialEq, Serialize)]
949#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
950pub struct ListImagesRequest {
951    /// <p>The filter key and value with which to filter your <code>ListImages</code> results.</p>
952    #[serde(rename = "filter")]
953    #[serde(skip_serializing_if = "Option::is_none")]
954    pub filter: Option<ListImagesFilter>,
955    /// <p>The maximum number of image results returned by <code>ListImages</code> in paginated output. When this parameter is used, <code>ListImages</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>ListImages</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>ListImages</code> returns up to 100 results and a <code>nextToken</code> value, if applicable.</p>
956    #[serde(rename = "maxResults")]
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub max_results: Option<i64>,
959    /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>ListImages</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.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p>
960    #[serde(rename = "nextToken")]
961    #[serde(skip_serializing_if = "Option::is_none")]
962    pub next_token: Option<String>,
963    /// <p>The AWS account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed.</p>
964    #[serde(rename = "registryId")]
965    #[serde(skip_serializing_if = "Option::is_none")]
966    pub registry_id: Option<String>,
967    /// <p>The repository with image IDs to be listed.</p>
968    #[serde(rename = "repositoryName")]
969    pub repository_name: String,
970}
971
972#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
973#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
974pub struct ListImagesResponse {
975    /// <p>The list of image IDs for the requested repository.</p>
976    #[serde(rename = "imageIds")]
977    #[serde(skip_serializing_if = "Option::is_none")]
978    pub image_ids: Option<Vec<ImageIdentifier>>,
979    /// <p>The <code>nextToken</code> value to include in a future <code>ListImages</code> request. When the results of a <code>ListImages</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
980    #[serde(rename = "nextToken")]
981    #[serde(skip_serializing_if = "Option::is_none")]
982    pub next_token: Option<String>,
983}
984
985#[derive(Clone, Debug, Default, PartialEq, Serialize)]
986#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
987pub struct ListTagsForResourceRequest {
988    /// <p>The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the only supported resource is an Amazon ECR repository.</p>
989    #[serde(rename = "resourceArn")]
990    pub resource_arn: String,
991}
992
993#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
994#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
995pub struct ListTagsForResourceResponse {
996    /// <p>The tags for the resource.</p>
997    #[serde(rename = "tags")]
998    #[serde(skip_serializing_if = "Option::is_none")]
999    pub tags: Option<Vec<Tag>>,
1000}
1001
1002#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1003#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1004pub struct PutImageRequest {
1005    /// <p>The image digest of the image manifest corresponding to the image.</p>
1006    #[serde(rename = "imageDigest")]
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub image_digest: Option<String>,
1009    /// <p>The image manifest corresponding to the image to be uploaded.</p>
1010    #[serde(rename = "imageManifest")]
1011    pub image_manifest: String,
1012    /// <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>
1013    #[serde(rename = "imageManifestMediaType")]
1014    #[serde(skip_serializing_if = "Option::is_none")]
1015    pub image_manifest_media_type: Option<String>,
1016    /// <p>The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or OCI formats.</p>
1017    #[serde(rename = "imageTag")]
1018    #[serde(skip_serializing_if = "Option::is_none")]
1019    pub image_tag: Option<String>,
1020    /// <p>The AWS 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>
1021    #[serde(rename = "registryId")]
1022    #[serde(skip_serializing_if = "Option::is_none")]
1023    pub registry_id: Option<String>,
1024    /// <p>The name of the repository in which to put the image.</p>
1025    #[serde(rename = "repositoryName")]
1026    pub repository_name: String,
1027}
1028
1029#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1030#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1031pub struct PutImageResponse {
1032    /// <p>Details of the image uploaded.</p>
1033    #[serde(rename = "image")]
1034    #[serde(skip_serializing_if = "Option::is_none")]
1035    pub image: Option<Image>,
1036}
1037
1038#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1039#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1040pub struct PutImageScanningConfigurationRequest {
1041    /// <p>The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>
1042    #[serde(rename = "imageScanningConfiguration")]
1043    pub image_scanning_configuration: ImageScanningConfiguration,
1044    /// <p>The AWS account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed.</p>
1045    #[serde(rename = "registryId")]
1046    #[serde(skip_serializing_if = "Option::is_none")]
1047    pub registry_id: Option<String>,
1048    /// <p>The name of the repository in which to update the image scanning configuration setting.</p>
1049    #[serde(rename = "repositoryName")]
1050    pub repository_name: String,
1051}
1052
1053#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1054#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1055pub struct PutImageScanningConfigurationResponse {
1056    /// <p>The image scanning configuration setting for the repository.</p>
1057    #[serde(rename = "imageScanningConfiguration")]
1058    #[serde(skip_serializing_if = "Option::is_none")]
1059    pub image_scanning_configuration: Option<ImageScanningConfiguration>,
1060    /// <p>The registry ID associated with the request.</p>
1061    #[serde(rename = "registryId")]
1062    #[serde(skip_serializing_if = "Option::is_none")]
1063    pub registry_id: Option<String>,
1064    /// <p>The repository name associated with the request.</p>
1065    #[serde(rename = "repositoryName")]
1066    #[serde(skip_serializing_if = "Option::is_none")]
1067    pub repository_name: Option<String>,
1068}
1069
1070#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1071#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1072pub struct PutImageTagMutabilityRequest {
1073    /// <p>The tag mutability setting for the repository. If <code>MUTABLE</code> is specified, image tags can be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>
1074    #[serde(rename = "imageTagMutability")]
1075    pub image_tag_mutability: String,
1076    /// <p>The AWS account ID associated with the registry that contains the repository in which to update the image tag mutability settings. If you do not specify a registry, the default registry is assumed.</p>
1077    #[serde(rename = "registryId")]
1078    #[serde(skip_serializing_if = "Option::is_none")]
1079    pub registry_id: Option<String>,
1080    /// <p>The name of the repository in which to update the image tag mutability settings.</p>
1081    #[serde(rename = "repositoryName")]
1082    pub repository_name: String,
1083}
1084
1085#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1086#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1087pub struct PutImageTagMutabilityResponse {
1088    /// <p>The image tag mutability setting for the repository.</p>
1089    #[serde(rename = "imageTagMutability")]
1090    #[serde(skip_serializing_if = "Option::is_none")]
1091    pub image_tag_mutability: Option<String>,
1092    /// <p>The registry ID associated with the request.</p>
1093    #[serde(rename = "registryId")]
1094    #[serde(skip_serializing_if = "Option::is_none")]
1095    pub registry_id: Option<String>,
1096    /// <p>The repository name associated with the request.</p>
1097    #[serde(rename = "repositoryName")]
1098    #[serde(skip_serializing_if = "Option::is_none")]
1099    pub repository_name: Option<String>,
1100}
1101
1102#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1103#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1104pub struct PutLifecyclePolicyRequest {
1105    /// <p>The JSON repository policy text to apply to the repository.</p>
1106    #[serde(rename = "lifecyclePolicyText")]
1107    pub lifecycle_policy_text: String,
1108    /// <p>The AWS account ID associated with the registry that contains the repository. If you do&#x2028; not specify a registry, the default registry is assumed.</p>
1109    #[serde(rename = "registryId")]
1110    #[serde(skip_serializing_if = "Option::is_none")]
1111    pub registry_id: Option<String>,
1112    /// <p>The name of the repository to receive the policy.</p>
1113    #[serde(rename = "repositoryName")]
1114    pub repository_name: String,
1115}
1116
1117#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1118#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1119pub struct PutLifecyclePolicyResponse {
1120    /// <p>The JSON repository policy text.</p>
1121    #[serde(rename = "lifecyclePolicyText")]
1122    #[serde(skip_serializing_if = "Option::is_none")]
1123    pub lifecycle_policy_text: Option<String>,
1124    /// <p>The registry ID associated with the request.</p>
1125    #[serde(rename = "registryId")]
1126    #[serde(skip_serializing_if = "Option::is_none")]
1127    pub registry_id: Option<String>,
1128    /// <p>The repository name associated with the request.</p>
1129    #[serde(rename = "repositoryName")]
1130    #[serde(skip_serializing_if = "Option::is_none")]
1131    pub repository_name: Option<String>,
1132}
1133
1134/// <p>An object representing a repository.</p>
1135#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1136#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1137pub struct Repository {
1138    /// <p>The date and time, in JavaScript date format, when the repository was created.</p>
1139    #[serde(rename = "createdAt")]
1140    #[serde(skip_serializing_if = "Option::is_none")]
1141    pub created_at: Option<f64>,
1142    #[serde(rename = "imageScanningConfiguration")]
1143    #[serde(skip_serializing_if = "Option::is_none")]
1144    pub image_scanning_configuration: Option<ImageScanningConfiguration>,
1145    /// <p>The tag mutability setting for the repository.</p>
1146    #[serde(rename = "imageTagMutability")]
1147    #[serde(skip_serializing_if = "Option::is_none")]
1148    pub image_tag_mutability: Option<String>,
1149    /// <p>The AWS account ID associated with the registry that contains the repository.</p>
1150    #[serde(rename = "registryId")]
1151    #[serde(skip_serializing_if = "Option::is_none")]
1152    pub registry_id: Option<String>,
1153    /// <p>The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the <code>arn:aws:ecr</code> namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example, <code>arn:aws:ecr:region:012345678910:repository/test</code>.</p>
1154    #[serde(rename = "repositoryArn")]
1155    #[serde(skip_serializing_if = "Option::is_none")]
1156    pub repository_arn: Option<String>,
1157    /// <p>The name of the repository.</p>
1158    #[serde(rename = "repositoryName")]
1159    #[serde(skip_serializing_if = "Option::is_none")]
1160    pub repository_name: Option<String>,
1161    /// <p>The URI for the repository. You can use this URI for Docker <code>push</code> or <code>pull</code> operations.</p>
1162    #[serde(rename = "repositoryUri")]
1163    #[serde(skip_serializing_if = "Option::is_none")]
1164    pub repository_uri: Option<String>,
1165}
1166
1167#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1168#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1169pub struct SetRepositoryPolicyRequest {
1170    /// <p>If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the <a>SetRepositoryPolicy</a> operation. This is intended to prevent accidental repository lock outs.</p>
1171    #[serde(rename = "force")]
1172    #[serde(skip_serializing_if = "Option::is_none")]
1173    pub force: Option<bool>,
1174    /// <p>The JSON repository policy text to apply to the repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html">Amazon ECR Repository Policies</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
1175    #[serde(rename = "policyText")]
1176    pub policy_text: String,
1177    /// <p>The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
1178    #[serde(rename = "registryId")]
1179    #[serde(skip_serializing_if = "Option::is_none")]
1180    pub registry_id: Option<String>,
1181    /// <p>The name of the repository to receive the policy.</p>
1182    #[serde(rename = "repositoryName")]
1183    pub repository_name: String,
1184}
1185
1186#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1187#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1188pub struct SetRepositoryPolicyResponse {
1189    /// <p>The JSON repository policy text applied to the repository.</p>
1190    #[serde(rename = "policyText")]
1191    #[serde(skip_serializing_if = "Option::is_none")]
1192    pub policy_text: Option<String>,
1193    /// <p>The registry ID associated with the request.</p>
1194    #[serde(rename = "registryId")]
1195    #[serde(skip_serializing_if = "Option::is_none")]
1196    pub registry_id: Option<String>,
1197    /// <p>The repository name associated with the request.</p>
1198    #[serde(rename = "repositoryName")]
1199    #[serde(skip_serializing_if = "Option::is_none")]
1200    pub repository_name: Option<String>,
1201}
1202
1203#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1204#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1205pub struct StartImageScanRequest {
1206    #[serde(rename = "imageId")]
1207    pub image_id: ImageIdentifier,
1208    /// <p>The AWS account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.</p>
1209    #[serde(rename = "registryId")]
1210    #[serde(skip_serializing_if = "Option::is_none")]
1211    pub registry_id: Option<String>,
1212    /// <p>The name of the repository that contains the images to scan.</p>
1213    #[serde(rename = "repositoryName")]
1214    pub repository_name: String,
1215}
1216
1217#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1218#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1219pub struct StartImageScanResponse {
1220    #[serde(rename = "imageId")]
1221    #[serde(skip_serializing_if = "Option::is_none")]
1222    pub image_id: Option<ImageIdentifier>,
1223    /// <p>The current state of the scan.</p>
1224    #[serde(rename = "imageScanStatus")]
1225    #[serde(skip_serializing_if = "Option::is_none")]
1226    pub image_scan_status: Option<ImageScanStatus>,
1227    /// <p>The registry ID associated with the request.</p>
1228    #[serde(rename = "registryId")]
1229    #[serde(skip_serializing_if = "Option::is_none")]
1230    pub registry_id: Option<String>,
1231    /// <p>The repository name associated with the request.</p>
1232    #[serde(rename = "repositoryName")]
1233    #[serde(skip_serializing_if = "Option::is_none")]
1234    pub repository_name: Option<String>,
1235}
1236
1237#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1238#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1239pub struct StartLifecyclePolicyPreviewRequest {
1240    /// <p>The policy to be evaluated against. If you do not specify a policy, the current policy for the repository is used.</p>
1241    #[serde(rename = "lifecyclePolicyText")]
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub lifecycle_policy_text: Option<String>,
1244    /// <p>The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
1245    #[serde(rename = "registryId")]
1246    #[serde(skip_serializing_if = "Option::is_none")]
1247    pub registry_id: Option<String>,
1248    /// <p>The name of the repository to be evaluated.</p>
1249    #[serde(rename = "repositoryName")]
1250    pub repository_name: String,
1251}
1252
1253#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1254#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1255pub struct StartLifecyclePolicyPreviewResponse {
1256    /// <p>The JSON repository policy text.</p>
1257    #[serde(rename = "lifecyclePolicyText")]
1258    #[serde(skip_serializing_if = "Option::is_none")]
1259    pub lifecycle_policy_text: Option<String>,
1260    /// <p>The registry ID associated with the request.</p>
1261    #[serde(rename = "registryId")]
1262    #[serde(skip_serializing_if = "Option::is_none")]
1263    pub registry_id: Option<String>,
1264    /// <p>The repository name associated with the request.</p>
1265    #[serde(rename = "repositoryName")]
1266    #[serde(skip_serializing_if = "Option::is_none")]
1267    pub repository_name: Option<String>,
1268    /// <p>The status of the lifecycle policy preview request.</p>
1269    #[serde(rename = "status")]
1270    #[serde(skip_serializing_if = "Option::is_none")]
1271    pub status: Option<String>,
1272}
1273
1274/// <p>The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
1275#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
1276pub struct Tag {
1277    /// <p>One part of a key-value pair that make up a tag. A <code>key</code> is a general label that acts like a category for more specific tag values.</p>
1278    #[serde(rename = "Key")]
1279    #[serde(skip_serializing_if = "Option::is_none")]
1280    pub key: Option<String>,
1281    /// <p>The optional part of a key-value pair that make up a tag. A <code>value</code> acts as a descriptor within a tag category (key).</p>
1282    #[serde(rename = "Value")]
1283    #[serde(skip_serializing_if = "Option::is_none")]
1284    pub value: Option<String>,
1285}
1286
1287#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1288#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1289pub struct TagResourceRequest {
1290    /// <p>The Amazon Resource Name (ARN) of the the resource to which to add tags. Currently, the only supported resource is an Amazon ECR repository.</p>
1291    #[serde(rename = "resourceArn")]
1292    pub resource_arn: String,
1293    /// <p>The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
1294    #[serde(rename = "tags")]
1295    pub tags: Vec<Tag>,
1296}
1297
1298#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1299#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1300pub struct TagResourceResponse {}
1301
1302#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1303#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1304pub struct UntagResourceRequest {
1305    /// <p>The Amazon Resource Name (ARN) of the resource from which to remove tags. Currently, the only supported resource is an Amazon ECR repository.</p>
1306    #[serde(rename = "resourceArn")]
1307    pub resource_arn: String,
1308    /// <p>The keys of the tags to be removed.</p>
1309    #[serde(rename = "tagKeys")]
1310    pub tag_keys: Vec<String>,
1311}
1312
1313#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1314#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1315pub struct UntagResourceResponse {}
1316
1317#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1318#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1319pub struct UploadLayerPartRequest {
1320    /// <p>The base64-encoded layer part payload.</p>
1321    #[serde(rename = "layerPartBlob")]
1322    #[serde(
1323        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
1324        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
1325        default
1326    )]
1327    pub layer_part_blob: bytes::Bytes,
1328    /// <p>The position of the first byte of the layer part witin the overall image layer.</p>
1329    #[serde(rename = "partFirstByte")]
1330    pub part_first_byte: i64,
1331    /// <p>The position of the last byte of the layer part within the overall image layer.</p>
1332    #[serde(rename = "partLastByte")]
1333    pub part_last_byte: i64,
1334    /// <p>The AWS account ID associated with the registry to which you are uploading layer parts. If you do not specify a registry, the default registry is assumed.</p>
1335    #[serde(rename = "registryId")]
1336    #[serde(skip_serializing_if = "Option::is_none")]
1337    pub registry_id: Option<String>,
1338    /// <p>The name of the repository to which you are uploading layer parts.</p>
1339    #[serde(rename = "repositoryName")]
1340    pub repository_name: String,
1341    /// <p>The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the layer part upload.</p>
1342    #[serde(rename = "uploadId")]
1343    pub upload_id: String,
1344}
1345
1346#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1347#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1348pub struct UploadLayerPartResponse {
1349    /// <p>The integer value of the last byte received in the request.</p>
1350    #[serde(rename = "lastByteReceived")]
1351    #[serde(skip_serializing_if = "Option::is_none")]
1352    pub last_byte_received: Option<i64>,
1353    /// <p>The registry ID associated with the request.</p>
1354    #[serde(rename = "registryId")]
1355    #[serde(skip_serializing_if = "Option::is_none")]
1356    pub registry_id: Option<String>,
1357    /// <p>The repository name associated with the request.</p>
1358    #[serde(rename = "repositoryName")]
1359    #[serde(skip_serializing_if = "Option::is_none")]
1360    pub repository_name: Option<String>,
1361    /// <p>The upload ID associated with the request.</p>
1362    #[serde(rename = "uploadId")]
1363    #[serde(skip_serializing_if = "Option::is_none")]
1364    pub upload_id: Option<String>,
1365}
1366
1367/// Errors returned by BatchCheckLayerAvailability
1368#[derive(Debug, PartialEq)]
1369pub enum BatchCheckLayerAvailabilityError {
1370    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1371    InvalidParameter(String),
1372    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1373    RepositoryNotFound(String),
1374    /// <p>These errors are usually caused by a server-side issue.</p>
1375    Server(String),
1376}
1377
1378impl BatchCheckLayerAvailabilityError {
1379    pub fn from_response(
1380        res: BufferedHttpResponse,
1381    ) -> RusotoError<BatchCheckLayerAvailabilityError> {
1382        if let Some(err) = proto::json::Error::parse(&res) {
1383            match err.typ.as_str() {
1384                "InvalidParameterException" => {
1385                    return RusotoError::Service(
1386                        BatchCheckLayerAvailabilityError::InvalidParameter(err.msg),
1387                    )
1388                }
1389                "RepositoryNotFoundException" => {
1390                    return RusotoError::Service(
1391                        BatchCheckLayerAvailabilityError::RepositoryNotFound(err.msg),
1392                    )
1393                }
1394                "ServerException" => {
1395                    return RusotoError::Service(BatchCheckLayerAvailabilityError::Server(err.msg))
1396                }
1397                "ValidationException" => return RusotoError::Validation(err.msg),
1398                _ => {}
1399            }
1400        }
1401        RusotoError::Unknown(res)
1402    }
1403}
1404impl fmt::Display for BatchCheckLayerAvailabilityError {
1405    #[allow(unused_variables)]
1406    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1407        match *self {
1408            BatchCheckLayerAvailabilityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1409            BatchCheckLayerAvailabilityError::RepositoryNotFound(ref cause) => {
1410                write!(f, "{}", cause)
1411            }
1412            BatchCheckLayerAvailabilityError::Server(ref cause) => write!(f, "{}", cause),
1413        }
1414    }
1415}
1416impl Error for BatchCheckLayerAvailabilityError {}
1417/// Errors returned by BatchDeleteImage
1418#[derive(Debug, PartialEq)]
1419pub enum BatchDeleteImageError {
1420    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1421    InvalidParameter(String),
1422    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1423    RepositoryNotFound(String),
1424    /// <p>These errors are usually caused by a server-side issue.</p>
1425    Server(String),
1426}
1427
1428impl BatchDeleteImageError {
1429    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchDeleteImageError> {
1430        if let Some(err) = proto::json::Error::parse(&res) {
1431            match err.typ.as_str() {
1432                "InvalidParameterException" => {
1433                    return RusotoError::Service(BatchDeleteImageError::InvalidParameter(err.msg))
1434                }
1435                "RepositoryNotFoundException" => {
1436                    return RusotoError::Service(BatchDeleteImageError::RepositoryNotFound(err.msg))
1437                }
1438                "ServerException" => {
1439                    return RusotoError::Service(BatchDeleteImageError::Server(err.msg))
1440                }
1441                "ValidationException" => return RusotoError::Validation(err.msg),
1442                _ => {}
1443            }
1444        }
1445        RusotoError::Unknown(res)
1446    }
1447}
1448impl fmt::Display for BatchDeleteImageError {
1449    #[allow(unused_variables)]
1450    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1451        match *self {
1452            BatchDeleteImageError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1453            BatchDeleteImageError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1454            BatchDeleteImageError::Server(ref cause) => write!(f, "{}", cause),
1455        }
1456    }
1457}
1458impl Error for BatchDeleteImageError {}
1459/// Errors returned by BatchGetImage
1460#[derive(Debug, PartialEq)]
1461pub enum BatchGetImageError {
1462    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1463    InvalidParameter(String),
1464    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1465    RepositoryNotFound(String),
1466    /// <p>These errors are usually caused by a server-side issue.</p>
1467    Server(String),
1468}
1469
1470impl BatchGetImageError {
1471    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetImageError> {
1472        if let Some(err) = proto::json::Error::parse(&res) {
1473            match err.typ.as_str() {
1474                "InvalidParameterException" => {
1475                    return RusotoError::Service(BatchGetImageError::InvalidParameter(err.msg))
1476                }
1477                "RepositoryNotFoundException" => {
1478                    return RusotoError::Service(BatchGetImageError::RepositoryNotFound(err.msg))
1479                }
1480                "ServerException" => {
1481                    return RusotoError::Service(BatchGetImageError::Server(err.msg))
1482                }
1483                "ValidationException" => return RusotoError::Validation(err.msg),
1484                _ => {}
1485            }
1486        }
1487        RusotoError::Unknown(res)
1488    }
1489}
1490impl fmt::Display for BatchGetImageError {
1491    #[allow(unused_variables)]
1492    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1493        match *self {
1494            BatchGetImageError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1495            BatchGetImageError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1496            BatchGetImageError::Server(ref cause) => write!(f, "{}", cause),
1497        }
1498    }
1499}
1500impl Error for BatchGetImageError {}
1501/// Errors returned by CompleteLayerUpload
1502#[derive(Debug, PartialEq)]
1503pub enum CompleteLayerUploadError {
1504    /// <p>The specified layer upload does not contain any layer parts.</p>
1505    EmptyUpload(String),
1506    /// <p>The layer digest calculation performed by Amazon ECR upon receipt of the image layer does not match the digest specified.</p>
1507    InvalidLayer(String),
1508    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1509    InvalidParameter(String),
1510    /// <p>The image layer already exists in the associated repository.</p>
1511    LayerAlreadyExists(String),
1512    /// <p>Layer parts must be at least 5 MiB in size.</p>
1513    LayerPartTooSmall(String),
1514    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1515    RepositoryNotFound(String),
1516    /// <p>These errors are usually caused by a server-side issue.</p>
1517    Server(String),
1518    /// <p>The upload could not be found, or the specified upload id is not valid for this repository.</p>
1519    UploadNotFound(String),
1520}
1521
1522impl CompleteLayerUploadError {
1523    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CompleteLayerUploadError> {
1524        if let Some(err) = proto::json::Error::parse(&res) {
1525            match err.typ.as_str() {
1526                "EmptyUploadException" => {
1527                    return RusotoError::Service(CompleteLayerUploadError::EmptyUpload(err.msg))
1528                }
1529                "InvalidLayerException" => {
1530                    return RusotoError::Service(CompleteLayerUploadError::InvalidLayer(err.msg))
1531                }
1532                "InvalidParameterException" => {
1533                    return RusotoError::Service(CompleteLayerUploadError::InvalidParameter(
1534                        err.msg,
1535                    ))
1536                }
1537                "LayerAlreadyExistsException" => {
1538                    return RusotoError::Service(CompleteLayerUploadError::LayerAlreadyExists(
1539                        err.msg,
1540                    ))
1541                }
1542                "LayerPartTooSmallException" => {
1543                    return RusotoError::Service(CompleteLayerUploadError::LayerPartTooSmall(
1544                        err.msg,
1545                    ))
1546                }
1547                "RepositoryNotFoundException" => {
1548                    return RusotoError::Service(CompleteLayerUploadError::RepositoryNotFound(
1549                        err.msg,
1550                    ))
1551                }
1552                "ServerException" => {
1553                    return RusotoError::Service(CompleteLayerUploadError::Server(err.msg))
1554                }
1555                "UploadNotFoundException" => {
1556                    return RusotoError::Service(CompleteLayerUploadError::UploadNotFound(err.msg))
1557                }
1558                "ValidationException" => return RusotoError::Validation(err.msg),
1559                _ => {}
1560            }
1561        }
1562        RusotoError::Unknown(res)
1563    }
1564}
1565impl fmt::Display for CompleteLayerUploadError {
1566    #[allow(unused_variables)]
1567    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1568        match *self {
1569            CompleteLayerUploadError::EmptyUpload(ref cause) => write!(f, "{}", cause),
1570            CompleteLayerUploadError::InvalidLayer(ref cause) => write!(f, "{}", cause),
1571            CompleteLayerUploadError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1572            CompleteLayerUploadError::LayerAlreadyExists(ref cause) => write!(f, "{}", cause),
1573            CompleteLayerUploadError::LayerPartTooSmall(ref cause) => write!(f, "{}", cause),
1574            CompleteLayerUploadError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1575            CompleteLayerUploadError::Server(ref cause) => write!(f, "{}", cause),
1576            CompleteLayerUploadError::UploadNotFound(ref cause) => write!(f, "{}", cause),
1577        }
1578    }
1579}
1580impl Error for CompleteLayerUploadError {}
1581/// Errors returned by CreateRepository
1582#[derive(Debug, PartialEq)]
1583pub enum CreateRepositoryError {
1584    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1585    InvalidParameter(String),
1586    /// <p>An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
1587    InvalidTagParameter(String),
1588    /// <p>The operation did not succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR Service Quotas</a> in the Amazon Elastic Container Registry User Guide.</p>
1589    LimitExceeded(String),
1590    /// <p>The specified repository already exists in the specified registry.</p>
1591    RepositoryAlreadyExists(String),
1592    /// <p>These errors are usually caused by a server-side issue.</p>
1593    Server(String),
1594    /// <p>The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.</p>
1595    TooManyTags(String),
1596}
1597
1598impl CreateRepositoryError {
1599    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateRepositoryError> {
1600        if let Some(err) = proto::json::Error::parse(&res) {
1601            match err.typ.as_str() {
1602                "InvalidParameterException" => {
1603                    return RusotoError::Service(CreateRepositoryError::InvalidParameter(err.msg))
1604                }
1605                "InvalidTagParameterException" => {
1606                    return RusotoError::Service(CreateRepositoryError::InvalidTagParameter(
1607                        err.msg,
1608                    ))
1609                }
1610                "LimitExceededException" => {
1611                    return RusotoError::Service(CreateRepositoryError::LimitExceeded(err.msg))
1612                }
1613                "RepositoryAlreadyExistsException" => {
1614                    return RusotoError::Service(CreateRepositoryError::RepositoryAlreadyExists(
1615                        err.msg,
1616                    ))
1617                }
1618                "ServerException" => {
1619                    return RusotoError::Service(CreateRepositoryError::Server(err.msg))
1620                }
1621                "TooManyTagsException" => {
1622                    return RusotoError::Service(CreateRepositoryError::TooManyTags(err.msg))
1623                }
1624                "ValidationException" => return RusotoError::Validation(err.msg),
1625                _ => {}
1626            }
1627        }
1628        RusotoError::Unknown(res)
1629    }
1630}
1631impl fmt::Display for CreateRepositoryError {
1632    #[allow(unused_variables)]
1633    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1634        match *self {
1635            CreateRepositoryError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1636            CreateRepositoryError::InvalidTagParameter(ref cause) => write!(f, "{}", cause),
1637            CreateRepositoryError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1638            CreateRepositoryError::RepositoryAlreadyExists(ref cause) => write!(f, "{}", cause),
1639            CreateRepositoryError::Server(ref cause) => write!(f, "{}", cause),
1640            CreateRepositoryError::TooManyTags(ref cause) => write!(f, "{}", cause),
1641        }
1642    }
1643}
1644impl Error for CreateRepositoryError {}
1645/// Errors returned by DeleteLifecyclePolicy
1646#[derive(Debug, PartialEq)]
1647pub enum DeleteLifecyclePolicyError {
1648    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1649    InvalidParameter(String),
1650    /// <p>The lifecycle policy could not be found, and no policy is set to the repository.</p>
1651    LifecyclePolicyNotFound(String),
1652    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1653    RepositoryNotFound(String),
1654    /// <p>These errors are usually caused by a server-side issue.</p>
1655    Server(String),
1656}
1657
1658impl DeleteLifecyclePolicyError {
1659    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLifecyclePolicyError> {
1660        if let Some(err) = proto::json::Error::parse(&res) {
1661            match err.typ.as_str() {
1662                "InvalidParameterException" => {
1663                    return RusotoError::Service(DeleteLifecyclePolicyError::InvalidParameter(
1664                        err.msg,
1665                    ))
1666                }
1667                "LifecyclePolicyNotFoundException" => {
1668                    return RusotoError::Service(
1669                        DeleteLifecyclePolicyError::LifecyclePolicyNotFound(err.msg),
1670                    )
1671                }
1672                "RepositoryNotFoundException" => {
1673                    return RusotoError::Service(DeleteLifecyclePolicyError::RepositoryNotFound(
1674                        err.msg,
1675                    ))
1676                }
1677                "ServerException" => {
1678                    return RusotoError::Service(DeleteLifecyclePolicyError::Server(err.msg))
1679                }
1680                "ValidationException" => return RusotoError::Validation(err.msg),
1681                _ => {}
1682            }
1683        }
1684        RusotoError::Unknown(res)
1685    }
1686}
1687impl fmt::Display for DeleteLifecyclePolicyError {
1688    #[allow(unused_variables)]
1689    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1690        match *self {
1691            DeleteLifecyclePolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1692            DeleteLifecyclePolicyError::LifecyclePolicyNotFound(ref cause) => {
1693                write!(f, "{}", cause)
1694            }
1695            DeleteLifecyclePolicyError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1696            DeleteLifecyclePolicyError::Server(ref cause) => write!(f, "{}", cause),
1697        }
1698    }
1699}
1700impl Error for DeleteLifecyclePolicyError {}
1701/// Errors returned by DeleteRepository
1702#[derive(Debug, PartialEq)]
1703pub enum DeleteRepositoryError {
1704    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1705    InvalidParameter(String),
1706    /// <p>The specified repository contains images. To delete a repository that contains images, you must force the deletion with the <code>force</code> parameter.</p>
1707    RepositoryNotEmpty(String),
1708    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1709    RepositoryNotFound(String),
1710    /// <p>These errors are usually caused by a server-side issue.</p>
1711    Server(String),
1712}
1713
1714impl DeleteRepositoryError {
1715    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRepositoryError> {
1716        if let Some(err) = proto::json::Error::parse(&res) {
1717            match err.typ.as_str() {
1718                "InvalidParameterException" => {
1719                    return RusotoError::Service(DeleteRepositoryError::InvalidParameter(err.msg))
1720                }
1721                "RepositoryNotEmptyException" => {
1722                    return RusotoError::Service(DeleteRepositoryError::RepositoryNotEmpty(err.msg))
1723                }
1724                "RepositoryNotFoundException" => {
1725                    return RusotoError::Service(DeleteRepositoryError::RepositoryNotFound(err.msg))
1726                }
1727                "ServerException" => {
1728                    return RusotoError::Service(DeleteRepositoryError::Server(err.msg))
1729                }
1730                "ValidationException" => return RusotoError::Validation(err.msg),
1731                _ => {}
1732            }
1733        }
1734        RusotoError::Unknown(res)
1735    }
1736}
1737impl fmt::Display for DeleteRepositoryError {
1738    #[allow(unused_variables)]
1739    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1740        match *self {
1741            DeleteRepositoryError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1742            DeleteRepositoryError::RepositoryNotEmpty(ref cause) => write!(f, "{}", cause),
1743            DeleteRepositoryError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1744            DeleteRepositoryError::Server(ref cause) => write!(f, "{}", cause),
1745        }
1746    }
1747}
1748impl Error for DeleteRepositoryError {}
1749/// Errors returned by DeleteRepositoryPolicy
1750#[derive(Debug, PartialEq)]
1751pub enum DeleteRepositoryPolicyError {
1752    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1753    InvalidParameter(String),
1754    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1755    RepositoryNotFound(String),
1756    /// <p>The specified repository and registry combination does not have an associated repository policy.</p>
1757    RepositoryPolicyNotFound(String),
1758    /// <p>These errors are usually caused by a server-side issue.</p>
1759    Server(String),
1760}
1761
1762impl DeleteRepositoryPolicyError {
1763    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRepositoryPolicyError> {
1764        if let Some(err) = proto::json::Error::parse(&res) {
1765            match err.typ.as_str() {
1766                "InvalidParameterException" => {
1767                    return RusotoError::Service(DeleteRepositoryPolicyError::InvalidParameter(
1768                        err.msg,
1769                    ))
1770                }
1771                "RepositoryNotFoundException" => {
1772                    return RusotoError::Service(DeleteRepositoryPolicyError::RepositoryNotFound(
1773                        err.msg,
1774                    ))
1775                }
1776                "RepositoryPolicyNotFoundException" => {
1777                    return RusotoError::Service(
1778                        DeleteRepositoryPolicyError::RepositoryPolicyNotFound(err.msg),
1779                    )
1780                }
1781                "ServerException" => {
1782                    return RusotoError::Service(DeleteRepositoryPolicyError::Server(err.msg))
1783                }
1784                "ValidationException" => return RusotoError::Validation(err.msg),
1785                _ => {}
1786            }
1787        }
1788        RusotoError::Unknown(res)
1789    }
1790}
1791impl fmt::Display for DeleteRepositoryPolicyError {
1792    #[allow(unused_variables)]
1793    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1794        match *self {
1795            DeleteRepositoryPolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1796            DeleteRepositoryPolicyError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1797            DeleteRepositoryPolicyError::RepositoryPolicyNotFound(ref cause) => {
1798                write!(f, "{}", cause)
1799            }
1800            DeleteRepositoryPolicyError::Server(ref cause) => write!(f, "{}", cause),
1801        }
1802    }
1803}
1804impl Error for DeleteRepositoryPolicyError {}
1805/// Errors returned by DescribeImageScanFindings
1806#[derive(Debug, PartialEq)]
1807pub enum DescribeImageScanFindingsError {
1808    /// <p>The image requested does not exist in the specified repository.</p>
1809    ImageNotFound(String),
1810    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1811    InvalidParameter(String),
1812    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1813    RepositoryNotFound(String),
1814    /// <p>The specified image scan could not be found. Ensure that image scanning is enabled on the repository and try again.</p>
1815    ScanNotFound(String),
1816    /// <p>These errors are usually caused by a server-side issue.</p>
1817    Server(String),
1818}
1819
1820impl DescribeImageScanFindingsError {
1821    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeImageScanFindingsError> {
1822        if let Some(err) = proto::json::Error::parse(&res) {
1823            match err.typ.as_str() {
1824                "ImageNotFoundException" => {
1825                    return RusotoError::Service(DescribeImageScanFindingsError::ImageNotFound(
1826                        err.msg,
1827                    ))
1828                }
1829                "InvalidParameterException" => {
1830                    return RusotoError::Service(DescribeImageScanFindingsError::InvalidParameter(
1831                        err.msg,
1832                    ))
1833                }
1834                "RepositoryNotFoundException" => {
1835                    return RusotoError::Service(
1836                        DescribeImageScanFindingsError::RepositoryNotFound(err.msg),
1837                    )
1838                }
1839                "ScanNotFoundException" => {
1840                    return RusotoError::Service(DescribeImageScanFindingsError::ScanNotFound(
1841                        err.msg,
1842                    ))
1843                }
1844                "ServerException" => {
1845                    return RusotoError::Service(DescribeImageScanFindingsError::Server(err.msg))
1846                }
1847                "ValidationException" => return RusotoError::Validation(err.msg),
1848                _ => {}
1849            }
1850        }
1851        RusotoError::Unknown(res)
1852    }
1853}
1854impl fmt::Display for DescribeImageScanFindingsError {
1855    #[allow(unused_variables)]
1856    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1857        match *self {
1858            DescribeImageScanFindingsError::ImageNotFound(ref cause) => write!(f, "{}", cause),
1859            DescribeImageScanFindingsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1860            DescribeImageScanFindingsError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1861            DescribeImageScanFindingsError::ScanNotFound(ref cause) => write!(f, "{}", cause),
1862            DescribeImageScanFindingsError::Server(ref cause) => write!(f, "{}", cause),
1863        }
1864    }
1865}
1866impl Error for DescribeImageScanFindingsError {}
1867/// Errors returned by DescribeImages
1868#[derive(Debug, PartialEq)]
1869pub enum DescribeImagesError {
1870    /// <p>The image requested does not exist in the specified repository.</p>
1871    ImageNotFound(String),
1872    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1873    InvalidParameter(String),
1874    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1875    RepositoryNotFound(String),
1876    /// <p>These errors are usually caused by a server-side issue.</p>
1877    Server(String),
1878}
1879
1880impl DescribeImagesError {
1881    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeImagesError> {
1882        if let Some(err) = proto::json::Error::parse(&res) {
1883            match err.typ.as_str() {
1884                "ImageNotFoundException" => {
1885                    return RusotoError::Service(DescribeImagesError::ImageNotFound(err.msg))
1886                }
1887                "InvalidParameterException" => {
1888                    return RusotoError::Service(DescribeImagesError::InvalidParameter(err.msg))
1889                }
1890                "RepositoryNotFoundException" => {
1891                    return RusotoError::Service(DescribeImagesError::RepositoryNotFound(err.msg))
1892                }
1893                "ServerException" => {
1894                    return RusotoError::Service(DescribeImagesError::Server(err.msg))
1895                }
1896                "ValidationException" => return RusotoError::Validation(err.msg),
1897                _ => {}
1898            }
1899        }
1900        RusotoError::Unknown(res)
1901    }
1902}
1903impl fmt::Display for DescribeImagesError {
1904    #[allow(unused_variables)]
1905    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1906        match *self {
1907            DescribeImagesError::ImageNotFound(ref cause) => write!(f, "{}", cause),
1908            DescribeImagesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1909            DescribeImagesError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1910            DescribeImagesError::Server(ref cause) => write!(f, "{}", cause),
1911        }
1912    }
1913}
1914impl Error for DescribeImagesError {}
1915/// Errors returned by DescribeRepositories
1916#[derive(Debug, PartialEq)]
1917pub enum DescribeRepositoriesError {
1918    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1919    InvalidParameter(String),
1920    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
1921    RepositoryNotFound(String),
1922    /// <p>These errors are usually caused by a server-side issue.</p>
1923    Server(String),
1924}
1925
1926impl DescribeRepositoriesError {
1927    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeRepositoriesError> {
1928        if let Some(err) = proto::json::Error::parse(&res) {
1929            match err.typ.as_str() {
1930                "InvalidParameterException" => {
1931                    return RusotoError::Service(DescribeRepositoriesError::InvalidParameter(
1932                        err.msg,
1933                    ))
1934                }
1935                "RepositoryNotFoundException" => {
1936                    return RusotoError::Service(DescribeRepositoriesError::RepositoryNotFound(
1937                        err.msg,
1938                    ))
1939                }
1940                "ServerException" => {
1941                    return RusotoError::Service(DescribeRepositoriesError::Server(err.msg))
1942                }
1943                "ValidationException" => return RusotoError::Validation(err.msg),
1944                _ => {}
1945            }
1946        }
1947        RusotoError::Unknown(res)
1948    }
1949}
1950impl fmt::Display for DescribeRepositoriesError {
1951    #[allow(unused_variables)]
1952    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1953        match *self {
1954            DescribeRepositoriesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1955            DescribeRepositoriesError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
1956            DescribeRepositoriesError::Server(ref cause) => write!(f, "{}", cause),
1957        }
1958    }
1959}
1960impl Error for DescribeRepositoriesError {}
1961/// Errors returned by GetAuthorizationToken
1962#[derive(Debug, PartialEq)]
1963pub enum GetAuthorizationTokenError {
1964    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
1965    InvalidParameter(String),
1966    /// <p>These errors are usually caused by a server-side issue.</p>
1967    Server(String),
1968}
1969
1970impl GetAuthorizationTokenError {
1971    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAuthorizationTokenError> {
1972        if let Some(err) = proto::json::Error::parse(&res) {
1973            match err.typ.as_str() {
1974                "InvalidParameterException" => {
1975                    return RusotoError::Service(GetAuthorizationTokenError::InvalidParameter(
1976                        err.msg,
1977                    ))
1978                }
1979                "ServerException" => {
1980                    return RusotoError::Service(GetAuthorizationTokenError::Server(err.msg))
1981                }
1982                "ValidationException" => return RusotoError::Validation(err.msg),
1983                _ => {}
1984            }
1985        }
1986        RusotoError::Unknown(res)
1987    }
1988}
1989impl fmt::Display for GetAuthorizationTokenError {
1990    #[allow(unused_variables)]
1991    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1992        match *self {
1993            GetAuthorizationTokenError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1994            GetAuthorizationTokenError::Server(ref cause) => write!(f, "{}", cause),
1995        }
1996    }
1997}
1998impl Error for GetAuthorizationTokenError {}
1999/// Errors returned by GetDownloadUrlForLayer
2000#[derive(Debug, PartialEq)]
2001pub enum GetDownloadUrlForLayerError {
2002    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2003    InvalidParameter(String),
2004    /// <p>The specified layer is not available because it is not associated with an image. Unassociated image layers may be cleaned up at any time.</p>
2005    LayerInaccessible(String),
2006    /// <p>The specified layers could not be found, or the specified layer is not valid for this repository.</p>
2007    LayersNotFound(String),
2008    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2009    RepositoryNotFound(String),
2010    /// <p>These errors are usually caused by a server-side issue.</p>
2011    Server(String),
2012}
2013
2014impl GetDownloadUrlForLayerError {
2015    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDownloadUrlForLayerError> {
2016        if let Some(err) = proto::json::Error::parse(&res) {
2017            match err.typ.as_str() {
2018                "InvalidParameterException" => {
2019                    return RusotoError::Service(GetDownloadUrlForLayerError::InvalidParameter(
2020                        err.msg,
2021                    ))
2022                }
2023                "LayerInaccessibleException" => {
2024                    return RusotoError::Service(GetDownloadUrlForLayerError::LayerInaccessible(
2025                        err.msg,
2026                    ))
2027                }
2028                "LayersNotFoundException" => {
2029                    return RusotoError::Service(GetDownloadUrlForLayerError::LayersNotFound(
2030                        err.msg,
2031                    ))
2032                }
2033                "RepositoryNotFoundException" => {
2034                    return RusotoError::Service(GetDownloadUrlForLayerError::RepositoryNotFound(
2035                        err.msg,
2036                    ))
2037                }
2038                "ServerException" => {
2039                    return RusotoError::Service(GetDownloadUrlForLayerError::Server(err.msg))
2040                }
2041                "ValidationException" => return RusotoError::Validation(err.msg),
2042                _ => {}
2043            }
2044        }
2045        RusotoError::Unknown(res)
2046    }
2047}
2048impl fmt::Display for GetDownloadUrlForLayerError {
2049    #[allow(unused_variables)]
2050    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2051        match *self {
2052            GetDownloadUrlForLayerError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2053            GetDownloadUrlForLayerError::LayerInaccessible(ref cause) => write!(f, "{}", cause),
2054            GetDownloadUrlForLayerError::LayersNotFound(ref cause) => write!(f, "{}", cause),
2055            GetDownloadUrlForLayerError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2056            GetDownloadUrlForLayerError::Server(ref cause) => write!(f, "{}", cause),
2057        }
2058    }
2059}
2060impl Error for GetDownloadUrlForLayerError {}
2061/// Errors returned by GetLifecyclePolicy
2062#[derive(Debug, PartialEq)]
2063pub enum GetLifecyclePolicyError {
2064    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2065    InvalidParameter(String),
2066    /// <p>The lifecycle policy could not be found, and no policy is set to the repository.</p>
2067    LifecyclePolicyNotFound(String),
2068    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2069    RepositoryNotFound(String),
2070    /// <p>These errors are usually caused by a server-side issue.</p>
2071    Server(String),
2072}
2073
2074impl GetLifecyclePolicyError {
2075    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLifecyclePolicyError> {
2076        if let Some(err) = proto::json::Error::parse(&res) {
2077            match err.typ.as_str() {
2078                "InvalidParameterException" => {
2079                    return RusotoError::Service(GetLifecyclePolicyError::InvalidParameter(err.msg))
2080                }
2081                "LifecyclePolicyNotFoundException" => {
2082                    return RusotoError::Service(GetLifecyclePolicyError::LifecyclePolicyNotFound(
2083                        err.msg,
2084                    ))
2085                }
2086                "RepositoryNotFoundException" => {
2087                    return RusotoError::Service(GetLifecyclePolicyError::RepositoryNotFound(
2088                        err.msg,
2089                    ))
2090                }
2091                "ServerException" => {
2092                    return RusotoError::Service(GetLifecyclePolicyError::Server(err.msg))
2093                }
2094                "ValidationException" => return RusotoError::Validation(err.msg),
2095                _ => {}
2096            }
2097        }
2098        RusotoError::Unknown(res)
2099    }
2100}
2101impl fmt::Display for GetLifecyclePolicyError {
2102    #[allow(unused_variables)]
2103    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2104        match *self {
2105            GetLifecyclePolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2106            GetLifecyclePolicyError::LifecyclePolicyNotFound(ref cause) => write!(f, "{}", cause),
2107            GetLifecyclePolicyError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2108            GetLifecyclePolicyError::Server(ref cause) => write!(f, "{}", cause),
2109        }
2110    }
2111}
2112impl Error for GetLifecyclePolicyError {}
2113/// Errors returned by GetLifecyclePolicyPreview
2114#[derive(Debug, PartialEq)]
2115pub enum GetLifecyclePolicyPreviewError {
2116    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2117    InvalidParameter(String),
2118    /// <p>There is no dry run for this repository.</p>
2119    LifecyclePolicyPreviewNotFound(String),
2120    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2121    RepositoryNotFound(String),
2122    /// <p>These errors are usually caused by a server-side issue.</p>
2123    Server(String),
2124}
2125
2126impl GetLifecyclePolicyPreviewError {
2127    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLifecyclePolicyPreviewError> {
2128        if let Some(err) = proto::json::Error::parse(&res) {
2129            match err.typ.as_str() {
2130                "InvalidParameterException" => {
2131                    return RusotoError::Service(GetLifecyclePolicyPreviewError::InvalidParameter(
2132                        err.msg,
2133                    ))
2134                }
2135                "LifecyclePolicyPreviewNotFoundException" => {
2136                    return RusotoError::Service(
2137                        GetLifecyclePolicyPreviewError::LifecyclePolicyPreviewNotFound(err.msg),
2138                    )
2139                }
2140                "RepositoryNotFoundException" => {
2141                    return RusotoError::Service(
2142                        GetLifecyclePolicyPreviewError::RepositoryNotFound(err.msg),
2143                    )
2144                }
2145                "ServerException" => {
2146                    return RusotoError::Service(GetLifecyclePolicyPreviewError::Server(err.msg))
2147                }
2148                "ValidationException" => return RusotoError::Validation(err.msg),
2149                _ => {}
2150            }
2151        }
2152        RusotoError::Unknown(res)
2153    }
2154}
2155impl fmt::Display for GetLifecyclePolicyPreviewError {
2156    #[allow(unused_variables)]
2157    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2158        match *self {
2159            GetLifecyclePolicyPreviewError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2160            GetLifecyclePolicyPreviewError::LifecyclePolicyPreviewNotFound(ref cause) => {
2161                write!(f, "{}", cause)
2162            }
2163            GetLifecyclePolicyPreviewError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2164            GetLifecyclePolicyPreviewError::Server(ref cause) => write!(f, "{}", cause),
2165        }
2166    }
2167}
2168impl Error for GetLifecyclePolicyPreviewError {}
2169/// Errors returned by GetRepositoryPolicy
2170#[derive(Debug, PartialEq)]
2171pub enum GetRepositoryPolicyError {
2172    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2173    InvalidParameter(String),
2174    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2175    RepositoryNotFound(String),
2176    /// <p>The specified repository and registry combination does not have an associated repository policy.</p>
2177    RepositoryPolicyNotFound(String),
2178    /// <p>These errors are usually caused by a server-side issue.</p>
2179    Server(String),
2180}
2181
2182impl GetRepositoryPolicyError {
2183    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRepositoryPolicyError> {
2184        if let Some(err) = proto::json::Error::parse(&res) {
2185            match err.typ.as_str() {
2186                "InvalidParameterException" => {
2187                    return RusotoError::Service(GetRepositoryPolicyError::InvalidParameter(
2188                        err.msg,
2189                    ))
2190                }
2191                "RepositoryNotFoundException" => {
2192                    return RusotoError::Service(GetRepositoryPolicyError::RepositoryNotFound(
2193                        err.msg,
2194                    ))
2195                }
2196                "RepositoryPolicyNotFoundException" => {
2197                    return RusotoError::Service(
2198                        GetRepositoryPolicyError::RepositoryPolicyNotFound(err.msg),
2199                    )
2200                }
2201                "ServerException" => {
2202                    return RusotoError::Service(GetRepositoryPolicyError::Server(err.msg))
2203                }
2204                "ValidationException" => return RusotoError::Validation(err.msg),
2205                _ => {}
2206            }
2207        }
2208        RusotoError::Unknown(res)
2209    }
2210}
2211impl fmt::Display for GetRepositoryPolicyError {
2212    #[allow(unused_variables)]
2213    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2214        match *self {
2215            GetRepositoryPolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2216            GetRepositoryPolicyError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2217            GetRepositoryPolicyError::RepositoryPolicyNotFound(ref cause) => write!(f, "{}", cause),
2218            GetRepositoryPolicyError::Server(ref cause) => write!(f, "{}", cause),
2219        }
2220    }
2221}
2222impl Error for GetRepositoryPolicyError {}
2223/// Errors returned by InitiateLayerUpload
2224#[derive(Debug, PartialEq)]
2225pub enum InitiateLayerUploadError {
2226    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2227    InvalidParameter(String),
2228    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2229    RepositoryNotFound(String),
2230    /// <p>These errors are usually caused by a server-side issue.</p>
2231    Server(String),
2232}
2233
2234impl InitiateLayerUploadError {
2235    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<InitiateLayerUploadError> {
2236        if let Some(err) = proto::json::Error::parse(&res) {
2237            match err.typ.as_str() {
2238                "InvalidParameterException" => {
2239                    return RusotoError::Service(InitiateLayerUploadError::InvalidParameter(
2240                        err.msg,
2241                    ))
2242                }
2243                "RepositoryNotFoundException" => {
2244                    return RusotoError::Service(InitiateLayerUploadError::RepositoryNotFound(
2245                        err.msg,
2246                    ))
2247                }
2248                "ServerException" => {
2249                    return RusotoError::Service(InitiateLayerUploadError::Server(err.msg))
2250                }
2251                "ValidationException" => return RusotoError::Validation(err.msg),
2252                _ => {}
2253            }
2254        }
2255        RusotoError::Unknown(res)
2256    }
2257}
2258impl fmt::Display for InitiateLayerUploadError {
2259    #[allow(unused_variables)]
2260    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2261        match *self {
2262            InitiateLayerUploadError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2263            InitiateLayerUploadError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2264            InitiateLayerUploadError::Server(ref cause) => write!(f, "{}", cause),
2265        }
2266    }
2267}
2268impl Error for InitiateLayerUploadError {}
2269/// Errors returned by ListImages
2270#[derive(Debug, PartialEq)]
2271pub enum ListImagesError {
2272    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2273    InvalidParameter(String),
2274    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2275    RepositoryNotFound(String),
2276    /// <p>These errors are usually caused by a server-side issue.</p>
2277    Server(String),
2278}
2279
2280impl ListImagesError {
2281    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListImagesError> {
2282        if let Some(err) = proto::json::Error::parse(&res) {
2283            match err.typ.as_str() {
2284                "InvalidParameterException" => {
2285                    return RusotoError::Service(ListImagesError::InvalidParameter(err.msg))
2286                }
2287                "RepositoryNotFoundException" => {
2288                    return RusotoError::Service(ListImagesError::RepositoryNotFound(err.msg))
2289                }
2290                "ServerException" => return RusotoError::Service(ListImagesError::Server(err.msg)),
2291                "ValidationException" => return RusotoError::Validation(err.msg),
2292                _ => {}
2293            }
2294        }
2295        RusotoError::Unknown(res)
2296    }
2297}
2298impl fmt::Display for ListImagesError {
2299    #[allow(unused_variables)]
2300    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2301        match *self {
2302            ListImagesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2303            ListImagesError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2304            ListImagesError::Server(ref cause) => write!(f, "{}", cause),
2305        }
2306    }
2307}
2308impl Error for ListImagesError {}
2309/// Errors returned by ListTagsForResource
2310#[derive(Debug, PartialEq)]
2311pub enum ListTagsForResourceError {
2312    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2313    InvalidParameter(String),
2314    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2315    RepositoryNotFound(String),
2316    /// <p>These errors are usually caused by a server-side issue.</p>
2317    Server(String),
2318}
2319
2320impl ListTagsForResourceError {
2321    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
2322        if let Some(err) = proto::json::Error::parse(&res) {
2323            match err.typ.as_str() {
2324                "InvalidParameterException" => {
2325                    return RusotoError::Service(ListTagsForResourceError::InvalidParameter(
2326                        err.msg,
2327                    ))
2328                }
2329                "RepositoryNotFoundException" => {
2330                    return RusotoError::Service(ListTagsForResourceError::RepositoryNotFound(
2331                        err.msg,
2332                    ))
2333                }
2334                "ServerException" => {
2335                    return RusotoError::Service(ListTagsForResourceError::Server(err.msg))
2336                }
2337                "ValidationException" => return RusotoError::Validation(err.msg),
2338                _ => {}
2339            }
2340        }
2341        RusotoError::Unknown(res)
2342    }
2343}
2344impl fmt::Display for ListTagsForResourceError {
2345    #[allow(unused_variables)]
2346    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2347        match *self {
2348            ListTagsForResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2349            ListTagsForResourceError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2350            ListTagsForResourceError::Server(ref cause) => write!(f, "{}", cause),
2351        }
2352    }
2353}
2354impl Error for ListTagsForResourceError {}
2355/// Errors returned by PutImage
2356#[derive(Debug, PartialEq)]
2357pub enum PutImageError {
2358    /// <p>The specified image has already been pushed, and there were no changes to the manifest or image tag after the last push.</p>
2359    ImageAlreadyExists(String),
2360    /// <p>The specified image digest does not match the digest that Amazon ECR calculated for the image.</p>
2361    ImageDigestDoesNotMatch(String),
2362    /// <p>The specified image is tagged with a tag that already exists. The repository is configured for tag immutability.</p>
2363    ImageTagAlreadyExists(String),
2364    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2365    InvalidParameter(String),
2366    /// <p>The specified layers could not be found, or the specified layer is not valid for this repository.</p>
2367    LayersNotFound(String),
2368    /// <p>The operation did not succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR Service Quotas</a> in the Amazon Elastic Container Registry User Guide.</p>
2369    LimitExceeded(String),
2370    /// <p>The manifest list is referencing an image that does not exist.</p>
2371    ReferencedImagesNotFound(String),
2372    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2373    RepositoryNotFound(String),
2374    /// <p>These errors are usually caused by a server-side issue.</p>
2375    Server(String),
2376}
2377
2378impl PutImageError {
2379    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutImageError> {
2380        if let Some(err) = proto::json::Error::parse(&res) {
2381            match err.typ.as_str() {
2382                "ImageAlreadyExistsException" => {
2383                    return RusotoError::Service(PutImageError::ImageAlreadyExists(err.msg))
2384                }
2385                "ImageDigestDoesNotMatchException" => {
2386                    return RusotoError::Service(PutImageError::ImageDigestDoesNotMatch(err.msg))
2387                }
2388                "ImageTagAlreadyExistsException" => {
2389                    return RusotoError::Service(PutImageError::ImageTagAlreadyExists(err.msg))
2390                }
2391                "InvalidParameterException" => {
2392                    return RusotoError::Service(PutImageError::InvalidParameter(err.msg))
2393                }
2394                "LayersNotFoundException" => {
2395                    return RusotoError::Service(PutImageError::LayersNotFound(err.msg))
2396                }
2397                "LimitExceededException" => {
2398                    return RusotoError::Service(PutImageError::LimitExceeded(err.msg))
2399                }
2400                "ReferencedImagesNotFoundException" => {
2401                    return RusotoError::Service(PutImageError::ReferencedImagesNotFound(err.msg))
2402                }
2403                "RepositoryNotFoundException" => {
2404                    return RusotoError::Service(PutImageError::RepositoryNotFound(err.msg))
2405                }
2406                "ServerException" => return RusotoError::Service(PutImageError::Server(err.msg)),
2407                "ValidationException" => return RusotoError::Validation(err.msg),
2408                _ => {}
2409            }
2410        }
2411        RusotoError::Unknown(res)
2412    }
2413}
2414impl fmt::Display for PutImageError {
2415    #[allow(unused_variables)]
2416    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2417        match *self {
2418            PutImageError::ImageAlreadyExists(ref cause) => write!(f, "{}", cause),
2419            PutImageError::ImageDigestDoesNotMatch(ref cause) => write!(f, "{}", cause),
2420            PutImageError::ImageTagAlreadyExists(ref cause) => write!(f, "{}", cause),
2421            PutImageError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2422            PutImageError::LayersNotFound(ref cause) => write!(f, "{}", cause),
2423            PutImageError::LimitExceeded(ref cause) => write!(f, "{}", cause),
2424            PutImageError::ReferencedImagesNotFound(ref cause) => write!(f, "{}", cause),
2425            PutImageError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2426            PutImageError::Server(ref cause) => write!(f, "{}", cause),
2427        }
2428    }
2429}
2430impl Error for PutImageError {}
2431/// Errors returned by PutImageScanningConfiguration
2432#[derive(Debug, PartialEq)]
2433pub enum PutImageScanningConfigurationError {
2434    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2435    InvalidParameter(String),
2436    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2437    RepositoryNotFound(String),
2438    /// <p>These errors are usually caused by a server-side issue.</p>
2439    Server(String),
2440}
2441
2442impl PutImageScanningConfigurationError {
2443    pub fn from_response(
2444        res: BufferedHttpResponse,
2445    ) -> RusotoError<PutImageScanningConfigurationError> {
2446        if let Some(err) = proto::json::Error::parse(&res) {
2447            match err.typ.as_str() {
2448                "InvalidParameterException" => {
2449                    return RusotoError::Service(
2450                        PutImageScanningConfigurationError::InvalidParameter(err.msg),
2451                    )
2452                }
2453                "RepositoryNotFoundException" => {
2454                    return RusotoError::Service(
2455                        PutImageScanningConfigurationError::RepositoryNotFound(err.msg),
2456                    )
2457                }
2458                "ServerException" => {
2459                    return RusotoError::Service(PutImageScanningConfigurationError::Server(
2460                        err.msg,
2461                    ))
2462                }
2463                "ValidationException" => return RusotoError::Validation(err.msg),
2464                _ => {}
2465            }
2466        }
2467        RusotoError::Unknown(res)
2468    }
2469}
2470impl fmt::Display for PutImageScanningConfigurationError {
2471    #[allow(unused_variables)]
2472    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2473        match *self {
2474            PutImageScanningConfigurationError::InvalidParameter(ref cause) => {
2475                write!(f, "{}", cause)
2476            }
2477            PutImageScanningConfigurationError::RepositoryNotFound(ref cause) => {
2478                write!(f, "{}", cause)
2479            }
2480            PutImageScanningConfigurationError::Server(ref cause) => write!(f, "{}", cause),
2481        }
2482    }
2483}
2484impl Error for PutImageScanningConfigurationError {}
2485/// Errors returned by PutImageTagMutability
2486#[derive(Debug, PartialEq)]
2487pub enum PutImageTagMutabilityError {
2488    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2489    InvalidParameter(String),
2490    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2491    RepositoryNotFound(String),
2492    /// <p>These errors are usually caused by a server-side issue.</p>
2493    Server(String),
2494}
2495
2496impl PutImageTagMutabilityError {
2497    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutImageTagMutabilityError> {
2498        if let Some(err) = proto::json::Error::parse(&res) {
2499            match err.typ.as_str() {
2500                "InvalidParameterException" => {
2501                    return RusotoError::Service(PutImageTagMutabilityError::InvalidParameter(
2502                        err.msg,
2503                    ))
2504                }
2505                "RepositoryNotFoundException" => {
2506                    return RusotoError::Service(PutImageTagMutabilityError::RepositoryNotFound(
2507                        err.msg,
2508                    ))
2509                }
2510                "ServerException" => {
2511                    return RusotoError::Service(PutImageTagMutabilityError::Server(err.msg))
2512                }
2513                "ValidationException" => return RusotoError::Validation(err.msg),
2514                _ => {}
2515            }
2516        }
2517        RusotoError::Unknown(res)
2518    }
2519}
2520impl fmt::Display for PutImageTagMutabilityError {
2521    #[allow(unused_variables)]
2522    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2523        match *self {
2524            PutImageTagMutabilityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2525            PutImageTagMutabilityError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2526            PutImageTagMutabilityError::Server(ref cause) => write!(f, "{}", cause),
2527        }
2528    }
2529}
2530impl Error for PutImageTagMutabilityError {}
2531/// Errors returned by PutLifecyclePolicy
2532#[derive(Debug, PartialEq)]
2533pub enum PutLifecyclePolicyError {
2534    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2535    InvalidParameter(String),
2536    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2537    RepositoryNotFound(String),
2538    /// <p>These errors are usually caused by a server-side issue.</p>
2539    Server(String),
2540}
2541
2542impl PutLifecyclePolicyError {
2543    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutLifecyclePolicyError> {
2544        if let Some(err) = proto::json::Error::parse(&res) {
2545            match err.typ.as_str() {
2546                "InvalidParameterException" => {
2547                    return RusotoError::Service(PutLifecyclePolicyError::InvalidParameter(err.msg))
2548                }
2549                "RepositoryNotFoundException" => {
2550                    return RusotoError::Service(PutLifecyclePolicyError::RepositoryNotFound(
2551                        err.msg,
2552                    ))
2553                }
2554                "ServerException" => {
2555                    return RusotoError::Service(PutLifecyclePolicyError::Server(err.msg))
2556                }
2557                "ValidationException" => return RusotoError::Validation(err.msg),
2558                _ => {}
2559            }
2560        }
2561        RusotoError::Unknown(res)
2562    }
2563}
2564impl fmt::Display for PutLifecyclePolicyError {
2565    #[allow(unused_variables)]
2566    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2567        match *self {
2568            PutLifecyclePolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2569            PutLifecyclePolicyError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2570            PutLifecyclePolicyError::Server(ref cause) => write!(f, "{}", cause),
2571        }
2572    }
2573}
2574impl Error for PutLifecyclePolicyError {}
2575/// Errors returned by SetRepositoryPolicy
2576#[derive(Debug, PartialEq)]
2577pub enum SetRepositoryPolicyError {
2578    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2579    InvalidParameter(String),
2580    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2581    RepositoryNotFound(String),
2582    /// <p>These errors are usually caused by a server-side issue.</p>
2583    Server(String),
2584}
2585
2586impl SetRepositoryPolicyError {
2587    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetRepositoryPolicyError> {
2588        if let Some(err) = proto::json::Error::parse(&res) {
2589            match err.typ.as_str() {
2590                "InvalidParameterException" => {
2591                    return RusotoError::Service(SetRepositoryPolicyError::InvalidParameter(
2592                        err.msg,
2593                    ))
2594                }
2595                "RepositoryNotFoundException" => {
2596                    return RusotoError::Service(SetRepositoryPolicyError::RepositoryNotFound(
2597                        err.msg,
2598                    ))
2599                }
2600                "ServerException" => {
2601                    return RusotoError::Service(SetRepositoryPolicyError::Server(err.msg))
2602                }
2603                "ValidationException" => return RusotoError::Validation(err.msg),
2604                _ => {}
2605            }
2606        }
2607        RusotoError::Unknown(res)
2608    }
2609}
2610impl fmt::Display for SetRepositoryPolicyError {
2611    #[allow(unused_variables)]
2612    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2613        match *self {
2614            SetRepositoryPolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2615            SetRepositoryPolicyError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2616            SetRepositoryPolicyError::Server(ref cause) => write!(f, "{}", cause),
2617        }
2618    }
2619}
2620impl Error for SetRepositoryPolicyError {}
2621/// Errors returned by StartImageScan
2622#[derive(Debug, PartialEq)]
2623pub enum StartImageScanError {
2624    /// <p>The image requested does not exist in the specified repository.</p>
2625    ImageNotFound(String),
2626    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2627    InvalidParameter(String),
2628    /// <p>The operation did not succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR Service Quotas</a> in the Amazon Elastic Container Registry User Guide.</p>
2629    LimitExceeded(String),
2630    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2631    RepositoryNotFound(String),
2632    /// <p>These errors are usually caused by a server-side issue.</p>
2633    Server(String),
2634    /// <p>The image is of a type that cannot be scanned.</p>
2635    UnsupportedImageType(String),
2636}
2637
2638impl StartImageScanError {
2639    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartImageScanError> {
2640        if let Some(err) = proto::json::Error::parse(&res) {
2641            match err.typ.as_str() {
2642                "ImageNotFoundException" => {
2643                    return RusotoError::Service(StartImageScanError::ImageNotFound(err.msg))
2644                }
2645                "InvalidParameterException" => {
2646                    return RusotoError::Service(StartImageScanError::InvalidParameter(err.msg))
2647                }
2648                "LimitExceededException" => {
2649                    return RusotoError::Service(StartImageScanError::LimitExceeded(err.msg))
2650                }
2651                "RepositoryNotFoundException" => {
2652                    return RusotoError::Service(StartImageScanError::RepositoryNotFound(err.msg))
2653                }
2654                "ServerException" => {
2655                    return RusotoError::Service(StartImageScanError::Server(err.msg))
2656                }
2657                "UnsupportedImageTypeException" => {
2658                    return RusotoError::Service(StartImageScanError::UnsupportedImageType(err.msg))
2659                }
2660                "ValidationException" => return RusotoError::Validation(err.msg),
2661                _ => {}
2662            }
2663        }
2664        RusotoError::Unknown(res)
2665    }
2666}
2667impl fmt::Display for StartImageScanError {
2668    #[allow(unused_variables)]
2669    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2670        match *self {
2671            StartImageScanError::ImageNotFound(ref cause) => write!(f, "{}", cause),
2672            StartImageScanError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2673            StartImageScanError::LimitExceeded(ref cause) => write!(f, "{}", cause),
2674            StartImageScanError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2675            StartImageScanError::Server(ref cause) => write!(f, "{}", cause),
2676            StartImageScanError::UnsupportedImageType(ref cause) => write!(f, "{}", cause),
2677        }
2678    }
2679}
2680impl Error for StartImageScanError {}
2681/// Errors returned by StartLifecyclePolicyPreview
2682#[derive(Debug, PartialEq)]
2683pub enum StartLifecyclePolicyPreviewError {
2684    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2685    InvalidParameter(String),
2686    /// <p>The lifecycle policy could not be found, and no policy is set to the repository.</p>
2687    LifecyclePolicyNotFound(String),
2688    /// <p>The previous lifecycle policy preview request has not completed. Please try again later.</p>
2689    LifecyclePolicyPreviewInProgress(String),
2690    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2691    RepositoryNotFound(String),
2692    /// <p>These errors are usually caused by a server-side issue.</p>
2693    Server(String),
2694}
2695
2696impl StartLifecyclePolicyPreviewError {
2697    pub fn from_response(
2698        res: BufferedHttpResponse,
2699    ) -> RusotoError<StartLifecyclePolicyPreviewError> {
2700        if let Some(err) = proto::json::Error::parse(&res) {
2701            match err.typ.as_str() {
2702                "InvalidParameterException" => {
2703                    return RusotoError::Service(
2704                        StartLifecyclePolicyPreviewError::InvalidParameter(err.msg),
2705                    )
2706                }
2707                "LifecyclePolicyNotFoundException" => {
2708                    return RusotoError::Service(
2709                        StartLifecyclePolicyPreviewError::LifecyclePolicyNotFound(err.msg),
2710                    )
2711                }
2712                "LifecyclePolicyPreviewInProgressException" => {
2713                    return RusotoError::Service(
2714                        StartLifecyclePolicyPreviewError::LifecyclePolicyPreviewInProgress(err.msg),
2715                    )
2716                }
2717                "RepositoryNotFoundException" => {
2718                    return RusotoError::Service(
2719                        StartLifecyclePolicyPreviewError::RepositoryNotFound(err.msg),
2720                    )
2721                }
2722                "ServerException" => {
2723                    return RusotoError::Service(StartLifecyclePolicyPreviewError::Server(err.msg))
2724                }
2725                "ValidationException" => return RusotoError::Validation(err.msg),
2726                _ => {}
2727            }
2728        }
2729        RusotoError::Unknown(res)
2730    }
2731}
2732impl fmt::Display for StartLifecyclePolicyPreviewError {
2733    #[allow(unused_variables)]
2734    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2735        match *self {
2736            StartLifecyclePolicyPreviewError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2737            StartLifecyclePolicyPreviewError::LifecyclePolicyNotFound(ref cause) => {
2738                write!(f, "{}", cause)
2739            }
2740            StartLifecyclePolicyPreviewError::LifecyclePolicyPreviewInProgress(ref cause) => {
2741                write!(f, "{}", cause)
2742            }
2743            StartLifecyclePolicyPreviewError::RepositoryNotFound(ref cause) => {
2744                write!(f, "{}", cause)
2745            }
2746            StartLifecyclePolicyPreviewError::Server(ref cause) => write!(f, "{}", cause),
2747        }
2748    }
2749}
2750impl Error for StartLifecyclePolicyPreviewError {}
2751/// Errors returned by TagResource
2752#[derive(Debug, PartialEq)]
2753pub enum TagResourceError {
2754    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2755    InvalidParameter(String),
2756    /// <p>An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
2757    InvalidTagParameter(String),
2758    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2759    RepositoryNotFound(String),
2760    /// <p>These errors are usually caused by a server-side issue.</p>
2761    Server(String),
2762    /// <p>The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.</p>
2763    TooManyTags(String),
2764}
2765
2766impl TagResourceError {
2767    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
2768        if let Some(err) = proto::json::Error::parse(&res) {
2769            match err.typ.as_str() {
2770                "InvalidParameterException" => {
2771                    return RusotoError::Service(TagResourceError::InvalidParameter(err.msg))
2772                }
2773                "InvalidTagParameterException" => {
2774                    return RusotoError::Service(TagResourceError::InvalidTagParameter(err.msg))
2775                }
2776                "RepositoryNotFoundException" => {
2777                    return RusotoError::Service(TagResourceError::RepositoryNotFound(err.msg))
2778                }
2779                "ServerException" => {
2780                    return RusotoError::Service(TagResourceError::Server(err.msg))
2781                }
2782                "TooManyTagsException" => {
2783                    return RusotoError::Service(TagResourceError::TooManyTags(err.msg))
2784                }
2785                "ValidationException" => return RusotoError::Validation(err.msg),
2786                _ => {}
2787            }
2788        }
2789        RusotoError::Unknown(res)
2790    }
2791}
2792impl fmt::Display for TagResourceError {
2793    #[allow(unused_variables)]
2794    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2795        match *self {
2796            TagResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2797            TagResourceError::InvalidTagParameter(ref cause) => write!(f, "{}", cause),
2798            TagResourceError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2799            TagResourceError::Server(ref cause) => write!(f, "{}", cause),
2800            TagResourceError::TooManyTags(ref cause) => write!(f, "{}", cause),
2801        }
2802    }
2803}
2804impl Error for TagResourceError {}
2805/// Errors returned by UntagResource
2806#[derive(Debug, PartialEq)]
2807pub enum UntagResourceError {
2808    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2809    InvalidParameter(String),
2810    /// <p>An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
2811    InvalidTagParameter(String),
2812    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2813    RepositoryNotFound(String),
2814    /// <p>These errors are usually caused by a server-side issue.</p>
2815    Server(String),
2816    /// <p>The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.</p>
2817    TooManyTags(String),
2818}
2819
2820impl UntagResourceError {
2821    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
2822        if let Some(err) = proto::json::Error::parse(&res) {
2823            match err.typ.as_str() {
2824                "InvalidParameterException" => {
2825                    return RusotoError::Service(UntagResourceError::InvalidParameter(err.msg))
2826                }
2827                "InvalidTagParameterException" => {
2828                    return RusotoError::Service(UntagResourceError::InvalidTagParameter(err.msg))
2829                }
2830                "RepositoryNotFoundException" => {
2831                    return RusotoError::Service(UntagResourceError::RepositoryNotFound(err.msg))
2832                }
2833                "ServerException" => {
2834                    return RusotoError::Service(UntagResourceError::Server(err.msg))
2835                }
2836                "TooManyTagsException" => {
2837                    return RusotoError::Service(UntagResourceError::TooManyTags(err.msg))
2838                }
2839                "ValidationException" => return RusotoError::Validation(err.msg),
2840                _ => {}
2841            }
2842        }
2843        RusotoError::Unknown(res)
2844    }
2845}
2846impl fmt::Display for UntagResourceError {
2847    #[allow(unused_variables)]
2848    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2849        match *self {
2850            UntagResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2851            UntagResourceError::InvalidTagParameter(ref cause) => write!(f, "{}", cause),
2852            UntagResourceError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2853            UntagResourceError::Server(ref cause) => write!(f, "{}", cause),
2854            UntagResourceError::TooManyTags(ref cause) => write!(f, "{}", cause),
2855        }
2856    }
2857}
2858impl Error for UntagResourceError {}
2859/// Errors returned by UploadLayerPart
2860#[derive(Debug, PartialEq)]
2861pub enum UploadLayerPartError {
2862    /// <p>The layer part size is not valid, or the first byte specified is not consecutive to the last byte of a previous layer part upload.</p>
2863    InvalidLayerPart(String),
2864    /// <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
2865    InvalidParameter(String),
2866    /// <p>The operation did not succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR Service Quotas</a> in the Amazon Elastic Container Registry User Guide.</p>
2867    LimitExceeded(String),
2868    /// <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
2869    RepositoryNotFound(String),
2870    /// <p>These errors are usually caused by a server-side issue.</p>
2871    Server(String),
2872    /// <p>The upload could not be found, or the specified upload id is not valid for this repository.</p>
2873    UploadNotFound(String),
2874}
2875
2876impl UploadLayerPartError {
2877    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UploadLayerPartError> {
2878        if let Some(err) = proto::json::Error::parse(&res) {
2879            match err.typ.as_str() {
2880                "InvalidLayerPartException" => {
2881                    return RusotoError::Service(UploadLayerPartError::InvalidLayerPart(err.msg))
2882                }
2883                "InvalidParameterException" => {
2884                    return RusotoError::Service(UploadLayerPartError::InvalidParameter(err.msg))
2885                }
2886                "LimitExceededException" => {
2887                    return RusotoError::Service(UploadLayerPartError::LimitExceeded(err.msg))
2888                }
2889                "RepositoryNotFoundException" => {
2890                    return RusotoError::Service(UploadLayerPartError::RepositoryNotFound(err.msg))
2891                }
2892                "ServerException" => {
2893                    return RusotoError::Service(UploadLayerPartError::Server(err.msg))
2894                }
2895                "UploadNotFoundException" => {
2896                    return RusotoError::Service(UploadLayerPartError::UploadNotFound(err.msg))
2897                }
2898                "ValidationException" => return RusotoError::Validation(err.msg),
2899                _ => {}
2900            }
2901        }
2902        RusotoError::Unknown(res)
2903    }
2904}
2905impl fmt::Display for UploadLayerPartError {
2906    #[allow(unused_variables)]
2907    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2908        match *self {
2909            UploadLayerPartError::InvalidLayerPart(ref cause) => write!(f, "{}", cause),
2910            UploadLayerPartError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2911            UploadLayerPartError::LimitExceeded(ref cause) => write!(f, "{}", cause),
2912            UploadLayerPartError::RepositoryNotFound(ref cause) => write!(f, "{}", cause),
2913            UploadLayerPartError::Server(ref cause) => write!(f, "{}", cause),
2914            UploadLayerPartError::UploadNotFound(ref cause) => write!(f, "{}", cause),
2915        }
2916    }
2917}
2918impl Error for UploadLayerPartError {}
2919/// Trait representing the capabilities of the Amazon ECR API. Amazon ECR clients implement this trait.
2920#[async_trait]
2921pub trait Ecr {
2922    /// <p><p>Checks the availability of one or more image layers in a repository.</p> <p>When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.</p> <note> <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> </note></p>
2923    async fn batch_check_layer_availability(
2924        &self,
2925        input: BatchCheckLayerAvailabilityRequest,
2926    ) -> Result<BatchCheckLayerAvailabilityResponse, RusotoError<BatchCheckLayerAvailabilityError>>;
2927
2928    /// <p>Deletes a list of specified images within a repository. Images are specified with either an <code>imageTag</code> or <code>imageDigest</code>.</p> <p>You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.</p> <p>You can completely delete an image (and all of its tags) by specifying the image's digest in your request.</p>
2929    async fn batch_delete_image(
2930        &self,
2931        input: BatchDeleteImageRequest,
2932    ) -> Result<BatchDeleteImageResponse, RusotoError<BatchDeleteImageError>>;
2933
2934    /// <p>Gets detailed information for an image. Images are specified with either an <code>imageTag</code> or <code>imageDigest</code>.</p> <p>When an image is pulled, the BatchGetImage API is called once to retrieve the image manifest.</p>
2935    async fn batch_get_image(
2936        &self,
2937        input: BatchGetImageRequest,
2938    ) -> Result<BatchGetImageResponse, RusotoError<BatchGetImageError>>;
2939
2940    /// <p><p>Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. You can optionally provide a <code>sha256</code> digest of the image layer for data validation purposes.</p> <p>When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed.</p> <note> <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> </note></p>
2941    async fn complete_layer_upload(
2942        &self,
2943        input: CompleteLayerUploadRequest,
2944    ) -> Result<CompleteLayerUploadResponse, RusotoError<CompleteLayerUploadError>>;
2945
2946    /// <p>Creates a repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html">Amazon ECR Repositories</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
2947    async fn create_repository(
2948        &self,
2949        input: CreateRepositoryRequest,
2950    ) -> Result<CreateRepositoryResponse, RusotoError<CreateRepositoryError>>;
2951
2952    /// <p>Deletes the lifecycle policy associated with the specified repository.</p>
2953    async fn delete_lifecycle_policy(
2954        &self,
2955        input: DeleteLifecyclePolicyRequest,
2956    ) -> Result<DeleteLifecyclePolicyResponse, RusotoError<DeleteLifecyclePolicyError>>;
2957
2958    /// <p>Deletes a repository. If the repository contains images, you must either delete all images in the repository or use the <code>force</code> option to delete the repository.</p>
2959    async fn delete_repository(
2960        &self,
2961        input: DeleteRepositoryRequest,
2962    ) -> Result<DeleteRepositoryResponse, RusotoError<DeleteRepositoryError>>;
2963
2964    /// <p>Deletes the repository policy associated with the specified repository.</p>
2965    async fn delete_repository_policy(
2966        &self,
2967        input: DeleteRepositoryPolicyRequest,
2968    ) -> Result<DeleteRepositoryPolicyResponse, RusotoError<DeleteRepositoryPolicyError>>;
2969
2970    /// <p>Returns the scan findings for the specified image.</p>
2971    async fn describe_image_scan_findings(
2972        &self,
2973        input: DescribeImageScanFindingsRequest,
2974    ) -> Result<DescribeImageScanFindingsResponse, RusotoError<DescribeImageScanFindingsError>>;
2975
2976    /// <p><p>Returns metadata about the images in a repository.</p> <note> <p>Beginning 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, so it may return a larger image size than the image sizes returned by <a>DescribeImages</a>.</p> </note></p>
2977    async fn describe_images(
2978        &self,
2979        input: DescribeImagesRequest,
2980    ) -> Result<DescribeImagesResponse, RusotoError<DescribeImagesError>>;
2981
2982    /// <p>Describes image repositories in a registry.</p>
2983    async fn describe_repositories(
2984        &self,
2985        input: DescribeRepositoriesRequest,
2986    ) -> Result<DescribeRepositoriesResponse, RusotoError<DescribeRepositoriesError>>;
2987
2988    /// <p>Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.</p> <p>The <code>authorizationToken</code> returned is a base64 encoded string that can be decoded and used in a <code>docker login</code> command to authenticate to a registry. The AWS CLI offers an <code>get-login-password</code> command that simplifies the login process. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth">Registry Authentication</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
2989    async fn get_authorization_token(
2990        &self,
2991        input: GetAuthorizationTokenRequest,
2992    ) -> Result<GetAuthorizationTokenResponse, RusotoError<GetAuthorizationTokenError>>;
2993
2994    /// <p><p>Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.</p> <p>When an image is pulled, the GetDownloadUrlForLayer API is called once per image layer that is not already cached.</p> <note> <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> </note></p>
2995    async fn get_download_url_for_layer(
2996        &self,
2997        input: GetDownloadUrlForLayerRequest,
2998    ) -> Result<GetDownloadUrlForLayerResponse, RusotoError<GetDownloadUrlForLayerError>>;
2999
3000    /// <p>Retrieves the lifecycle policy for the specified repository.</p>
3001    async fn get_lifecycle_policy(
3002        &self,
3003        input: GetLifecyclePolicyRequest,
3004    ) -> Result<GetLifecyclePolicyResponse, RusotoError<GetLifecyclePolicyError>>;
3005
3006    /// <p>Retrieves the results of the lifecycle policy preview request for the specified repository.</p>
3007    async fn get_lifecycle_policy_preview(
3008        &self,
3009        input: GetLifecyclePolicyPreviewRequest,
3010    ) -> Result<GetLifecyclePolicyPreviewResponse, RusotoError<GetLifecyclePolicyPreviewError>>;
3011
3012    /// <p>Retrieves the repository policy for the specified repository.</p>
3013    async fn get_repository_policy(
3014        &self,
3015        input: GetRepositoryPolicyRequest,
3016    ) -> Result<GetRepositoryPolicyResponse, RusotoError<GetRepositoryPolicyError>>;
3017
3018    /// <p><p>Notifies Amazon ECR that you intend to upload an image layer.</p> <p>When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action.</p> <note> <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> </note></p>
3019    async fn initiate_layer_upload(
3020        &self,
3021        input: InitiateLayerUploadRequest,
3022    ) -> Result<InitiateLayerUploadResponse, RusotoError<InitiateLayerUploadError>>;
3023
3024    /// <p>Lists all the image IDs for the specified repository.</p> <p>You can filter images based on whether or not they are tagged by using the <code>tagStatus</code> filter and specifying either <code>TAGGED</code>, <code>UNTAGGED</code> or <code>ANY</code>. For example, you can filter your results to return only <code>UNTAGGED</code> images and then pipe that result to a <a>BatchDeleteImage</a> operation to delete them. Or, you can filter your results to return only <code>TAGGED</code> images to list all of the tags in your repository.</p>
3025    async fn list_images(
3026        &self,
3027        input: ListImagesRequest,
3028    ) -> Result<ListImagesResponse, RusotoError<ListImagesError>>;
3029
3030    /// <p>List the tags for an Amazon ECR resource.</p>
3031    async fn list_tags_for_resource(
3032        &self,
3033        input: ListTagsForResourceRequest,
3034    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
3035
3036    /// <p><p>Creates or updates the image manifest and tags associated with an image.</p> <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> <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> </note></p>
3037    async fn put_image(
3038        &self,
3039        input: PutImageRequest,
3040    ) -> Result<PutImageResponse, RusotoError<PutImageError>>;
3041
3042    /// <p>Updates the image scanning configuration for the specified repository.</p>
3043    async fn put_image_scanning_configuration(
3044        &self,
3045        input: PutImageScanningConfigurationRequest,
3046    ) -> Result<
3047        PutImageScanningConfigurationResponse,
3048        RusotoError<PutImageScanningConfigurationError>,
3049    >;
3050
3051    /// <p>Updates the image tag mutability settings for the specified repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html">Image Tag Mutability</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3052    async fn put_image_tag_mutability(
3053        &self,
3054        input: PutImageTagMutabilityRequest,
3055    ) -> Result<PutImageTagMutabilityResponse, RusotoError<PutImageTagMutabilityError>>;
3056
3057    /// <p>Creates or updates the lifecycle policy for the specified repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html">Lifecycle Policy Template</a>.</p>
3058    async fn put_lifecycle_policy(
3059        &self,
3060        input: PutLifecyclePolicyRequest,
3061    ) -> Result<PutLifecyclePolicyResponse, RusotoError<PutLifecyclePolicyError>>;
3062
3063    /// <p>Applies a repository policy to the specified repository to control access permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html">Amazon ECR Repository Policies</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3064    async fn set_repository_policy(
3065        &self,
3066        input: SetRepositoryPolicyRequest,
3067    ) -> Result<SetRepositoryPolicyResponse, RusotoError<SetRepositoryPolicyError>>;
3068
3069    /// <p>Starts an image vulnerability scan. An image scan can only be started once per day on an individual image. This limit includes if an image was scanned on initial push. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html">Image Scanning</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3070    async fn start_image_scan(
3071        &self,
3072        input: StartImageScanRequest,
3073    ) -> Result<StartImageScanResponse, RusotoError<StartImageScanError>>;
3074
3075    /// <p>Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository.</p>
3076    async fn start_lifecycle_policy_preview(
3077        &self,
3078        input: StartLifecyclePolicyPreviewRequest,
3079    ) -> Result<StartLifecyclePolicyPreviewResponse, RusotoError<StartLifecyclePolicyPreviewError>>;
3080
3081    /// <p>Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.</p>
3082    async fn tag_resource(
3083        &self,
3084        input: TagResourceRequest,
3085    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
3086
3087    /// <p>Deletes specified tags from a resource.</p>
3088    async fn untag_resource(
3089        &self,
3090        input: UntagResourceRequest,
3091    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
3092
3093    /// <p><p>Uploads an image layer part to Amazon ECR.</p> <p>When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part.</p> <note> <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> </note></p>
3094    async fn upload_layer_part(
3095        &self,
3096        input: UploadLayerPartRequest,
3097    ) -> Result<UploadLayerPartResponse, RusotoError<UploadLayerPartError>>;
3098}
3099/// A client for the Amazon ECR API.
3100#[derive(Clone)]
3101pub struct EcrClient {
3102    client: Client,
3103    region: region::Region,
3104}
3105
3106impl EcrClient {
3107    /// Creates a client backed by the default tokio event loop.
3108    ///
3109    /// The client will use the default credentials provider and tls client.
3110    pub fn new(region: region::Region) -> EcrClient {
3111        EcrClient {
3112            client: Client::shared(),
3113            region,
3114        }
3115    }
3116
3117    pub fn new_with<P, D>(
3118        request_dispatcher: D,
3119        credentials_provider: P,
3120        region: region::Region,
3121    ) -> EcrClient
3122    where
3123        P: ProvideAwsCredentials + Send + Sync + 'static,
3124        D: DispatchSignedRequest + Send + Sync + 'static,
3125    {
3126        EcrClient {
3127            client: Client::new_with(credentials_provider, request_dispatcher),
3128            region,
3129        }
3130    }
3131
3132    pub fn new_with_client(client: Client, region: region::Region) -> EcrClient {
3133        EcrClient { client, region }
3134    }
3135}
3136
3137#[async_trait]
3138impl Ecr for EcrClient {
3139    /// <p><p>Checks the availability of one or more image layers in a repository.</p> <p>When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.</p> <note> <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> </note></p>
3140    async fn batch_check_layer_availability(
3141        &self,
3142        input: BatchCheckLayerAvailabilityRequest,
3143    ) -> Result<BatchCheckLayerAvailabilityResponse, RusotoError<BatchCheckLayerAvailabilityError>>
3144    {
3145        let mut request = self.new_signed_request("POST", "/");
3146        request.add_header(
3147            "x-amz-target",
3148            "AmazonEC2ContainerRegistry_V20150921.BatchCheckLayerAvailability",
3149        );
3150        let encoded = serde_json::to_string(&input).unwrap();
3151        request.set_payload(Some(encoded));
3152
3153        let response = self
3154            .sign_and_dispatch(request, BatchCheckLayerAvailabilityError::from_response)
3155            .await?;
3156        let mut response = response;
3157        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3158        proto::json::ResponsePayload::new(&response)
3159            .deserialize::<BatchCheckLayerAvailabilityResponse, _>()
3160    }
3161
3162    /// <p>Deletes a list of specified images within a repository. Images are specified with either an <code>imageTag</code> or <code>imageDigest</code>.</p> <p>You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.</p> <p>You can completely delete an image (and all of its tags) by specifying the image's digest in your request.</p>
3163    async fn batch_delete_image(
3164        &self,
3165        input: BatchDeleteImageRequest,
3166    ) -> Result<BatchDeleteImageResponse, RusotoError<BatchDeleteImageError>> {
3167        let mut request = self.new_signed_request("POST", "/");
3168        request.add_header(
3169            "x-amz-target",
3170            "AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage",
3171        );
3172        let encoded = serde_json::to_string(&input).unwrap();
3173        request.set_payload(Some(encoded));
3174
3175        let response = self
3176            .sign_and_dispatch(request, BatchDeleteImageError::from_response)
3177            .await?;
3178        let mut response = response;
3179        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3180        proto::json::ResponsePayload::new(&response).deserialize::<BatchDeleteImageResponse, _>()
3181    }
3182
3183    /// <p>Gets detailed information for an image. Images are specified with either an <code>imageTag</code> or <code>imageDigest</code>.</p> <p>When an image is pulled, the BatchGetImage API is called once to retrieve the image manifest.</p>
3184    async fn batch_get_image(
3185        &self,
3186        input: BatchGetImageRequest,
3187    ) -> Result<BatchGetImageResponse, RusotoError<BatchGetImageError>> {
3188        let mut request = self.new_signed_request("POST", "/");
3189        request.add_header(
3190            "x-amz-target",
3191            "AmazonEC2ContainerRegistry_V20150921.BatchGetImage",
3192        );
3193        let encoded = serde_json::to_string(&input).unwrap();
3194        request.set_payload(Some(encoded));
3195
3196        let response = self
3197            .sign_and_dispatch(request, BatchGetImageError::from_response)
3198            .await?;
3199        let mut response = response;
3200        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3201        proto::json::ResponsePayload::new(&response).deserialize::<BatchGetImageResponse, _>()
3202    }
3203
3204    /// <p><p>Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. You can optionally provide a <code>sha256</code> digest of the image layer for data validation purposes.</p> <p>When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed.</p> <note> <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> </note></p>
3205    async fn complete_layer_upload(
3206        &self,
3207        input: CompleteLayerUploadRequest,
3208    ) -> Result<CompleteLayerUploadResponse, RusotoError<CompleteLayerUploadError>> {
3209        let mut request = self.new_signed_request("POST", "/");
3210        request.add_header(
3211            "x-amz-target",
3212            "AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload",
3213        );
3214        let encoded = serde_json::to_string(&input).unwrap();
3215        request.set_payload(Some(encoded));
3216
3217        let response = self
3218            .sign_and_dispatch(request, CompleteLayerUploadError::from_response)
3219            .await?;
3220        let mut response = response;
3221        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3222        proto::json::ResponsePayload::new(&response).deserialize::<CompleteLayerUploadResponse, _>()
3223    }
3224
3225    /// <p>Creates a repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html">Amazon ECR Repositories</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3226    async fn create_repository(
3227        &self,
3228        input: CreateRepositoryRequest,
3229    ) -> Result<CreateRepositoryResponse, RusotoError<CreateRepositoryError>> {
3230        let mut request = self.new_signed_request("POST", "/");
3231        request.add_header(
3232            "x-amz-target",
3233            "AmazonEC2ContainerRegistry_V20150921.CreateRepository",
3234        );
3235        let encoded = serde_json::to_string(&input).unwrap();
3236        request.set_payload(Some(encoded));
3237
3238        let response = self
3239            .sign_and_dispatch(request, CreateRepositoryError::from_response)
3240            .await?;
3241        let mut response = response;
3242        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3243        proto::json::ResponsePayload::new(&response).deserialize::<CreateRepositoryResponse, _>()
3244    }
3245
3246    /// <p>Deletes the lifecycle policy associated with the specified repository.</p>
3247    async fn delete_lifecycle_policy(
3248        &self,
3249        input: DeleteLifecyclePolicyRequest,
3250    ) -> Result<DeleteLifecyclePolicyResponse, RusotoError<DeleteLifecyclePolicyError>> {
3251        let mut request = self.new_signed_request("POST", "/");
3252        request.add_header(
3253            "x-amz-target",
3254            "AmazonEC2ContainerRegistry_V20150921.DeleteLifecyclePolicy",
3255        );
3256        let encoded = serde_json::to_string(&input).unwrap();
3257        request.set_payload(Some(encoded));
3258
3259        let response = self
3260            .sign_and_dispatch(request, DeleteLifecyclePolicyError::from_response)
3261            .await?;
3262        let mut response = response;
3263        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3264        proto::json::ResponsePayload::new(&response)
3265            .deserialize::<DeleteLifecyclePolicyResponse, _>()
3266    }
3267
3268    /// <p>Deletes a repository. If the repository contains images, you must either delete all images in the repository or use the <code>force</code> option to delete the repository.</p>
3269    async fn delete_repository(
3270        &self,
3271        input: DeleteRepositoryRequest,
3272    ) -> Result<DeleteRepositoryResponse, RusotoError<DeleteRepositoryError>> {
3273        let mut request = self.new_signed_request("POST", "/");
3274        request.add_header(
3275            "x-amz-target",
3276            "AmazonEC2ContainerRegistry_V20150921.DeleteRepository",
3277        );
3278        let encoded = serde_json::to_string(&input).unwrap();
3279        request.set_payload(Some(encoded));
3280
3281        let response = self
3282            .sign_and_dispatch(request, DeleteRepositoryError::from_response)
3283            .await?;
3284        let mut response = response;
3285        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3286        proto::json::ResponsePayload::new(&response).deserialize::<DeleteRepositoryResponse, _>()
3287    }
3288
3289    /// <p>Deletes the repository policy associated with the specified repository.</p>
3290    async fn delete_repository_policy(
3291        &self,
3292        input: DeleteRepositoryPolicyRequest,
3293    ) -> Result<DeleteRepositoryPolicyResponse, RusotoError<DeleteRepositoryPolicyError>> {
3294        let mut request = self.new_signed_request("POST", "/");
3295        request.add_header(
3296            "x-amz-target",
3297            "AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy",
3298        );
3299        let encoded = serde_json::to_string(&input).unwrap();
3300        request.set_payload(Some(encoded));
3301
3302        let response = self
3303            .sign_and_dispatch(request, DeleteRepositoryPolicyError::from_response)
3304            .await?;
3305        let mut response = response;
3306        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3307        proto::json::ResponsePayload::new(&response)
3308            .deserialize::<DeleteRepositoryPolicyResponse, _>()
3309    }
3310
3311    /// <p>Returns the scan findings for the specified image.</p>
3312    async fn describe_image_scan_findings(
3313        &self,
3314        input: DescribeImageScanFindingsRequest,
3315    ) -> Result<DescribeImageScanFindingsResponse, RusotoError<DescribeImageScanFindingsError>>
3316    {
3317        let mut request = self.new_signed_request("POST", "/");
3318        request.add_header(
3319            "x-amz-target",
3320            "AmazonEC2ContainerRegistry_V20150921.DescribeImageScanFindings",
3321        );
3322        let encoded = serde_json::to_string(&input).unwrap();
3323        request.set_payload(Some(encoded));
3324
3325        let response = self
3326            .sign_and_dispatch(request, DescribeImageScanFindingsError::from_response)
3327            .await?;
3328        let mut response = response;
3329        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3330        proto::json::ResponsePayload::new(&response)
3331            .deserialize::<DescribeImageScanFindingsResponse, _>()
3332    }
3333
3334    /// <p><p>Returns metadata about the images in a repository.</p> <note> <p>Beginning 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, so it may return a larger image size than the image sizes returned by <a>DescribeImages</a>.</p> </note></p>
3335    async fn describe_images(
3336        &self,
3337        input: DescribeImagesRequest,
3338    ) -> Result<DescribeImagesResponse, RusotoError<DescribeImagesError>> {
3339        let mut request = self.new_signed_request("POST", "/");
3340        request.add_header(
3341            "x-amz-target",
3342            "AmazonEC2ContainerRegistry_V20150921.DescribeImages",
3343        );
3344        let encoded = serde_json::to_string(&input).unwrap();
3345        request.set_payload(Some(encoded));
3346
3347        let response = self
3348            .sign_and_dispatch(request, DescribeImagesError::from_response)
3349            .await?;
3350        let mut response = response;
3351        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3352        proto::json::ResponsePayload::new(&response).deserialize::<DescribeImagesResponse, _>()
3353    }
3354
3355    /// <p>Describes image repositories in a registry.</p>
3356    async fn describe_repositories(
3357        &self,
3358        input: DescribeRepositoriesRequest,
3359    ) -> Result<DescribeRepositoriesResponse, RusotoError<DescribeRepositoriesError>> {
3360        let mut request = self.new_signed_request("POST", "/");
3361        request.add_header(
3362            "x-amz-target",
3363            "AmazonEC2ContainerRegistry_V20150921.DescribeRepositories",
3364        );
3365        let encoded = serde_json::to_string(&input).unwrap();
3366        request.set_payload(Some(encoded));
3367
3368        let response = self
3369            .sign_and_dispatch(request, DescribeRepositoriesError::from_response)
3370            .await?;
3371        let mut response = response;
3372        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3373        proto::json::ResponsePayload::new(&response)
3374            .deserialize::<DescribeRepositoriesResponse, _>()
3375    }
3376
3377    /// <p>Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.</p> <p>The <code>authorizationToken</code> returned is a base64 encoded string that can be decoded and used in a <code>docker login</code> command to authenticate to a registry. The AWS CLI offers an <code>get-login-password</code> command that simplifies the login process. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth">Registry Authentication</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3378    async fn get_authorization_token(
3379        &self,
3380        input: GetAuthorizationTokenRequest,
3381    ) -> Result<GetAuthorizationTokenResponse, RusotoError<GetAuthorizationTokenError>> {
3382        let mut request = self.new_signed_request("POST", "/");
3383        request.add_header(
3384            "x-amz-target",
3385            "AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken",
3386        );
3387        let encoded = serde_json::to_string(&input).unwrap();
3388        request.set_payload(Some(encoded));
3389
3390        let response = self
3391            .sign_and_dispatch(request, GetAuthorizationTokenError::from_response)
3392            .await?;
3393        let mut response = response;
3394        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3395        proto::json::ResponsePayload::new(&response)
3396            .deserialize::<GetAuthorizationTokenResponse, _>()
3397    }
3398
3399    /// <p><p>Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.</p> <p>When an image is pulled, the GetDownloadUrlForLayer API is called once per image layer that is not already cached.</p> <note> <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> </note></p>
3400    async fn get_download_url_for_layer(
3401        &self,
3402        input: GetDownloadUrlForLayerRequest,
3403    ) -> Result<GetDownloadUrlForLayerResponse, RusotoError<GetDownloadUrlForLayerError>> {
3404        let mut request = self.new_signed_request("POST", "/");
3405        request.add_header(
3406            "x-amz-target",
3407            "AmazonEC2ContainerRegistry_V20150921.GetDownloadUrlForLayer",
3408        );
3409        let encoded = serde_json::to_string(&input).unwrap();
3410        request.set_payload(Some(encoded));
3411
3412        let response = self
3413            .sign_and_dispatch(request, GetDownloadUrlForLayerError::from_response)
3414            .await?;
3415        let mut response = response;
3416        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3417        proto::json::ResponsePayload::new(&response)
3418            .deserialize::<GetDownloadUrlForLayerResponse, _>()
3419    }
3420
3421    /// <p>Retrieves the lifecycle policy for the specified repository.</p>
3422    async fn get_lifecycle_policy(
3423        &self,
3424        input: GetLifecyclePolicyRequest,
3425    ) -> Result<GetLifecyclePolicyResponse, RusotoError<GetLifecyclePolicyError>> {
3426        let mut request = self.new_signed_request("POST", "/");
3427        request.add_header(
3428            "x-amz-target",
3429            "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy",
3430        );
3431        let encoded = serde_json::to_string(&input).unwrap();
3432        request.set_payload(Some(encoded));
3433
3434        let response = self
3435            .sign_and_dispatch(request, GetLifecyclePolicyError::from_response)
3436            .await?;
3437        let mut response = response;
3438        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3439        proto::json::ResponsePayload::new(&response).deserialize::<GetLifecyclePolicyResponse, _>()
3440    }
3441
3442    /// <p>Retrieves the results of the lifecycle policy preview request for the specified repository.</p>
3443    async fn get_lifecycle_policy_preview(
3444        &self,
3445        input: GetLifecyclePolicyPreviewRequest,
3446    ) -> Result<GetLifecyclePolicyPreviewResponse, RusotoError<GetLifecyclePolicyPreviewError>>
3447    {
3448        let mut request = self.new_signed_request("POST", "/");
3449        request.add_header(
3450            "x-amz-target",
3451            "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview",
3452        );
3453        let encoded = serde_json::to_string(&input).unwrap();
3454        request.set_payload(Some(encoded));
3455
3456        let response = self
3457            .sign_and_dispatch(request, GetLifecyclePolicyPreviewError::from_response)
3458            .await?;
3459        let mut response = response;
3460        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3461        proto::json::ResponsePayload::new(&response)
3462            .deserialize::<GetLifecyclePolicyPreviewResponse, _>()
3463    }
3464
3465    /// <p>Retrieves the repository policy for the specified repository.</p>
3466    async fn get_repository_policy(
3467        &self,
3468        input: GetRepositoryPolicyRequest,
3469    ) -> Result<GetRepositoryPolicyResponse, RusotoError<GetRepositoryPolicyError>> {
3470        let mut request = self.new_signed_request("POST", "/");
3471        request.add_header(
3472            "x-amz-target",
3473            "AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy",
3474        );
3475        let encoded = serde_json::to_string(&input).unwrap();
3476        request.set_payload(Some(encoded));
3477
3478        let response = self
3479            .sign_and_dispatch(request, GetRepositoryPolicyError::from_response)
3480            .await?;
3481        let mut response = response;
3482        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3483        proto::json::ResponsePayload::new(&response).deserialize::<GetRepositoryPolicyResponse, _>()
3484    }
3485
3486    /// <p><p>Notifies Amazon ECR that you intend to upload an image layer.</p> <p>When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action.</p> <note> <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> </note></p>
3487    async fn initiate_layer_upload(
3488        &self,
3489        input: InitiateLayerUploadRequest,
3490    ) -> Result<InitiateLayerUploadResponse, RusotoError<InitiateLayerUploadError>> {
3491        let mut request = self.new_signed_request("POST", "/");
3492        request.add_header(
3493            "x-amz-target",
3494            "AmazonEC2ContainerRegistry_V20150921.InitiateLayerUpload",
3495        );
3496        let encoded = serde_json::to_string(&input).unwrap();
3497        request.set_payload(Some(encoded));
3498
3499        let response = self
3500            .sign_and_dispatch(request, InitiateLayerUploadError::from_response)
3501            .await?;
3502        let mut response = response;
3503        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3504        proto::json::ResponsePayload::new(&response).deserialize::<InitiateLayerUploadResponse, _>()
3505    }
3506
3507    /// <p>Lists all the image IDs for the specified repository.</p> <p>You can filter images based on whether or not they are tagged by using the <code>tagStatus</code> filter and specifying either <code>TAGGED</code>, <code>UNTAGGED</code> or <code>ANY</code>. For example, you can filter your results to return only <code>UNTAGGED</code> images and then pipe that result to a <a>BatchDeleteImage</a> operation to delete them. Or, you can filter your results to return only <code>TAGGED</code> images to list all of the tags in your repository.</p>
3508    async fn list_images(
3509        &self,
3510        input: ListImagesRequest,
3511    ) -> Result<ListImagesResponse, RusotoError<ListImagesError>> {
3512        let mut request = self.new_signed_request("POST", "/");
3513        request.add_header(
3514            "x-amz-target",
3515            "AmazonEC2ContainerRegistry_V20150921.ListImages",
3516        );
3517        let encoded = serde_json::to_string(&input).unwrap();
3518        request.set_payload(Some(encoded));
3519
3520        let response = self
3521            .sign_and_dispatch(request, ListImagesError::from_response)
3522            .await?;
3523        let mut response = response;
3524        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3525        proto::json::ResponsePayload::new(&response).deserialize::<ListImagesResponse, _>()
3526    }
3527
3528    /// <p>List the tags for an Amazon ECR resource.</p>
3529    async fn list_tags_for_resource(
3530        &self,
3531        input: ListTagsForResourceRequest,
3532    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
3533        let mut request = self.new_signed_request("POST", "/");
3534        request.add_header(
3535            "x-amz-target",
3536            "AmazonEC2ContainerRegistry_V20150921.ListTagsForResource",
3537        );
3538        let encoded = serde_json::to_string(&input).unwrap();
3539        request.set_payload(Some(encoded));
3540
3541        let response = self
3542            .sign_and_dispatch(request, ListTagsForResourceError::from_response)
3543            .await?;
3544        let mut response = response;
3545        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3546        proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
3547    }
3548
3549    /// <p><p>Creates or updates the image manifest and tags associated with an image.</p> <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> <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> </note></p>
3550    async fn put_image(
3551        &self,
3552        input: PutImageRequest,
3553    ) -> Result<PutImageResponse, RusotoError<PutImageError>> {
3554        let mut request = self.new_signed_request("POST", "/");
3555        request.add_header(
3556            "x-amz-target",
3557            "AmazonEC2ContainerRegistry_V20150921.PutImage",
3558        );
3559        let encoded = serde_json::to_string(&input).unwrap();
3560        request.set_payload(Some(encoded));
3561
3562        let response = self
3563            .sign_and_dispatch(request, PutImageError::from_response)
3564            .await?;
3565        let mut response = response;
3566        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3567        proto::json::ResponsePayload::new(&response).deserialize::<PutImageResponse, _>()
3568    }
3569
3570    /// <p>Updates the image scanning configuration for the specified repository.</p>
3571    async fn put_image_scanning_configuration(
3572        &self,
3573        input: PutImageScanningConfigurationRequest,
3574    ) -> Result<
3575        PutImageScanningConfigurationResponse,
3576        RusotoError<PutImageScanningConfigurationError>,
3577    > {
3578        let mut request = self.new_signed_request("POST", "/");
3579        request.add_header(
3580            "x-amz-target",
3581            "AmazonEC2ContainerRegistry_V20150921.PutImageScanningConfiguration",
3582        );
3583        let encoded = serde_json::to_string(&input).unwrap();
3584        request.set_payload(Some(encoded));
3585
3586        let response = self
3587            .sign_and_dispatch(request, PutImageScanningConfigurationError::from_response)
3588            .await?;
3589        let mut response = response;
3590        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3591        proto::json::ResponsePayload::new(&response)
3592            .deserialize::<PutImageScanningConfigurationResponse, _>()
3593    }
3594
3595    /// <p>Updates the image tag mutability settings for the specified repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html">Image Tag Mutability</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3596    async fn put_image_tag_mutability(
3597        &self,
3598        input: PutImageTagMutabilityRequest,
3599    ) -> Result<PutImageTagMutabilityResponse, RusotoError<PutImageTagMutabilityError>> {
3600        let mut request = self.new_signed_request("POST", "/");
3601        request.add_header(
3602            "x-amz-target",
3603            "AmazonEC2ContainerRegistry_V20150921.PutImageTagMutability",
3604        );
3605        let encoded = serde_json::to_string(&input).unwrap();
3606        request.set_payload(Some(encoded));
3607
3608        let response = self
3609            .sign_and_dispatch(request, PutImageTagMutabilityError::from_response)
3610            .await?;
3611        let mut response = response;
3612        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3613        proto::json::ResponsePayload::new(&response)
3614            .deserialize::<PutImageTagMutabilityResponse, _>()
3615    }
3616
3617    /// <p>Creates or updates the lifecycle policy for the specified repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html">Lifecycle Policy Template</a>.</p>
3618    async fn put_lifecycle_policy(
3619        &self,
3620        input: PutLifecyclePolicyRequest,
3621    ) -> Result<PutLifecyclePolicyResponse, RusotoError<PutLifecyclePolicyError>> {
3622        let mut request = self.new_signed_request("POST", "/");
3623        request.add_header(
3624            "x-amz-target",
3625            "AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy",
3626        );
3627        let encoded = serde_json::to_string(&input).unwrap();
3628        request.set_payload(Some(encoded));
3629
3630        let response = self
3631            .sign_and_dispatch(request, PutLifecyclePolicyError::from_response)
3632            .await?;
3633        let mut response = response;
3634        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3635        proto::json::ResponsePayload::new(&response).deserialize::<PutLifecyclePolicyResponse, _>()
3636    }
3637
3638    /// <p>Applies a repository policy to the specified repository to control access permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html">Amazon ECR Repository Policies</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3639    async fn set_repository_policy(
3640        &self,
3641        input: SetRepositoryPolicyRequest,
3642    ) -> Result<SetRepositoryPolicyResponse, RusotoError<SetRepositoryPolicyError>> {
3643        let mut request = self.new_signed_request("POST", "/");
3644        request.add_header(
3645            "x-amz-target",
3646            "AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy",
3647        );
3648        let encoded = serde_json::to_string(&input).unwrap();
3649        request.set_payload(Some(encoded));
3650
3651        let response = self
3652            .sign_and_dispatch(request, SetRepositoryPolicyError::from_response)
3653            .await?;
3654        let mut response = response;
3655        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3656        proto::json::ResponsePayload::new(&response).deserialize::<SetRepositoryPolicyResponse, _>()
3657    }
3658
3659    /// <p>Starts an image vulnerability scan. An image scan can only be started once per day on an individual image. This limit includes if an image was scanned on initial push. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html">Image Scanning</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
3660    async fn start_image_scan(
3661        &self,
3662        input: StartImageScanRequest,
3663    ) -> Result<StartImageScanResponse, RusotoError<StartImageScanError>> {
3664        let mut request = self.new_signed_request("POST", "/");
3665        request.add_header(
3666            "x-amz-target",
3667            "AmazonEC2ContainerRegistry_V20150921.StartImageScan",
3668        );
3669        let encoded = serde_json::to_string(&input).unwrap();
3670        request.set_payload(Some(encoded));
3671
3672        let response = self
3673            .sign_and_dispatch(request, StartImageScanError::from_response)
3674            .await?;
3675        let mut response = response;
3676        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3677        proto::json::ResponsePayload::new(&response).deserialize::<StartImageScanResponse, _>()
3678    }
3679
3680    /// <p>Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository.</p>
3681    async fn start_lifecycle_policy_preview(
3682        &self,
3683        input: StartLifecyclePolicyPreviewRequest,
3684    ) -> Result<StartLifecyclePolicyPreviewResponse, RusotoError<StartLifecyclePolicyPreviewError>>
3685    {
3686        let mut request = self.new_signed_request("POST", "/");
3687        request.add_header(
3688            "x-amz-target",
3689            "AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview",
3690        );
3691        let encoded = serde_json::to_string(&input).unwrap();
3692        request.set_payload(Some(encoded));
3693
3694        let response = self
3695            .sign_and_dispatch(request, StartLifecyclePolicyPreviewError::from_response)
3696            .await?;
3697        let mut response = response;
3698        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3699        proto::json::ResponsePayload::new(&response)
3700            .deserialize::<StartLifecyclePolicyPreviewResponse, _>()
3701    }
3702
3703    /// <p>Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.</p>
3704    async fn tag_resource(
3705        &self,
3706        input: TagResourceRequest,
3707    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
3708        let mut request = self.new_signed_request("POST", "/");
3709        request.add_header(
3710            "x-amz-target",
3711            "AmazonEC2ContainerRegistry_V20150921.TagResource",
3712        );
3713        let encoded = serde_json::to_string(&input).unwrap();
3714        request.set_payload(Some(encoded));
3715
3716        let response = self
3717            .sign_and_dispatch(request, TagResourceError::from_response)
3718            .await?;
3719        let mut response = response;
3720        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3721        proto::json::ResponsePayload::new(&response).deserialize::<TagResourceResponse, _>()
3722    }
3723
3724    /// <p>Deletes specified tags from a resource.</p>
3725    async fn untag_resource(
3726        &self,
3727        input: UntagResourceRequest,
3728    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
3729        let mut request = self.new_signed_request("POST", "/");
3730        request.add_header(
3731            "x-amz-target",
3732            "AmazonEC2ContainerRegistry_V20150921.UntagResource",
3733        );
3734        let encoded = serde_json::to_string(&input).unwrap();
3735        request.set_payload(Some(encoded));
3736
3737        let response = self
3738            .sign_and_dispatch(request, UntagResourceError::from_response)
3739            .await?;
3740        let mut response = response;
3741        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3742        proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceResponse, _>()
3743    }
3744
3745    /// <p><p>Uploads an image layer part to Amazon ECR.</p> <p>When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part.</p> <note> <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> </note></p>
3746    async fn upload_layer_part(
3747        &self,
3748        input: UploadLayerPartRequest,
3749    ) -> Result<UploadLayerPartResponse, RusotoError<UploadLayerPartError>> {
3750        let mut request = self.new_signed_request("POST", "/");
3751        request.add_header(
3752            "x-amz-target",
3753            "AmazonEC2ContainerRegistry_V20150921.UploadLayerPart",
3754        );
3755        let encoded = serde_json::to_string(&input).unwrap();
3756        request.set_payload(Some(encoded));
3757
3758        let response = self
3759            .sign_and_dispatch(request, UploadLayerPartError::from_response)
3760            .await?;
3761        let mut response = response;
3762        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3763        proto::json::ResponsePayload::new(&response).deserialize::<UploadLayerPartResponse, _>()
3764    }
3765}