Skip to content

Commit b689c24

Browse files
author
awstools
committed
feat(client-marketplace-catalog): This release adds support for Document type as an alternative for stringified JSON for StartChangeSet, DescribeChangeSet and DescribeEntity APIs
1 parent 55995ec commit b689c24

File tree

9 files changed

+152
-37
lines changed

9 files changed

+152
-37
lines changed

clients/client-marketplace-catalog/src/commands/DeleteResourcePolicyCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface DeleteResourcePolicyCommandOutput extends DeleteResourcePolicyR
4141

4242
/**
4343
* @public
44-
* <p>Deletes a resource-based policy on an Entity that is identified by its resource
44+
* <p>Deletes a resource-based policy on an entity that is identified by its resource
4545
* ARN.</p>
4646
* @example
4747
* Use a bare-bones client and the command you need to make an API call.

clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetRespons
7171
* // Identifier: "STRING_VALUE",
7272
* // },
7373
* // Details: "STRING_VALUE",
74+
* // DetailsDocument: "DOCUMENT_VALUE",
7475
* // ErrorDetailList: [ // ErrorDetailList
7576
* // { // ErrorDetail
7677
* // ErrorCode: "STRING_VALUE",

clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export interface DescribeEntityCommandOutput extends DescribeEntityResponse, __M
6060
* // EntityArn: "STRING_VALUE",
6161
* // LastModifiedDate: "STRING_VALUE",
6262
* // Details: "STRING_VALUE",
63+
* // DetailsDocument: "DOCUMENT_VALUE",
6364
* // };
6465
*
6566
* ```

clients/client-marketplace-catalog/src/commands/GetResourcePolicyCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface GetResourcePolicyCommandOutput extends GetResourcePolicyRespons
4141

4242
/**
4343
* @public
44-
* <p>Gets a resource-based policy of an Entity that is identified by its resource
44+
* <p>Gets a resource-based policy of an entity that is identified by its resource
4545
* ARN.</p>
4646
* @example
4747
* Use a bare-bones client and the command you need to make an API call.

clients/client-marketplace-catalog/src/commands/PutResourcePolicyCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface PutResourcePolicyCommandOutput extends PutResourcePolicyRespons
4141

4242
/**
4343
* @public
44-
* <p>Attaches a resource-based policy to an Entity. Examples of an entity include:
44+
* <p>Attaches a resource-based policy to an entity. Examples of an entity include:
4545
* <code>AmiProduct</code> and <code>ContainerProduct</code>.</p>
4646
* @example
4747
* Use a bare-bones client and the command you need to make an API call.

clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ export interface StartChangeSetCommandOutput extends StartChangeSetResponse, __M
5151
* <p>For example, you can't start the <code>ChangeSet</code> described in the <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/API_StartChangeSet.html#API_StartChangeSet_Examples">example</a> later in this topic because it contains two changes to run the same
5252
* change type (<code>AddRevisions</code>) against the same entity
5353
* (<code>entity-id@1</code>).</p>
54-
* <p>For more information about working with change sets, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets"> Working with change sets</a>. For information on change types for single-AMI
55-
* products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products">Working with single-AMI products</a>. Als, for more information on change types
56-
* available for container-based products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products">Working with container products</a>.</p>
54+
* <p>For more information about working with change sets, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets"> Working with change sets</a>. For information about change types for
55+
* single-AMI products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products">Working with single-AMI products</a>. Also, for more information about change
56+
* types available for container-based products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products">Working with container products</a>.</p>
5757
* @example
5858
* Use a bare-bones client and the command you need to make an API call.
5959
* ```javascript
@@ -75,7 +75,8 @@ export interface StartChangeSetCommandOutput extends StartChangeSetResponse, __M
7575
* Value: "STRING_VALUE", // required
7676
* },
7777
* ],
78-
* Details: "STRING_VALUE", // required
78+
* Details: "STRING_VALUE",
79+
* DetailsDocument: "DOCUMENT_VALUE",
7980
* ChangeName: "STRING_VALUE",
8081
* },
8182
* ],

clients/client-marketplace-catalog/src/models/models_0.ts

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// smithy-typescript generated code
22
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
3+
import { DocumentType as __DocumentType } from "@smithy/types";
34

45
import { MarketplaceCatalogServiceException as __BaseException } from "./MarketplaceCatalogServiceException";
56

@@ -182,7 +183,7 @@ export class ValidationException extends __BaseException {
182183
export interface DeleteResourcePolicyRequest {
183184
/**
184185
* @public
185-
* <p>The Amazon Resource Name (ARN) of the Entity resource that is associated with the
186+
* <p>The Amazon Resource Name (ARN) of the entity resource that is associated with the
186187
* resource policy.</p>
187188
*/
188189
ResourceArn: string | undefined;
@@ -275,6 +276,12 @@ export interface ChangeSummary {
275276
*/
276277
Details?: string;
277278

279+
/**
280+
* @public
281+
* <p>The JSON value of the details specific to the change type of the requested change.</p>
282+
*/
283+
DetailsDocument?: __DocumentType;
284+
278285
/**
279286
* @public
280287
* <p>An array of <code>ErrorDetail</code> objects associated with the change.</p>
@@ -442,6 +449,12 @@ export interface DescribeEntityResponse {
442449
* <p>This stringified JSON object includes the details of the entity.</p>
443450
*/
444451
Details?: string;
452+
453+
/**
454+
* @public
455+
* <p>The JSON value of the details specific to the entity.</p>
456+
*/
457+
DetailsDocument?: __DocumentType;
445458
}
446459

447460
/**
@@ -472,7 +485,7 @@ export class ResourceNotSupportedException extends __BaseException {
472485
export interface GetResourcePolicyRequest {
473486
/**
474487
* @public
475-
* <p>The Amazon Resource Name (ARN) of the Entity resource that is associated with the
488+
* <p>The Amazon Resource Name (ARN) of the entity resource that is associated with the
476489
* resource policy.</p>
477490
*/
478491
ResourceArn: string | undefined;
@@ -575,8 +588,9 @@ export interface Sort {
575588
/**
576589
* @public
577590
* <p>For <code>ListEntities</code>, supported attributes include
578-
* <code>LastModifiedDate</code> (default), <code>Visibility</code>,
579-
* <code>EntityId</code>, and <code>Name</code>.</p>
591+
* <code>LastModifiedDate</code> (default) and <code>EntityId</code>. In addition to
592+
* <code>LastModifiedDate</code> and <code>EntityId</code>, each
593+
* <code>EntityType</code> might support additional fields.</p>
580594
* <p>For <code>ListChangeSets</code>, supported attributes include <code>StartTime</code>
581595
* and <code>EndTime</code>.</p>
582596
*/
@@ -768,6 +782,14 @@ export interface ListEntitiesRequest {
768782
*/
769783
MaxResults?: number;
770784

785+
/**
786+
* @public
787+
* <p>Filters the returned set of entities based on their owner. The default is
788+
* <code>SELF</code>. To list entities shared with you
789+
* through AWS Resource Access Manager (AWS RAM), set to <code>SHARED</code>. Entities shared through the AWS Marketplace
790+
* Catalog API <code>PutResourcePolicy</code> operation can't be discovered through the
791+
* <code>SHARED</code> parameter.</p>
792+
*/
771793
OwnershipType?: OwnershipType | string;
772794
}
773795

@@ -890,8 +912,8 @@ export interface ListTagsForResourceResponse {
890912
export interface PutResourcePolicyRequest {
891913
/**
892914
* @public
893-
* <p>The Amazon Resource Name (ARN) of the Entity resource you want to associate with a
894-
* resource policy. </p>
915+
* <p>The Amazon Resource Name (ARN) of the entity resource you want to associate with a
916+
* resource policy.</p>
895917
*/
896918
ResourceArn: string | undefined;
897919

@@ -940,7 +962,7 @@ export interface Change {
940962
* <p>Change types are single string values that describe your intention for the change.
941963
* Each change type is unique for each <code>EntityType</code> provided in the change's
942964
* scope. For more information on change types available for single-AMI products, see
943-
* <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products">Working with single-AMI products</a>. Also, for more information on change
965+
* <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products">Working with single-AMI products</a>. Also, for more information about change
944966
* types available for container-based products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products">Working with container products</a>.</p>
945967
*/
946968
ChangeType: string | undefined;
@@ -959,12 +981,19 @@ export interface Change {
959981

960982
/**
961983
* @public
962-
* <p>This object contains details specific to the change type of the requested
963-
* change. For more
964-
* information on change types available for single-AMI products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products">Working with single-AMI products</a>. Also, for more information on change
984+
* <p>This object contains details specific to the change type of the requested change. For
985+
* more information about change types available for single-AMI products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products">Working with single-AMI products</a>. Also, for more information about change
965986
* types available for container-based products, see <a href="https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products">Working with container products</a>.</p>
966987
*/
967-
Details: string | undefined;
988+
Details?: string;
989+
990+
/**
991+
* @public
992+
* <p>Alternative field that accepts a JSON value instead of a string for
993+
* <code>ChangeType</code> details. You can use either <code>Details</code> or
994+
* <code>DetailsDocument</code>, but not both.</p>
995+
*/
996+
DetailsDocument?: __DocumentType;
968997

969998
/**
970999
* @public

clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
withBaseException,
1414
} from "@smithy/smithy-client";
1515
import {
16+
DocumentType as __DocumentType,
1617
Endpoint as __Endpoint,
1718
ResponseMetadata as __ResponseMetadata,
1819
SerdeContext as __SerdeContext,
@@ -41,6 +42,7 @@ import { MarketplaceCatalogServiceException as __BaseException } from "../models
4142
import {
4243
AccessDeniedException,
4344
Change,
45+
ChangeSummary,
4446
Entity,
4547
Filter,
4648
InternalServiceException,
@@ -330,7 +332,7 @@ export const se_StartChangeSetCommand = async (
330332
body = JSON.stringify(
331333
take(input, {
332334
Catalog: [],
333-
ChangeSet: (_) => _json(_),
335+
ChangeSet: (_) => se_RequestedChangeList(_, context),
334336
ChangeSetName: [],
335337
ChangeSetTags: (_) => _json(_),
336338
ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
@@ -540,7 +542,7 @@ export const de_DescribeChangeSetCommand = async (
540542
});
541543
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
542544
const doc = take(data, {
543-
ChangeSet: _json,
545+
ChangeSet: (_) => de_ChangeSetDescription(_, context),
544546
ChangeSetArn: __expectString,
545547
ChangeSetId: __expectString,
546548
ChangeSetName: __expectString,
@@ -608,6 +610,7 @@ export const de_DescribeEntityCommand = async (
608610
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
609611
const doc = take(data, {
610612
Details: __expectString,
613+
DetailsDocument: (_) => de_JsonDocumentType(_, context),
611614
EntityArn: __expectString,
612615
EntityIdentifier: __expectString,
613616
EntityType: __expectString,
@@ -1280,15 +1283,43 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
12801283
return __decorateServiceException(exception, parsedOutput.body);
12811284
};
12821285

1283-
// se_Change omitted.
1286+
/**
1287+
* serializeAws_restJson1Change
1288+
*/
1289+
const se_Change = (input: Change, context: __SerdeContext): any => {
1290+
return take(input, {
1291+
ChangeName: [],
1292+
ChangeType: [],
1293+
Details: [],
1294+
DetailsDocument: (_) => se_JsonDocumentType(_, context),
1295+
Entity: _json,
1296+
EntityTags: _json,
1297+
});
1298+
};
12841299

12851300
// se_Entity omitted.
12861301

12871302
// se_Filter omitted.
12881303

12891304
// se_FilterList omitted.
12901305

1291-
// se_RequestedChangeList omitted.
1306+
/**
1307+
* serializeAws_restJson1JsonDocumentType
1308+
*/
1309+
const se_JsonDocumentType = (input: __DocumentType, context: __SerdeContext): any => {
1310+
return input;
1311+
};
1312+
1313+
/**
1314+
* serializeAws_restJson1RequestedChangeList
1315+
*/
1316+
const se_RequestedChangeList = (input: Change[], context: __SerdeContext): any => {
1317+
return input
1318+
.filter((e: any) => e != null)
1319+
.map((entry) => {
1320+
return se_Change(entry, context);
1321+
});
1322+
};
12921323

12931324
// se_Sort omitted.
12941325

@@ -1300,13 +1331,35 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
13001331

13011332
// se_ValueList omitted.
13021333

1303-
// de_ChangeSetDescription omitted.
1334+
/**
1335+
* deserializeAws_restJson1ChangeSetDescription
1336+
*/
1337+
const de_ChangeSetDescription = (output: any, context: __SerdeContext): ChangeSummary[] => {
1338+
const retVal = (output || [])
1339+
.filter((e: any) => e != null)
1340+
.map((entry: any) => {
1341+
return de_ChangeSummary(entry, context);
1342+
});
1343+
return retVal;
1344+
};
13041345

13051346
// de_ChangeSetSummaryList omitted.
13061347

13071348
// de_ChangeSetSummaryListItem omitted.
13081349

1309-
// de_ChangeSummary omitted.
1350+
/**
1351+
* deserializeAws_restJson1ChangeSummary
1352+
*/
1353+
const de_ChangeSummary = (output: any, context: __SerdeContext): ChangeSummary => {
1354+
return take(output, {
1355+
ChangeName: __expectString,
1356+
ChangeType: __expectString,
1357+
Details: __expectString,
1358+
DetailsDocument: (_: any) => de_JsonDocumentType(_, context),
1359+
Entity: _json,
1360+
ErrorDetailList: _json,
1361+
}) as any;
1362+
};
13101363

13111364
// de_Entity omitted.
13121365

@@ -1318,6 +1371,13 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
13181371

13191372
// de_ErrorDetailList omitted.
13201373

1374+
/**
1375+
* deserializeAws_restJson1JsonDocumentType
1376+
*/
1377+
const de_JsonDocumentType = (output: any, context: __SerdeContext): __DocumentType => {
1378+
return output;
1379+
};
1380+
13211381
// de_ResourceIdList omitted.
13221382

13231383
// de_Tag omitted.

0 commit comments

Comments
 (0)