From c885d48ffba3ac93f26b5f42f8fa590fbf251fcf Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 11 Sep 2023 18:16:18 +0000 Subject: [PATCH] feat(client-ecr): This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required. --- .../src/commands/CreateRepositoryCommand.ts | 4 +- .../commands/DeleteLifecyclePolicyCommand.ts | 3 ++ .../src/commands/GetLifecyclePolicyCommand.ts | 3 ++ .../GetLifecyclePolicyPreviewCommand.ts | 3 ++ .../commands/ListTagsForResourceCommand.ts | 4 +- .../src/commands/PutLifecyclePolicyCommand.ts | 3 ++ .../StartLifecyclePolicyPreviewCommand.ts | 3 ++ .../src/commands/TagResourceCommand.ts | 4 +- clients/client-ecr/src/models/models_0.ts | 17 +++++---- .../client-ecr/src/protocols/Aws_json1_1.ts | 15 ++++++++ codegen/sdk-codegen/aws-models/ecr.json | 37 ++++++++++++++----- 11 files changed, 73 insertions(+), 23 deletions(-) diff --git a/clients/client-ecr/src/commands/CreateRepositoryCommand.ts b/clients/client-ecr/src/commands/CreateRepositoryCommand.ts index fc80fba8b2e7..3441c1855bee 100644 --- a/clients/client-ecr/src/commands/CreateRepositoryCommand.ts +++ b/clients/client-ecr/src/commands/CreateRepositoryCommand.ts @@ -49,8 +49,8 @@ export interface CreateRepositoryCommandOutput extends CreateRepositoryResponse, * repositoryName: "STRING_VALUE", // required * tags: [ // TagList * { // Tag - * Key: "STRING_VALUE", - * Value: "STRING_VALUE", + * Key: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required * }, * ], * imageTagMutability: "MUTABLE" || "IMMUTABLE", diff --git a/clients/client-ecr/src/commands/DeleteLifecyclePolicyCommand.ts b/clients/client-ecr/src/commands/DeleteLifecyclePolicyCommand.ts index d4b08ca9ea3b..cb6986bb7007 100644 --- a/clients/client-ecr/src/commands/DeleteLifecyclePolicyCommand.ts +++ b/clients/client-ecr/src/commands/DeleteLifecyclePolicyCommand.ts @@ -79,6 +79,9 @@ export interface DeleteLifecyclePolicyCommandOutput extends DeleteLifecyclePolic * @throws {@link ServerException} (server fault) *

These errors are usually caused by a server-side issue.

* + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * * @throws {@link ECRServiceException} *

Base exception class for all service exceptions from ECR service.

* diff --git a/clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts b/clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts index a518be784c3a..9152c3ae8f4f 100644 --- a/clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts +++ b/clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts @@ -79,6 +79,9 @@ export interface GetLifecyclePolicyCommandOutput extends GetLifecyclePolicyRespo * @throws {@link ServerException} (server fault) *

These errors are usually caused by a server-side issue.

* + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * * @throws {@link ECRServiceException} *

Base exception class for all service exceptions from ECR service.

* diff --git a/clients/client-ecr/src/commands/GetLifecyclePolicyPreviewCommand.ts b/clients/client-ecr/src/commands/GetLifecyclePolicyPreviewCommand.ts index 77cb65bebfdd..84b5249a0d3a 100644 --- a/clients/client-ecr/src/commands/GetLifecyclePolicyPreviewCommand.ts +++ b/clients/client-ecr/src/commands/GetLifecyclePolicyPreviewCommand.ts @@ -107,6 +107,9 @@ export interface GetLifecyclePolicyPreviewCommandOutput extends GetLifecyclePoli * @throws {@link ServerException} (server fault) *

These errors are usually caused by a server-side issue.

* + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * * @throws {@link ECRServiceException} *

Base exception class for all service exceptions from ECR service.

* diff --git a/clients/client-ecr/src/commands/ListTagsForResourceCommand.ts b/clients/client-ecr/src/commands/ListTagsForResourceCommand.ts index a9e72e3594ee..1421aa27df76 100644 --- a/clients/client-ecr/src/commands/ListTagsForResourceCommand.ts +++ b/clients/client-ecr/src/commands/ListTagsForResourceCommand.ts @@ -51,8 +51,8 @@ export interface ListTagsForResourceCommandOutput extends ListTagsForResourceRes * // { // ListTagsForResourceResponse * // tags: [ // TagList * // { // Tag - * // Key: "STRING_VALUE", - * // Value: "STRING_VALUE", + * // Key: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required * // }, * // ], * // }; diff --git a/clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts b/clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts index a31efa2896b6..8c5a5f336216 100644 --- a/clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts +++ b/clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts @@ -77,6 +77,9 @@ export interface PutLifecyclePolicyCommandOutput extends PutLifecyclePolicyRespo * @throws {@link ServerException} (server fault) *

These errors are usually caused by a server-side issue.

* + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * * @throws {@link ECRServiceException} *

Base exception class for all service exceptions from ECR service.

* diff --git a/clients/client-ecr/src/commands/StartLifecyclePolicyPreviewCommand.ts b/clients/client-ecr/src/commands/StartLifecyclePolicyPreviewCommand.ts index 03b1e952d4f9..d6906e5aec4b 100644 --- a/clients/client-ecr/src/commands/StartLifecyclePolicyPreviewCommand.ts +++ b/clients/client-ecr/src/commands/StartLifecyclePolicyPreviewCommand.ts @@ -87,6 +87,9 @@ export interface StartLifecyclePolicyPreviewCommandOutput * @throws {@link ServerException} (server fault) *

These errors are usually caused by a server-side issue.

* + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * * @throws {@link ECRServiceException} *

Base exception class for all service exceptions from ECR service.

* diff --git a/clients/client-ecr/src/commands/TagResourceCommand.ts b/clients/client-ecr/src/commands/TagResourceCommand.ts index 173e19095778..5052b5f5179c 100644 --- a/clients/client-ecr/src/commands/TagResourceCommand.ts +++ b/clients/client-ecr/src/commands/TagResourceCommand.ts @@ -48,8 +48,8 @@ export interface TagResourceCommandOutput extends TagResourceResponse, __Metadat * resourceArn: "STRING_VALUE", // required * tags: [ // TagList // required * { // Tag - * Key: "STRING_VALUE", - * Value: "STRING_VALUE", + * Key: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required * }, * ], * }; diff --git a/clients/client-ecr/src/models/models_0.ts b/clients/client-ecr/src/models/models_0.ts index ba7786729277..955e771dbcaf 100644 --- a/clients/client-ecr/src/models/models_0.ts +++ b/clients/client-ecr/src/models/models_0.ts @@ -962,13 +962,13 @@ export interface Tag { *

One part of a key-value pair that make up a tag. A key is a general label * that acts like a category for more specific tag values.

*/ - Key?: string; + Key: string | undefined; /** * @public *

A value acts as a descriptor within a tag category (key).

*/ - Value?: string; + Value: string | undefined; } /** @@ -987,6 +987,8 @@ export interface CreateRepositoryRequest { *

The name to use for the repository. The repository name may be specified on its own * (such as nginx-web-app) or it can be prepended with a namespace to group * the repository into a category (such as project-a/nginx-web-app).

+ *

The repository name must start with a letter and can only contain lowercase letters, + * numbers, hyphens, underscores, and forward slashes.

*/ repositoryName: string | undefined; @@ -1032,7 +1034,7 @@ export interface Repository { * @public *

The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the * repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name. - * For example, arn:aws:ecr:region:012345678910:repository/test.

+ * For example, arn:aws:ecr:region:012345678910:repository-namespace/repository-name.

*/ repositoryArn?: string; @@ -2626,8 +2628,8 @@ export type RepositoryFilterType = (typeof RepositoryFilterType)[keyof typeof Re * @public *

The filter settings used with image replication. Specifying a repository filter to a * replication rule provides a method for controlling which repositories in a private - * registry are replicated. If no repository filter is specified, all images in the - * repository are replicated.

+ * registry are replicated. If no filters are added, the contents of all repositories are + * replicated.

*/ export interface RepositoryFilter { /** @@ -3224,8 +3226,9 @@ export interface RegistryScanningRule { *

The frequency that scans are performed at for a private registry. When the * ENHANCED scan type is specified, the supported scan frequencies are * CONTINUOUS_SCAN and SCAN_ON_PUSH. When the - * BASIC scan type is specified, the SCAN_ON_PUSH and - * MANUAL scan frequencies are supported.

+ * BASIC scan type is specified, the SCAN_ON_PUSH scan + * frequency is supported. If scan on push is not specified, then the MANUAL + * scan frequency is set by default.

*/ scanFrequency: ScanFrequency | string | undefined; diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 0bf150ba59a9..9a79b9ca1fc7 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -1239,6 +1239,9 @@ const de_DeleteLifecyclePolicyCommandError = async ( case "ServerException": case "com.amazonaws.ecr#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ecr#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -1957,6 +1960,9 @@ const de_GetLifecyclePolicyCommandError = async ( case "ServerException": case "com.amazonaws.ecr#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ecr#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -2012,6 +2018,9 @@ const de_GetLifecyclePolicyPreviewCommandError = async ( case "ServerException": case "com.amazonaws.ecr#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ecr#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -2565,6 +2574,9 @@ const de_PutLifecyclePolicyCommandError = async ( case "ServerException": case "com.amazonaws.ecr#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ecr#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -2895,6 +2907,9 @@ const de_StartLifecyclePolicyPreviewCommandError = async ( case "ServerException": case "com.amazonaws.ecr#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ecr#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ diff --git a/codegen/sdk-codegen/aws-models/ecr.json b/codegen/sdk-codegen/aws-models/ecr.json index 316e57606364..bef077d3674e 100644 --- a/codegen/sdk-codegen/aws-models/ecr.json +++ b/codegen/sdk-codegen/aws-models/ecr.json @@ -1994,7 +1994,7 @@ "repositoryName": { "target": "com.amazonaws.ecr#RepositoryName", "traits": { - "smithy.api#documentation": "

The name to use for the repository. The repository name may be specified on its own\n (such as nginx-web-app) or it can be prepended with a namespace to group\n the repository into a category (such as project-a/nginx-web-app).

", + "smithy.api#documentation": "

The name to use for the repository. The repository name may be specified on its own\n (such as nginx-web-app) or it can be prepended with a namespace to group\n the repository into a category (such as project-a/nginx-web-app).

\n

The repository name must start with a letter and can only contain lowercase letters,\n numbers, hyphens, underscores, and forward slashes.

", "smithy.api#required": {} } }, @@ -2171,6 +2171,9 @@ }, { "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" } ], "traits": { @@ -3505,6 +3508,9 @@ }, { "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" } ], "traits": { @@ -3531,6 +3537,9 @@ }, { "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" } ], "traits": { @@ -3596,13 +3605,13 @@ "nextToken": { "target": "com.amazonaws.ecr#NextToken", "traits": { - "smithy.api#documentation": "

The nextToken value returned from a previous paginated
\n GetLifecyclePolicyPreviewRequest request where maxResults\n was used and the
 results exceeded the value of that parameter. Pagination continues\n from the end of the
 previous results that returned the nextToken value.\n This value is
 null when there are no more results to return. This option\n cannot be used when you specify images with imageIds.

" + "smithy.api#documentation": "

The nextToken value returned from a previous paginated\u2028\n GetLifecyclePolicyPreviewRequest request where maxResults\n was used and the\u2028 results exceeded the value of that parameter. Pagination continues\n from the end of the\u2028 previous results that returned the nextToken value.\n This value is\u2028 null when there are no more results to return. This option\n cannot be used when you specify images with imageIds.

" } }, "maxResults": { "target": "com.amazonaws.ecr#LifecyclePreviewMaxResults", "traits": { - "smithy.api#documentation": "

The maximum number of repository results returned by\n GetLifecyclePolicyPreviewRequest in
 paginated output. When this\n parameter is used, GetLifecyclePolicyPreviewRequest only returns
\n maxResults results in a single page along with a\n nextToken
 response element. The remaining results of the initial request\n can be seen by sending
 another GetLifecyclePolicyPreviewRequest request\n with the returned nextToken
 value. This value can be between\n 1 and 1000. If this
 parameter is not used, then\n GetLifecyclePolicyPreviewRequest returns up to
 100\n results and a nextToken value, if
 applicable. This option cannot be used\n when you specify images with imageIds.

" + "smithy.api#documentation": "

The maximum number of repository results returned by\n GetLifecyclePolicyPreviewRequest in\u2028 paginated output. When this\n parameter is used, GetLifecyclePolicyPreviewRequest only returns\u2028\n maxResults results in a single page along with a\n nextToken\u2028 response element. The remaining results of the initial request\n can be seen by sending\u2028 another GetLifecyclePolicyPreviewRequest request\n with the returned nextToken\u2028 value. This value can be between\n 1 and 1000. If this\u2028 parameter is not used, then\n GetLifecyclePolicyPreviewRequest returns up to\u2028 100\n results and a nextToken value, if\u2028 applicable. This option cannot be used\n when you specify images with imageIds.

" } }, "filter": { @@ -5669,6 +5678,9 @@ }, { "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" } ], "traits": { @@ -5681,7 +5693,7 @@ "registryId": { "target": "com.amazonaws.ecr#RegistryId", "traits": { - "smithy.api#documentation": "

The Amazon Web Services account ID associated with the registry that contains the repository. If you\n do
 not specify a registry, the default registry is assumed.

" + "smithy.api#documentation": "

The Amazon Web Services account ID associated with the registry that contains the repository. If you\n do\u2028 not specify a registry, the default registry is assumed.

" } }, "repositoryName": { @@ -6006,7 +6018,7 @@ "scanFrequency": { "target": "com.amazonaws.ecr#ScanFrequency", "traits": { - "smithy.api#documentation": "

The frequency that scans are performed at for a private registry. When the\n ENHANCED scan type is specified, the supported scan frequencies are\n CONTINUOUS_SCAN and SCAN_ON_PUSH. When the\n BASIC scan type is specified, the SCAN_ON_PUSH and\n MANUAL scan frequencies are supported.

", + "smithy.api#documentation": "

The frequency that scans are performed at for a private registry. When the\n ENHANCED scan type is specified, the supported scan frequencies are\n CONTINUOUS_SCAN and SCAN_ON_PUSH. When the\n BASIC scan type is specified, the SCAN_ON_PUSH scan\n frequency is supported. If scan on push is not specified, then the MANUAL\n scan frequency is set by default.

", "smithy.api#required": {} } }, @@ -6174,7 +6186,7 @@ "repositoryArn": { "target": "com.amazonaws.ecr#Arn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the\n repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name.\n For example, arn:aws:ecr:region:012345678910:repository/test.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the\n repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name.\n For example, arn:aws:ecr:region:012345678910:repository-namespace/repository-name.

" } }, "registryId": { @@ -6255,7 +6267,7 @@ } }, "traits": { - "smithy.api#documentation": "

The filter settings used with image replication. Specifying a repository filter to a\n replication rule provides a method for controlling which repositories in a private\n registry are replicated. If no repository filter is specified, all images in the\n repository are replicated.

" + "smithy.api#documentation": "

The filter settings used with image replication. Specifying a repository filter to a\n replication rule provides a method for controlling which repositories in a private\n registry are replicated. If no filters are added, the contents of all repositories are\n replicated.

" } }, "com.amazonaws.ecr#RepositoryFilterList": { @@ -6956,6 +6968,9 @@ }, { "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" } ], "traits": { @@ -7030,13 +7045,15 @@ "Key": { "target": "com.amazonaws.ecr#TagKey", "traits": { - "smithy.api#documentation": "

One part of a key-value pair that make up a tag. A key is a general label\n that acts like a category for more specific tag values.

" + "smithy.api#documentation": "

One part of a key-value pair that make up a tag. A key is a general label\n that acts like a category for more specific tag values.

", + "smithy.api#required": {} } }, "Value": { "target": "com.amazonaws.ecr#TagValue", "traits": { - "smithy.api#documentation": "

A value acts as a descriptor within a tag category (key).

" + "smithy.api#documentation": "

A value acts as a descriptor within a tag category (key).

", + "smithy.api#required": {} } } }, @@ -7480,4 +7497,4 @@ } } } -} \ No newline at end of file +}