Skip to content

Commit

Permalink
feat(client-marketplace-catalog): Added three new APIs to support res…
Browse files Browse the repository at this point in the history
…ource sharing: GetResourcePolicy, PutResourcePolicy, and DeleteResourcePolicy. Added new OwnershipType field to ListEntities request to let users filter on entities that are shared with them. Increased max page size of ListEntities response from 20 to 50 results.
  • Loading branch information
awstools committed Apr 10, 2023
1 parent 352393d commit d860c2f
Show file tree
Hide file tree
Showing 20 changed files with 1,784 additions and 277 deletions.
24 changes: 24 additions & 0 deletions clients/client-marketplace-catalog/README.md
Expand Up @@ -218,6 +218,14 @@ CancelChangeSet

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/classes/cancelchangesetcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/cancelchangesetcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/cancelchangesetcommandoutput.html)

</details>
<details>
<summary>
DeleteResourcePolicy
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/classes/deleteresourcepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/deleteresourcepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/deleteresourcepolicycommandoutput.html)

</details>
<details>
<summary>
Expand All @@ -234,6 +242,14 @@ DescribeEntity

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/classes/describeentitycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/describeentitycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/describeentitycommandoutput.html)

</details>
<details>
<summary>
GetResourcePolicy
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/classes/getresourcepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/getresourcepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/getresourcepolicycommandoutput.html)

</details>
<details>
<summary>
Expand All @@ -258,6 +274,14 @@ ListTagsForResource

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/classes/listtagsforresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/listtagsforresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/listtagsforresourcecommandoutput.html)

</details>
<details>
<summary>
PutResourcePolicy
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/classes/putresourcepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/putresourcepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-marketplace-catalog/interfaces/putresourcepolicycommandoutput.html)

</details>
<details>
<summary>
Expand Down
127 changes: 123 additions & 4 deletions clients/client-marketplace-catalog/src/MarketplaceCatalog.ts
Expand Up @@ -6,6 +6,11 @@ import {
CancelChangeSetCommandInput,
CancelChangeSetCommandOutput,
} from "./commands/CancelChangeSetCommand";
import {
DeleteResourcePolicyCommand,
DeleteResourcePolicyCommandInput,
DeleteResourcePolicyCommandOutput,
} from "./commands/DeleteResourcePolicyCommand";
import {
DescribeChangeSetCommand,
DescribeChangeSetCommandInput,
Expand All @@ -16,6 +21,11 @@ import {
DescribeEntityCommandInput,
DescribeEntityCommandOutput,
} from "./commands/DescribeEntityCommand";
import {
GetResourcePolicyCommand,
GetResourcePolicyCommandInput,
GetResourcePolicyCommandOutput,
} from "./commands/GetResourcePolicyCommand";
import {
ListChangeSetsCommand,
ListChangeSetsCommandInput,
Expand All @@ -31,6 +41,11 @@ import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import {
PutResourcePolicyCommand,
PutResourcePolicyCommandInput,
PutResourcePolicyCommandOutput,
} from "./commands/PutResourcePolicyCommand";
import {
StartChangeSetCommand,
StartChangeSetCommandInput,
Expand All @@ -48,7 +63,7 @@ import { MarketplaceCatalogClient } from "./MarketplaceCatalogClient";
* @public
* <p>Catalog API actions allow you to manage your entities through list, describe, and
* update capabilities. An entity can be a product or an offer on AWS Marketplace. </p>
* <p>You can automate your entity update process by integrating the AWS Marketplace Catalog
* <p>You can automate your entity update process by integrating the AWS Marketplace Catalog
* API with your AWS Marketplace product build or deployment pipelines. You can also create
* your own applications on top of the Catalog API to manage your products on AWS
* Marketplace.</p>
Expand Down Expand Up @@ -90,6 +105,40 @@ export class MarketplaceCatalog extends MarketplaceCatalogClient {
}
}

/**
* @public
* <p>Deletes a resource-based policy on an Entity that is identified by its resource
* ARN.</p>
*/
public deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteResourcePolicyCommandOutput>;
public deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
): void;
public deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
): void;
public deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteResourcePolicyCommandOutput) => void),
cb?: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
): Promise<DeleteResourcePolicyCommandOutput> | void {
const command = new DeleteResourcePolicyCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* @public
* <p>Provides information about a given change set.</p>
Expand Down Expand Up @@ -156,13 +205,47 @@ export class MarketplaceCatalog extends MarketplaceCatalogClient {
}
}

/**
* @public
* <p>Gets a resource-based policy of an Entity that is identified by its resource
* ARN.</p>
*/
public getResourcePolicy(
args: GetResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<GetResourcePolicyCommandOutput>;
public getResourcePolicy(
args: GetResourcePolicyCommandInput,
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
): void;
public getResourcePolicy(
args: GetResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
): void;
public getResourcePolicy(
args: GetResourcePolicyCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetResourcePolicyCommandOutput) => void),
cb?: (err: any, data?: GetResourcePolicyCommandOutput) => void
): Promise<GetResourcePolicyCommandOutput> | void {
const command = new GetResourcePolicyCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* @public
* <p>Returns the list of change sets owned by the account being used to make the call. You
* can filter this list by providing any combination of <code>entityId</code>,
* <code>ChangeSetName</code>, and status. If you provide more than one filter, the API
* operation applies a logical AND between the filters.</p>
* <p>You can describe a change during the 60-day request history retention period for API
* <p>You can describe a change during the 60-day request history retention period for API
* calls.</p>
*/
public listChangeSets(
Expand Down Expand Up @@ -257,6 +340,40 @@ export class MarketplaceCatalog extends MarketplaceCatalogClient {
}
}

/**
* @public
* <p>Attaches a resource-based policy to an Entity. Examples of an entity include:
* <code>AmiProduct</code> and <code>ContainerProduct</code>.</p>
*/
public putResourcePolicy(
args: PutResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<PutResourcePolicyCommandOutput>;
public putResourcePolicy(
args: PutResourcePolicyCommandInput,
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
): void;
public putResourcePolicy(
args: PutResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
): void;
public putResourcePolicy(
args: PutResourcePolicyCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutResourcePolicyCommandOutput) => void),
cb?: (err: any, data?: PutResourcePolicyCommandOutput) => void
): Promise<PutResourcePolicyCommandOutput> | void {
const command = new PutResourcePolicyCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* @public
* <p>Allows you to request changes for your entities. Within a single
Expand All @@ -266,10 +383,12 @@ export class MarketplaceCatalog extends MarketplaceCatalogClient {
* succeeded, cancelled, or failed). If you try to start a change set containing a change
* against an entity that is already locked, you will receive a
* <code>ResourceInUseException</code> error.</p>
* <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
* <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
* change type (<code>AddRevisions</code>) against the same entity
* (<code>entity-id@1</code>).</p>
* <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>.</p>
* <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
* 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
* 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>
*/
public startChangeSet(
args: StartChangeSetCommandInput,
Expand Down
Expand Up @@ -50,14 +50,20 @@ import {
} from "@aws-sdk/types";

import { CancelChangeSetCommandInput, CancelChangeSetCommandOutput } from "./commands/CancelChangeSetCommand";
import {
DeleteResourcePolicyCommandInput,
DeleteResourcePolicyCommandOutput,
} from "./commands/DeleteResourcePolicyCommand";
import { DescribeChangeSetCommandInput, DescribeChangeSetCommandOutput } from "./commands/DescribeChangeSetCommand";
import { DescribeEntityCommandInput, DescribeEntityCommandOutput } from "./commands/DescribeEntityCommand";
import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand";
import { ListChangeSetsCommandInput, ListChangeSetsCommandOutput } from "./commands/ListChangeSetsCommand";
import { ListEntitiesCommandInput, ListEntitiesCommandOutput } from "./commands/ListEntitiesCommand";
import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
import { StartChangeSetCommandInput, StartChangeSetCommandOutput } from "./commands/StartChangeSetCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
Expand All @@ -74,11 +80,14 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
*/
export type ServiceInputTypes =
| CancelChangeSetCommandInput
| DeleteResourcePolicyCommandInput
| DescribeChangeSetCommandInput
| DescribeEntityCommandInput
| GetResourcePolicyCommandInput
| ListChangeSetsCommandInput
| ListEntitiesCommandInput
| ListTagsForResourceCommandInput
| PutResourcePolicyCommandInput
| StartChangeSetCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput;
Expand All @@ -88,11 +97,14 @@ export type ServiceInputTypes =
*/
export type ServiceOutputTypes =
| CancelChangeSetCommandOutput
| DeleteResourcePolicyCommandOutput
| DescribeChangeSetCommandOutput
| DescribeEntityCommandOutput
| GetResourcePolicyCommandOutput
| ListChangeSetsCommandOutput
| ListEntitiesCommandOutput
| ListTagsForResourceCommandOutput
| PutResourcePolicyCommandOutput
| StartChangeSetCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput;
Expand Down Expand Up @@ -263,7 +275,7 @@ export interface MarketplaceCatalogClientResolvedConfig extends MarketplaceCatal
* @public
* <p>Catalog API actions allow you to manage your entities through list, describe, and
* update capabilities. An entity can be a product or an offer on AWS Marketplace. </p>
* <p>You can automate your entity update process by integrating the AWS Marketplace Catalog
* <p>You can automate your entity update process by integrating the AWS Marketplace Catalog
* API with your AWS Marketplace product build or deployment pipelines. You can also create
* your own applications on top of the Catalog API to manage your products on AWS
* Marketplace.</p>
Expand Down
Expand Up @@ -62,21 +62,26 @@ export interface CancelChangeSetCommandOutput extends CancelChangeSetResponse, _
*
* @throws {@link AccessDeniedException} (client fault)
* <p>Access is denied.</p>
* <p>HTTP status code: 403</p>
*
* @throws {@link InternalServiceException} (server fault)
* <p>There was an internal service exception.</p>
* <p>HTTP status code: 500</p>
*
* @throws {@link ResourceInUseException} (client fault)
* <p>The resource is currently in use.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource wasn't found.</p>
* <p>HTTP status code: 404</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Too many requests.</p>
* <p>HTTP status code: 429</p>
*
* @throws {@link ValidationException} (client fault)
* <p>An error occurred during validation.</p>
* <p>HTTP status code: 422</p>
*
*
*/
Expand Down

0 comments on commit d860c2f

Please sign in to comment.