From b689c249053165c68ee2ab20a3e7f44965937a8c Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 6 Oct 2023 18:19:04 +0000 Subject: [PATCH] feat(client-marketplace-catalog): This release adds support for Document type as an alternative for stringified JSON for StartChangeSet, DescribeChangeSet and DescribeEntity APIs --- .../commands/DeleteResourcePolicyCommand.ts | 2 +- .../src/commands/DescribeChangeSetCommand.ts | 1 + .../src/commands/DescribeEntityCommand.ts | 1 + .../src/commands/GetResourcePolicyCommand.ts | 2 +- .../src/commands/PutResourcePolicyCommand.ts | 2 +- .../src/commands/StartChangeSetCommand.ts | 9 +-- .../src/models/models_0.ts | 51 ++++++++++--- .../src/protocols/Aws_restJson1.ts | 72 +++++++++++++++++-- .../aws-models/marketplace-catalog.json | 49 +++++++++---- 9 files changed, 152 insertions(+), 37 deletions(-) diff --git a/clients/client-marketplace-catalog/src/commands/DeleteResourcePolicyCommand.ts b/clients/client-marketplace-catalog/src/commands/DeleteResourcePolicyCommand.ts index 6009dfbbe68f..1b7d799a45c5 100644 --- a/clients/client-marketplace-catalog/src/commands/DeleteResourcePolicyCommand.ts +++ b/clients/client-marketplace-catalog/src/commands/DeleteResourcePolicyCommand.ts @@ -41,7 +41,7 @@ export interface DeleteResourcePolicyCommandOutput extends DeleteResourcePolicyR /** * @public - *

Deletes a resource-based policy on an Entity that is identified by its resource + *

Deletes a resource-based policy on an entity that is identified by its resource * ARN.

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts b/clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts index 5a31a0c8af3d..75ce6fe385f5 100644 --- a/clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts +++ b/clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts @@ -71,6 +71,7 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetRespons * // Identifier: "STRING_VALUE", * // }, * // Details: "STRING_VALUE", + * // DetailsDocument: "DOCUMENT_VALUE", * // ErrorDetailList: [ // ErrorDetailList * // { // ErrorDetail * // ErrorCode: "STRING_VALUE", diff --git a/clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts b/clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts index 0cc1961b0210..c3d5c5fe7755 100644 --- a/clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts +++ b/clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts @@ -60,6 +60,7 @@ export interface DescribeEntityCommandOutput extends DescribeEntityResponse, __M * // EntityArn: "STRING_VALUE", * // LastModifiedDate: "STRING_VALUE", * // Details: "STRING_VALUE", + * // DetailsDocument: "DOCUMENT_VALUE", * // }; * * ``` diff --git a/clients/client-marketplace-catalog/src/commands/GetResourcePolicyCommand.ts b/clients/client-marketplace-catalog/src/commands/GetResourcePolicyCommand.ts index 0fe7c688ba7c..791b46ce437a 100644 --- a/clients/client-marketplace-catalog/src/commands/GetResourcePolicyCommand.ts +++ b/clients/client-marketplace-catalog/src/commands/GetResourcePolicyCommand.ts @@ -41,7 +41,7 @@ export interface GetResourcePolicyCommandOutput extends GetResourcePolicyRespons /** * @public - *

Gets a resource-based policy of an Entity that is identified by its resource + *

Gets a resource-based policy of an entity that is identified by its resource * ARN.

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-marketplace-catalog/src/commands/PutResourcePolicyCommand.ts b/clients/client-marketplace-catalog/src/commands/PutResourcePolicyCommand.ts index 33db0254a3f6..0d98b30d7aa1 100644 --- a/clients/client-marketplace-catalog/src/commands/PutResourcePolicyCommand.ts +++ b/clients/client-marketplace-catalog/src/commands/PutResourcePolicyCommand.ts @@ -41,7 +41,7 @@ export interface PutResourcePolicyCommandOutput extends PutResourcePolicyRespons /** * @public - *

Attaches a resource-based policy to an Entity. Examples of an entity include: + *

Attaches a resource-based policy to an entity. Examples of an entity include: * AmiProduct and ContainerProduct.

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts b/clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts index d3b6ac7c0c0c..32d391abe565 100644 --- a/clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts +++ b/clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts @@ -51,9 +51,9 @@ export interface StartChangeSetCommandOutput extends StartChangeSetResponse, __M *

For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same * change type (AddRevisions) against the same entity * (entity-id@1).

- *

For more information about working with change sets, see Working with change sets. For information on change types for single-AMI - * products, see Working with single-AMI products. Als, for more information on change types - * available for container-based products, see Working with container products.

+ *

For more information about working with change sets, see Working with change sets. For information about change types for + * single-AMI products, see Working with single-AMI products. Also, for more information about change + * types available for container-based products, see Working with container products.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript @@ -75,7 +75,8 @@ export interface StartChangeSetCommandOutput extends StartChangeSetResponse, __M * Value: "STRING_VALUE", // required * }, * ], - * Details: "STRING_VALUE", // required + * Details: "STRING_VALUE", + * DetailsDocument: "DOCUMENT_VALUE", * ChangeName: "STRING_VALUE", * }, * ], diff --git a/clients/client-marketplace-catalog/src/models/models_0.ts b/clients/client-marketplace-catalog/src/models/models_0.ts index 4d474fffb302..ccc323e0486a 100644 --- a/clients/client-marketplace-catalog/src/models/models_0.ts +++ b/clients/client-marketplace-catalog/src/models/models_0.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; +import { DocumentType as __DocumentType } from "@smithy/types"; import { MarketplaceCatalogServiceException as __BaseException } from "./MarketplaceCatalogServiceException"; @@ -182,7 +183,7 @@ export class ValidationException extends __BaseException { export interface DeleteResourcePolicyRequest { /** * @public - *

The Amazon Resource Name (ARN) of the Entity resource that is associated with the + *

The Amazon Resource Name (ARN) of the entity resource that is associated with the * resource policy.

*/ ResourceArn: string | undefined; @@ -275,6 +276,12 @@ export interface ChangeSummary { */ Details?: string; + /** + * @public + *

The JSON value of the details specific to the change type of the requested change.

+ */ + DetailsDocument?: __DocumentType; + /** * @public *

An array of ErrorDetail objects associated with the change.

@@ -442,6 +449,12 @@ export interface DescribeEntityResponse { *

This stringified JSON object includes the details of the entity.

*/ Details?: string; + + /** + * @public + *

The JSON value of the details specific to the entity.

+ */ + DetailsDocument?: __DocumentType; } /** @@ -472,7 +485,7 @@ export class ResourceNotSupportedException extends __BaseException { export interface GetResourcePolicyRequest { /** * @public - *

The Amazon Resource Name (ARN) of the Entity resource that is associated with the + *

The Amazon Resource Name (ARN) of the entity resource that is associated with the * resource policy.

*/ ResourceArn: string | undefined; @@ -575,8 +588,9 @@ export interface Sort { /** * @public *

For ListEntities, supported attributes include - * LastModifiedDate (default), Visibility, - * EntityId, and Name.

+ * LastModifiedDate (default) and EntityId. In addition to + * LastModifiedDate and EntityId, each + * EntityType might support additional fields.

*

For ListChangeSets, supported attributes include StartTime * and EndTime.

*/ @@ -768,6 +782,14 @@ export interface ListEntitiesRequest { */ MaxResults?: number; + /** + * @public + *

Filters the returned set of entities based on their owner. The default is + * SELF. To list entities shared with you + * through AWS Resource Access Manager (AWS RAM), set to SHARED. Entities shared through the AWS Marketplace + * Catalog API PutResourcePolicy operation can't be discovered through the + * SHARED parameter.

+ */ OwnershipType?: OwnershipType | string; } @@ -890,8 +912,8 @@ export interface ListTagsForResourceResponse { export interface PutResourcePolicyRequest { /** * @public - *

The Amazon Resource Name (ARN) of the Entity resource you want to associate with a - * resource policy.

+ *

The Amazon Resource Name (ARN) of the entity resource you want to associate with a + * resource policy.

*/ ResourceArn: string | undefined; @@ -940,7 +962,7 @@ export interface Change { *

Change types are single string values that describe your intention for the change. * Each change type is unique for each EntityType provided in the change's * scope. For more information on change types available for single-AMI products, see - * Working with single-AMI products. Also, for more information on change + * Working with single-AMI products. Also, for more information about change * types available for container-based products, see Working with container products.

*/ ChangeType: string | undefined; @@ -959,12 +981,19 @@ export interface Change { /** * @public - *

This object contains details specific to the change type of the requested - * change. For more - * information on change types available for single-AMI products, see Working with single-AMI products. Also, for more information on change + *

This object contains details specific to the change type of the requested change. For + * more information about change types available for single-AMI products, see Working with single-AMI products. Also, for more information about change * types available for container-based products, see Working with container products.

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

Alternative field that accepts a JSON value instead of a string for + * ChangeType details. You can use either Details or + * DetailsDocument, but not both.

+ */ + DetailsDocument?: __DocumentType; /** * @public diff --git a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts index c94dd3f275f1..5b3b8a70964c 100644 --- a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@smithy/smithy-client"; import { + DocumentType as __DocumentType, Endpoint as __Endpoint, ResponseMetadata as __ResponseMetadata, SerdeContext as __SerdeContext, @@ -41,6 +42,7 @@ import { MarketplaceCatalogServiceException as __BaseException } from "../models import { AccessDeniedException, Change, + ChangeSummary, Entity, Filter, InternalServiceException, @@ -330,7 +332,7 @@ export const se_StartChangeSetCommand = async ( body = JSON.stringify( take(input, { Catalog: [], - ChangeSet: (_) => _json(_), + ChangeSet: (_) => se_RequestedChangeList(_, context), ChangeSetName: [], ChangeSetTags: (_) => _json(_), ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()], @@ -540,7 +542,7 @@ export const de_DescribeChangeSetCommand = async ( }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChangeSet: _json, + ChangeSet: (_) => de_ChangeSetDescription(_, context), ChangeSetArn: __expectString, ChangeSetId: __expectString, ChangeSetName: __expectString, @@ -608,6 +610,7 @@ export const de_DescribeEntityCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Details: __expectString, + DetailsDocument: (_) => de_JsonDocumentType(_, context), EntityArn: __expectString, EntityIdentifier: __expectString, EntityType: __expectString, @@ -1280,7 +1283,19 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont return __decorateServiceException(exception, parsedOutput.body); }; -// se_Change omitted. +/** + * serializeAws_restJson1Change + */ +const se_Change = (input: Change, context: __SerdeContext): any => { + return take(input, { + ChangeName: [], + ChangeType: [], + Details: [], + DetailsDocument: (_) => se_JsonDocumentType(_, context), + Entity: _json, + EntityTags: _json, + }); +}; // se_Entity omitted. @@ -1288,7 +1303,23 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_FilterList omitted. -// se_RequestedChangeList omitted. +/** + * serializeAws_restJson1JsonDocumentType + */ +const se_JsonDocumentType = (input: __DocumentType, context: __SerdeContext): any => { + return input; +}; + +/** + * serializeAws_restJson1RequestedChangeList + */ +const se_RequestedChangeList = (input: Change[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_Change(entry, context); + }); +}; // se_Sort omitted. @@ -1300,13 +1331,35 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_ValueList omitted. -// de_ChangeSetDescription omitted. +/** + * deserializeAws_restJson1ChangeSetDescription + */ +const de_ChangeSetDescription = (output: any, context: __SerdeContext): ChangeSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_ChangeSummary(entry, context); + }); + return retVal; +}; // de_ChangeSetSummaryList omitted. // de_ChangeSetSummaryListItem omitted. -// de_ChangeSummary omitted. +/** + * deserializeAws_restJson1ChangeSummary + */ +const de_ChangeSummary = (output: any, context: __SerdeContext): ChangeSummary => { + return take(output, { + ChangeName: __expectString, + ChangeType: __expectString, + Details: __expectString, + DetailsDocument: (_: any) => de_JsonDocumentType(_, context), + Entity: _json, + ErrorDetailList: _json, + }) as any; +}; // de_Entity omitted. @@ -1318,6 +1371,13 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // de_ErrorDetailList omitted. +/** + * deserializeAws_restJson1JsonDocumentType + */ +const de_JsonDocumentType = (output: any, context: __SerdeContext): __DocumentType => { + return output; +}; + // de_ResourceIdList omitted. // de_Tag omitted. diff --git a/codegen/sdk-codegen/aws-models/marketplace-catalog.json b/codegen/sdk-codegen/aws-models/marketplace-catalog.json index f7ede8497108..19f32881a21e 100644 --- a/codegen/sdk-codegen/aws-models/marketplace-catalog.json +++ b/codegen/sdk-codegen/aws-models/marketplace-catalog.json @@ -834,7 +834,7 @@ "ChangeType": { "target": "com.amazonaws.marketplacecatalog#ChangeType", "traits": { - "smithy.api#documentation": "

Change types are single string values that describe your intention for the change.\n Each change type is unique for each EntityType provided in the change's\n scope. For more information on change types available for single-AMI products, see\n Working with single-AMI products. Also, for more information on change\n types available for container-based products, see Working with container products.

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

Change types are single string values that describe your intention for the change.\n Each change type is unique for each EntityType provided in the change's\n scope. For more information on change types available for single-AMI products, see\n Working with single-AMI products. Also, for more information about change\n types available for container-based products, see Working with container products.

", "smithy.api#required": {} } }, @@ -854,8 +854,13 @@ "Details": { "target": "com.amazonaws.marketplacecatalog#Json", "traits": { - "smithy.api#documentation": "

This object contains details specific to the change type of the requested\n change. For more\n information on change types available for single-AMI products, see Working with single-AMI products. Also, for more information on change\n types available for container-based products, see Working with container products.

", - "smithy.api#required": {} + "smithy.api#documentation": "

This object contains details specific to the change type of the requested change. For\n more information about change types available for single-AMI products, see Working with single-AMI products. Also, for more information about change\n types available for container-based products, see Working with container products.

" + } + }, + "DetailsDocument": { + "target": "com.amazonaws.marketplacecatalog#JsonDocumentType", + "traits": { + "smithy.api#documentation": "

Alternative field that accepts a JSON value instead of a string for\n ChangeType details. You can use either Details or\n DetailsDocument, but not both.

" } }, "ChangeName": { @@ -1013,6 +1018,12 @@ "smithy.api#documentation": "

This object contains details specific to the change type of the requested\n change.

" } }, + "DetailsDocument": { + "target": "com.amazonaws.marketplacecatalog#JsonDocumentType", + "traits": { + "smithy.api#documentation": "

The JSON value of the details specific to the change type of the requested change.

" + } + }, "ErrorDetailList": { "target": "com.amazonaws.marketplacecatalog#ErrorDetailList", "traits": { @@ -1086,7 +1097,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes a resource-based policy on an Entity that is identified by its resource\n ARN.

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

Deletes a resource-based policy on an entity that is identified by its resource\n ARN.

", "smithy.api#http": { "method": "DELETE", "uri": "/DeleteResourcePolicy", @@ -1100,7 +1111,7 @@ "ResourceArn": { "target": "com.amazonaws.marketplacecatalog#ResourceARN", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Entity resource that is associated with the\n resource policy.

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

The Amazon Resource Name (ARN) of the entity resource that is associated with the\n resource policy.

", "smithy.api#httpQuery": "resourceArn", "smithy.api#required": {} } @@ -1330,6 +1341,12 @@ "traits": { "smithy.api#documentation": "

This stringified JSON object includes the details of the entity.

" } + }, + "DetailsDocument": { + "target": "com.amazonaws.marketplacecatalog#JsonDocumentType", + "traits": { + "smithy.api#documentation": "

The JSON value of the details specific to the entity.

" + } } }, "traits": { @@ -1568,7 +1585,7 @@ } ], "traits": { - "smithy.api#documentation": "

Gets a resource-based policy of an Entity that is identified by its resource\n ARN.

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

Gets a resource-based policy of an entity that is identified by its resource\n ARN.

", "smithy.api#http": { "method": "GET", "uri": "/GetResourcePolicy", @@ -1582,7 +1599,7 @@ "ResourceArn": { "target": "com.amazonaws.marketplacecatalog#ResourceARN", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Entity resource that is associated with the\n resource policy.

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

The Amazon Resource Name (ARN) of the entity resource that is associated with the\n resource policy.

", "smithy.api#httpQuery": "resourceArn", "smithy.api#required": {} } @@ -1639,6 +1656,9 @@ "smithy.api#pattern": "^[\\s]*\\{[\\s\\S]*\\}[\\s]*$" } }, + "com.amazonaws.marketplacecatalog#JsonDocumentType": { + "type": "document" + }, "com.amazonaws.marketplacecatalog#ListChangeSets": { "type": "operation", "input": { @@ -1835,7 +1855,10 @@ } }, "OwnershipType": { - "target": "com.amazonaws.marketplacecatalog#OwnershipType" + "target": "com.amazonaws.marketplacecatalog#OwnershipType", + "traits": { + "smithy.api#documentation": "

Filters the returned set of entities based on their owner. The default is\n SELF. To list entities shared with you\n through AWS Resource Access Manager (AWS RAM), set to SHARED. Entities shared through the AWS Marketplace\n Catalog API PutResourcePolicy operation can't be discovered through the\n SHARED parameter.

" + } } }, "traits": { @@ -1984,7 +2007,7 @@ } ], "traits": { - "smithy.api#documentation": "

Attaches a resource-based policy to an Entity. Examples of an entity include:\n AmiProduct and ContainerProduct.

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

Attaches a resource-based policy to an entity. Examples of an entity include:\n AmiProduct and ContainerProduct.

", "smithy.api#http": { "method": "POST", "uri": "/PutResourcePolicy", @@ -1998,7 +2021,7 @@ "ResourceArn": { "target": "com.amazonaws.marketplacecatalog#ResourceARN", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Entity resource you want to associate with a\n resource policy.

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

The Amazon Resource Name (ARN) of the entity resource you want to associate with a\n resource policy.

", "smithy.api#required": {} } }, @@ -2127,7 +2150,7 @@ "SortBy": { "target": "com.amazonaws.marketplacecatalog#SortBy", "traits": { - "smithy.api#documentation": "

For ListEntities, supported attributes include\n LastModifiedDate (default), Visibility,\n EntityId, and Name.

\n

For ListChangeSets, supported attributes include StartTime\n and EndTime.

" + "smithy.api#documentation": "

For ListEntities, supported attributes include\n LastModifiedDate (default) and EntityId. In addition to\n LastModifiedDate and EntityId, each\n EntityType might support additional fields.

\n

For ListChangeSets, supported attributes include StartTime\n and EndTime.

" } }, "SortOrder": { @@ -2200,7 +2223,7 @@ } ], "traits": { - "smithy.api#documentation": "

Allows you to request changes for your entities. Within a single\n ChangeSet, you can't start the same change type against the same entity\n multiple times. Additionally, when a ChangeSet is running, all the entities\n targeted by the different changes are locked until the change set has completed (either\n succeeded, cancelled, or failed). If you try to start a change set containing a change\n against an entity that is already locked, you will receive a\n ResourceInUseException error.

\n

For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same\n change type (AddRevisions) against the same entity\n (entity-id@1).

\n

For more information about working with change sets, see Working with change sets. For information on change types for single-AMI\n products, see Working with single-AMI products. Als, for more information on change types\n available for container-based products, see Working with container products.

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

Allows you to request changes for your entities. Within a single\n ChangeSet, you can't start the same change type against the same entity\n multiple times. Additionally, when a ChangeSet is running, all the entities\n targeted by the different changes are locked until the change set has completed (either\n succeeded, cancelled, or failed). If you try to start a change set containing a change\n against an entity that is already locked, you will receive a\n ResourceInUseException error.

\n

For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same\n change type (AddRevisions) against the same entity\n (entity-id@1).

\n

For more information about working with change sets, see Working with change sets. For information about change types for\n single-AMI products, see Working with single-AMI products. Also, for more information about change\n types available for container-based products, see Working with container products.

", "smithy.api#http": { "method": "POST", "uri": "/StartChangeSet", @@ -2510,4 +2533,4 @@ } } } -} \ No newline at end of file +}