Skip to content

Commit

Permalink
feat(client-ecr): This release will have ValidationException be throw…
Browse files Browse the repository at this point in the history
…n 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.
  • Loading branch information
awstools committed Sep 11, 2023
1 parent 12e1529 commit c885d48
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 23 deletions.
4 changes: 2 additions & 2 deletions clients/client-ecr/src/commands/CreateRepositoryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export interface DeleteLifecyclePolicyCommandOutput extends DeleteLifecyclePolic
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
Expand Down
3 changes: 3 additions & 0 deletions clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export interface GetLifecyclePolicyCommandOutput extends GetLifecyclePolicyRespo
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export interface GetLifecyclePolicyPreviewCommandOutput extends GetLifecyclePoli
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
Expand Down
4 changes: 2 additions & 2 deletions clients/client-ecr/src/commands/ListTagsForResourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
* // },
* // ],
* // };
Expand Down
3 changes: 3 additions & 0 deletions clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export interface PutLifecyclePolicyCommandOutput extends PutLifecyclePolicyRespo
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export interface StartLifecyclePolicyPreviewCommandOutput
* @throws {@link ServerException} (server fault)
* <p>These errors are usually caused by a server-side issue.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>There was an exception validating this request.</p>
*
* @throws {@link ECRServiceException}
* <p>Base exception class for all service exceptions from ECR service.</p>
*
Expand Down
4 changes: 2 additions & 2 deletions clients/client-ecr/src/commands/TagResourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
* },
* ],
* };
Expand Down
17 changes: 10 additions & 7 deletions clients/client-ecr/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,13 +962,13 @@ export interface Tag {
* <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>
*/
Key?: string;
Key: string | undefined;

/**
* @public
* <p>A <code>value</code> acts as a descriptor within a tag category (key).</p>
*/
Value?: string;
Value: string | undefined;
}

/**
Expand All @@ -987,6 +987,8 @@ export interface CreateRepositoryRequest {
* <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>
* <p>The repository name must start with a letter and can only contain lowercase letters,
* numbers, hyphens, underscores, and forward slashes.</p>
*/
repositoryName: string | undefined;

Expand Down Expand Up @@ -1032,7 +1034,7 @@ export interface Repository {
* @public
* <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, Amazon Web Services account ID of the repository owner, repository namespace, and repository name.
* For example, <code>arn:aws:ecr:region:012345678910:repository/test</code>.</p>
* For example, <code>arn:aws:ecr:region:012345678910:repository-namespace/repository-name</code>.</p>
*/
repositoryArn?: string;

Expand Down Expand Up @@ -2626,8 +2628,8 @@ export type RepositoryFilterType = (typeof RepositoryFilterType)[keyof typeof Re
* @public
* <p>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.</p>
* registry are replicated. If no filters are added, the contents of all repositories are
* replicated.</p>
*/
export interface RepositoryFilter {
/**
Expand Down Expand Up @@ -3224,8 +3226,9 @@ export interface RegistryScanningRule {
* <p>The frequency that scans are performed at for a private registry. When the
* <code>ENHANCED</code> scan type is specified, the supported scan frequencies are
* <code>CONTINUOUS_SCAN</code> and <code>SCAN_ON_PUSH</code>. When the
* <code>BASIC</code> scan type is specified, the <code>SCAN_ON_PUSH</code> and
* <code>MANUAL</code> scan frequencies are supported.</p>
* <code>BASIC</code> scan type is specified, the <code>SCAN_ON_PUSH</code> scan
* frequency is supported. If scan on push is not specified, then the <code>MANUAL</code>
* scan frequency is set by default.</p>
*/
scanFrequency: ScanFrequency | string | undefined;

Expand Down
15 changes: 15 additions & 0 deletions clients/client-ecr/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down
37 changes: 27 additions & 10 deletions codegen/sdk-codegen/aws-models/ecr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@
"repositoryName": {
"target": "com.amazonaws.ecr#RepositoryName",
"traits": {
"smithy.api#documentation": "<p>The name to use for the repository. The repository name may be specified on its own\n (such as <code>nginx-web-app</code>) or it can be prepended with a namespace to group\n the repository into a category (such as <code>project-a/nginx-web-app</code>).</p>",
"smithy.api#documentation": "<p>The name to use for the repository. The repository name may be specified on its own\n (such as <code>nginx-web-app</code>) or it can be prepended with a namespace to group\n the repository into a category (such as <code>project-a/nginx-web-app</code>).</p>\n <p>The repository name must start with a letter and can only contain lowercase letters,\n numbers, hyphens, underscores, and forward slashes.</p>",
"smithy.api#required": {}
}
},
Expand Down Expand Up @@ -2171,6 +2171,9 @@
},
{
"target": "com.amazonaws.ecr#ServerException"
},
{
"target": "com.amazonaws.ecr#ValidationException"
}
],
"traits": {
Expand Down Expand Up @@ -3505,6 +3508,9 @@
},
{
"target": "com.amazonaws.ecr#ServerException"
},
{
"target": "com.amazonaws.ecr#ValidationException"
}
],
"traits": {
Expand All @@ -3531,6 +3537,9 @@
},
{
"target": "com.amazonaws.ecr#ServerException"
},
{
"target": "com.amazonaws.ecr#ValidationException"
}
],
"traits": {
Expand Down Expand Up @@ -3596,13 +3605,13 @@
"nextToken": {
"target": "com.amazonaws.ecr#NextToken",
"traits": {
"smithy.api#documentation": "<p>The <code>nextToken</code> value returned from a previous paginated\n <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code>\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 <code>nextToken</code> value.\n This value is <code>null</code> when there are no more results to return. This option\n cannot be used when you specify images with <code>imageIds</code>.</p>"
"smithy.api#documentation": "<p>The <code>nextToken</code> value returned from a previous paginated\u2028\n <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code>\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 <code>nextToken</code> value.\n This value is\u2028 <code>null</code> when there are no more results to return. This option\n cannot be used when you specify images with <code>imageIds</code>.</p>"
}
},
"maxResults": {
"target": "com.amazonaws.ecr#LifecyclePreviewMaxResults",
"traits": {
"smithy.api#documentation": "<p>The maximum number of repository results returned by\n <code>GetLifecyclePolicyPreviewRequest</code> in paginated output. When this\n parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns\n <code>maxResults</code> results in a single page along with a\n <code>nextToken</code> response element. The remaining results of the initial request\n can be seen by sending another <code>GetLifecyclePolicyPreviewRequest</code> request\n with the returned <code>nextToken</code> value. This value can be between\n 1 and 1000. If this parameter is not used, then\n <code>GetLifecyclePolicyPreviewRequest</code> returns up to 100\n results and a <code>nextToken</code> value, if applicable. This option cannot be used\n when you specify images with <code>imageIds</code>.</p>"
"smithy.api#documentation": "<p>The maximum number of repository results returned by\n <code>GetLifecyclePolicyPreviewRequest</code> in\u2028 paginated output. When this\n parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns\u2028\n <code>maxResults</code> results in a single page along with a\n <code>nextToken</code>\u2028 response element. The remaining results of the initial request\n can be seen by sending\u2028 another <code>GetLifecyclePolicyPreviewRequest</code> request\n with the returned <code>nextToken</code>\u2028 value. This value can be between\n 1 and 1000. If this\u2028 parameter is not used, then\n <code>GetLifecyclePolicyPreviewRequest</code> returns up to\u2028 100\n results and a <code>nextToken</code> value, if\u2028 applicable. This option cannot be used\n when you specify images with <code>imageIds</code>.</p>"
}
},
"filter": {
Expand Down Expand Up @@ -5669,6 +5678,9 @@
},
{
"target": "com.amazonaws.ecr#ServerException"
},
{
"target": "com.amazonaws.ecr#ValidationException"
}
],
"traits": {
Expand All @@ -5681,7 +5693,7 @@
"registryId": {
"target": "com.amazonaws.ecr#RegistryId",
"traits": {
"smithy.api#documentation": "<p>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.</p>"
"smithy.api#documentation": "<p>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.</p>"
}
},
"repositoryName": {
Expand Down Expand Up @@ -6006,7 +6018,7 @@
"scanFrequency": {
"target": "com.amazonaws.ecr#ScanFrequency",
"traits": {
"smithy.api#documentation": "<p>The frequency that scans are performed at for a private registry. When the\n <code>ENHANCED</code> scan type is specified, the supported scan frequencies are\n <code>CONTINUOUS_SCAN</code> and <code>SCAN_ON_PUSH</code>. When the\n <code>BASIC</code> scan type is specified, the <code>SCAN_ON_PUSH</code> and\n <code>MANUAL</code> scan frequencies are supported.</p>",
"smithy.api#documentation": "<p>The frequency that scans are performed at for a private registry. When the\n <code>ENHANCED</code> scan type is specified, the supported scan frequencies are\n <code>CONTINUOUS_SCAN</code> and <code>SCAN_ON_PUSH</code>. When the\n <code>BASIC</code> scan type is specified, the <code>SCAN_ON_PUSH</code> scan\n frequency is supported. If scan on push is not specified, then the <code>MANUAL</code>\n scan frequency is set by default.</p>",
"smithy.api#required": {}
}
},
Expand Down Expand Up @@ -6174,7 +6186,7 @@
"repositoryArn": {
"target": "com.amazonaws.ecr#Arn",
"traits": {
"smithy.api#documentation": "<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\n repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name.\n For example, <code>arn:aws:ecr:region:012345678910:repository/test</code>.</p>"
"smithy.api#documentation": "<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\n repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name.\n For example, <code>arn:aws:ecr:region:012345678910:repository-namespace/repository-name</code>.</p>"
}
},
"registryId": {
Expand Down Expand Up @@ -6255,7 +6267,7 @@
}
},
"traits": {
"smithy.api#documentation": "<p>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.</p>"
"smithy.api#documentation": "<p>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.</p>"
}
},
"com.amazonaws.ecr#RepositoryFilterList": {
Expand Down Expand Up @@ -6956,6 +6968,9 @@
},
{
"target": "com.amazonaws.ecr#ServerException"
},
{
"target": "com.amazonaws.ecr#ValidationException"
}
],
"traits": {
Expand Down Expand Up @@ -7030,13 +7045,15 @@
"Key": {
"target": "com.amazonaws.ecr#TagKey",
"traits": {
"smithy.api#documentation": "<p>One part of a key-value pair that make up a tag. A <code>key</code> is a general label\n that acts like a category for more specific tag values.</p>"
"smithy.api#documentation": "<p>One part of a key-value pair that make up a tag. A <code>key</code> is a general label\n that acts like a category for more specific tag values.</p>",
"smithy.api#required": {}
}
},
"Value": {
"target": "com.amazonaws.ecr#TagValue",
"traits": {
"smithy.api#documentation": "<p>A <code>value</code> acts as a descriptor within a tag category (key).</p>"
"smithy.api#documentation": "<p>A <code>value</code> acts as a descriptor within a tag category (key).</p>",
"smithy.api#required": {}
}
}
},
Expand Down Expand Up @@ -7480,4 +7497,4 @@
}
}
}
}
}

0 comments on commit c885d48

Please sign in to comment.