Skip to content

Commit

Permalink
feat(client-marketplace-catalog): AWS Marketplace now supports a new …
Browse files Browse the repository at this point in the history
…API, BatchDescribeEntities, which returns metadata and content for multiple entities.
  • Loading branch information
awstools committed Dec 19, 2023
1 parent 0d9d3e8 commit d96b606
Show file tree
Hide file tree
Showing 8 changed files with 693 additions and 46 deletions.
8 changes: 8 additions & 0 deletions clients/client-marketplace-catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ see LICENSE for more information.

## Client Commands (Operations List)

<details>
<summary>
BatchDescribeEntities
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/marketplace-catalog/command/BatchDescribeEntitiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-marketplace-catalog/Interface/BatchDescribeEntitiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-marketplace-catalog/Interface/BatchDescribeEntitiesCommandOutput/)

</details>
<details>
<summary>
CancelChangeSet
Expand Down
23 changes: 23 additions & 0 deletions clients/client-marketplace-catalog/src/MarketplaceCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
BatchDescribeEntitiesCommand,
BatchDescribeEntitiesCommandInput,
BatchDescribeEntitiesCommandOutput,
} from "./commands/BatchDescribeEntitiesCommand";
import {
CancelChangeSetCommand,
CancelChangeSetCommandInput,
Expand Down Expand Up @@ -61,6 +66,7 @@ import {
import { MarketplaceCatalogClient, MarketplaceCatalogClientConfig } from "./MarketplaceCatalogClient";

const commands = {
BatchDescribeEntitiesCommand,
CancelChangeSetCommand,
DeleteResourcePolicyCommand,
DescribeChangeSetCommand,
Expand All @@ -76,6 +82,23 @@ const commands = {
};

export interface MarketplaceCatalog {
/**
* @see {@link BatchDescribeEntitiesCommand}
*/
batchDescribeEntities(
args: BatchDescribeEntitiesCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchDescribeEntitiesCommandOutput>;
batchDescribeEntities(
args: BatchDescribeEntitiesCommandInput,
cb: (err: any, data?: BatchDescribeEntitiesCommandOutput) => void
): void;
batchDescribeEntities(
args: BatchDescribeEntitiesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchDescribeEntitiesCommandOutput) => void
): void;

/**
* @see {@link CancelChangeSetCommand}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ import {
UserAgent as __UserAgent,
} from "@smithy/types";

import {
BatchDescribeEntitiesCommandInput,
BatchDescribeEntitiesCommandOutput,
} from "./commands/BatchDescribeEntitiesCommand";
import { CancelChangeSetCommandInput, CancelChangeSetCommandOutput } from "./commands/CancelChangeSetCommand";
import {
DeleteResourcePolicyCommandInput,
Expand Down Expand Up @@ -81,6 +85,7 @@ export { __Client };
* @public
*/
export type ServiceInputTypes =
| BatchDescribeEntitiesCommandInput
| CancelChangeSetCommandInput
| DeleteResourcePolicyCommandInput
| DescribeChangeSetCommandInput
Expand All @@ -98,6 +103,7 @@ export type ServiceInputTypes =
* @public
*/
export type ServiceOutputTypes =
| BatchDescribeEntitiesCommandOutput
| CancelChangeSetCommandOutput
| DeleteResourcePolicyCommandOutput
| DescribeChangeSetCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import {
MarketplaceCatalogClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../MarketplaceCatalogClient";
import { BatchDescribeEntitiesRequest, BatchDescribeEntitiesResponse } from "../models/models_0";
import { de_BatchDescribeEntitiesCommand, se_BatchDescribeEntitiesCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link BatchDescribeEntitiesCommand}.
*/
export interface BatchDescribeEntitiesCommandInput extends BatchDescribeEntitiesRequest {}
/**
* @public
*
* The output of {@link BatchDescribeEntitiesCommand}.
*/
export interface BatchDescribeEntitiesCommandOutput extends BatchDescribeEntitiesResponse, __MetadataBearer {}

/**
* @public
* <p>Returns metadata and content for multiple entities.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { MarketplaceCatalogClient, BatchDescribeEntitiesCommand } from "@aws-sdk/client-marketplace-catalog"; // ES Modules import
* // const { MarketplaceCatalogClient, BatchDescribeEntitiesCommand } = require("@aws-sdk/client-marketplace-catalog"); // CommonJS import
* const client = new MarketplaceCatalogClient(config);
* const input = { // BatchDescribeEntitiesRequest
* EntityRequestList: [ // EntityRequestList // required
* { // EntityRequest
* Catalog: "STRING_VALUE", // required
* EntityId: "STRING_VALUE", // required
* },
* ],
* };
* const command = new BatchDescribeEntitiesCommand(input);
* const response = await client.send(command);
* // { // BatchDescribeEntitiesResponse
* // EntityDetails: { // EntityDetails
* // "<keys>": { // EntityDetail
* // EntityType: "STRING_VALUE",
* // EntityArn: "STRING_VALUE",
* // EntityIdentifier: "STRING_VALUE",
* // LastModifiedDate: "STRING_VALUE",
* // DetailsDocument: "DOCUMENT_VALUE",
* // },
* // },
* // Errors: { // Errors
* // "<keys>": { // BatchDescribeErrorDetail
* // ErrorCode: "STRING_VALUE",
* // ErrorMessage: "STRING_VALUE",
* // },
* // },
* // };
*
* ```
*
* @param BatchDescribeEntitiesCommandInput - {@link BatchDescribeEntitiesCommandInput}
* @returns {@link BatchDescribeEntitiesCommandOutput}
* @see {@link BatchDescribeEntitiesCommandInput} for command's `input` shape.
* @see {@link BatchDescribeEntitiesCommandOutput} for command's `response` shape.
* @see {@link MarketplaceCatalogClientResolvedConfig | config} for MarketplaceCatalogClient's `config` shape.
*
* @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 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>
*
* @throws {@link MarketplaceCatalogServiceException}
* <p>Base exception class for all service exceptions from MarketplaceCatalog service.</p>
*
*/
export class BatchDescribeEntitiesCommand extends $Command<
BatchDescribeEntitiesCommandInput,
BatchDescribeEntitiesCommandOutput,
MarketplaceCatalogClientResolvedConfig
> {
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: BatchDescribeEntitiesCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: MarketplaceCatalogClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<BatchDescribeEntitiesCommandInput, BatchDescribeEntitiesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, BatchDescribeEntitiesCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "MarketplaceCatalogClient";
const commandName = "BatchDescribeEntitiesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AWSMPSeymour",
operation: "BatchDescribeEntities",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: BatchDescribeEntitiesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_BatchDescribeEntitiesCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<BatchDescribeEntitiesCommandOutput> {
return de_BatchDescribeEntitiesCommand(output, context);
}
}
1 change: 1 addition & 0 deletions clients/client-marketplace-catalog/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
export * from "./BatchDescribeEntitiesCommand";
export * from "./CancelChangeSetCommand";
export * from "./DeleteResourcePolicyCommand";
export * from "./DescribeChangeSetCommand";
Expand Down
Loading

0 comments on commit d96b606

Please sign in to comment.