Skip to content

Commit

Permalink
feat(client-supplychain): This release adds AWS Supply Chain instance…
Browse files Browse the repository at this point in the history
… management functionality. Specifically adding CreateInstance, DeleteInstance, GetInstance, ListInstances, and UpdateInstance APIs.
  • Loading branch information
awstools committed Oct 14, 2024
1 parent 1f6506b commit 4d99777
Show file tree
Hide file tree
Showing 14 changed files with 2,302 additions and 99 deletions.
54 changes: 47 additions & 7 deletions clients/client-supplychain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ using your favorite package manager:

The AWS SDK is modulized by clients and commands.
To send a request, you only need to import the `SupplyChainClient` and
the commands you need, for example `ListTagsForResourceCommand`:
the commands you need, for example `ListInstancesCommand`:

```js
// ES5 example
const { SupplyChainClient, ListTagsForResourceCommand } = require("@aws-sdk/client-supplychain");
const { SupplyChainClient, ListInstancesCommand } = require("@aws-sdk/client-supplychain");
```

```ts
// ES6+ example
import { SupplyChainClient, ListTagsForResourceCommand } from "@aws-sdk/client-supplychain";
import { SupplyChainClient, ListInstancesCommand } from "@aws-sdk/client-supplychain";
```

### Usage
Expand All @@ -57,7 +57,7 @@ const client = new SupplyChainClient({ region: "REGION" });
const params = {
/** input parameters */
};
const command = new ListTagsForResourceCommand(params);
const command = new ListInstancesCommand(params);
```

#### Async/await
Expand Down Expand Up @@ -136,15 +136,15 @@ const client = new AWS.SupplyChain({ region: "REGION" });

// async/await.
try {
const data = await client.listTagsForResource(params);
const data = await client.listInstances(params);
// process data.
} catch (error) {
// error handling.
}

// Promises.
client
.listTagsForResource(params)
.listInstances(params)
.then((data) => {
// process data.
})
Expand All @@ -153,7 +153,7 @@ client
});

// callbacks.
client.listTagsForResource(params, (err, data) => {
client.listInstances(params, (err, data) => {
// process err and data.
});
```
Expand Down Expand Up @@ -232,6 +232,14 @@ CreateDataLakeDataset

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/CreateDataLakeDatasetCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/CreateDataLakeDatasetCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/CreateDataLakeDatasetCommandOutput/)

</details>
<details>
<summary>
CreateInstance
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/CreateInstanceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/CreateInstanceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/CreateInstanceCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -248,6 +256,14 @@ DeleteDataLakeDataset

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/DeleteDataLakeDatasetCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/DeleteDataLakeDatasetCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/DeleteDataLakeDatasetCommandOutput/)

</details>
<details>
<summary>
DeleteInstance
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/DeleteInstanceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/DeleteInstanceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/DeleteInstanceCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -272,6 +288,14 @@ GetDataLakeDataset

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/GetDataLakeDatasetCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/GetDataLakeDatasetCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/GetDataLakeDatasetCommandOutput/)

</details>
<details>
<summary>
GetInstance
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/GetInstanceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/GetInstanceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/GetInstanceCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -288,6 +312,14 @@ ListDataLakeDatasets

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/ListDataLakeDatasetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/ListDataLakeDatasetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/ListDataLakeDatasetsCommandOutput/)

</details>
<details>
<summary>
ListInstances
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/ListInstancesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/ListInstancesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/ListInstancesCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -337,3 +369,11 @@ UpdateDataLakeDataset
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/UpdateDataLakeDatasetCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/UpdateDataLakeDatasetCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/UpdateDataLakeDatasetCommandOutput/)

</details>
<details>
<summary>
UpdateInstance
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/UpdateInstanceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/UpdateInstanceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/UpdateInstanceCommandOutput/)

</details>
92 changes: 92 additions & 0 deletions clients/client-supplychain/src/SupplyChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import {
CreateDataLakeDatasetCommandInput,
CreateDataLakeDatasetCommandOutput,
} from "./commands/CreateDataLakeDatasetCommand";
import {
CreateInstanceCommand,
CreateInstanceCommandInput,
CreateInstanceCommandOutput,
} from "./commands/CreateInstanceCommand";
import {
DeleteDataIntegrationFlowCommand,
DeleteDataIntegrationFlowCommandInput,
Expand All @@ -27,6 +32,11 @@ import {
DeleteDataLakeDatasetCommandInput,
DeleteDataLakeDatasetCommandOutput,
} from "./commands/DeleteDataLakeDatasetCommand";
import {
DeleteInstanceCommand,
DeleteInstanceCommandInput,
DeleteInstanceCommandOutput,
} from "./commands/DeleteInstanceCommand";
import {
GetBillOfMaterialsImportJobCommand,
GetBillOfMaterialsImportJobCommandInput,
Expand All @@ -42,6 +52,7 @@ import {
GetDataLakeDatasetCommandInput,
GetDataLakeDatasetCommandOutput,
} from "./commands/GetDataLakeDatasetCommand";
import { GetInstanceCommand, GetInstanceCommandInput, GetInstanceCommandOutput } from "./commands/GetInstanceCommand";
import {
ListDataIntegrationFlowsCommand,
ListDataIntegrationFlowsCommandInput,
Expand All @@ -52,6 +63,11 @@ import {
ListDataLakeDatasetsCommandInput,
ListDataLakeDatasetsCommandOutput,
} from "./commands/ListDataLakeDatasetsCommand";
import {
ListInstancesCommand,
ListInstancesCommandInput,
ListInstancesCommandOutput,
} from "./commands/ListInstancesCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
Expand All @@ -78,25 +94,35 @@ import {
UpdateDataLakeDatasetCommandInput,
UpdateDataLakeDatasetCommandOutput,
} from "./commands/UpdateDataLakeDatasetCommand";
import {
UpdateInstanceCommand,
UpdateInstanceCommandInput,
UpdateInstanceCommandOutput,
} from "./commands/UpdateInstanceCommand";
import { SupplyChainClient, SupplyChainClientConfig } from "./SupplyChainClient";

const commands = {
CreateBillOfMaterialsImportJobCommand,
CreateDataIntegrationFlowCommand,
CreateDataLakeDatasetCommand,
CreateInstanceCommand,
DeleteDataIntegrationFlowCommand,
DeleteDataLakeDatasetCommand,
DeleteInstanceCommand,
GetBillOfMaterialsImportJobCommand,
GetDataIntegrationFlowCommand,
GetDataLakeDatasetCommand,
GetInstanceCommand,
ListDataIntegrationFlowsCommand,
ListDataLakeDatasetsCommand,
ListInstancesCommand,
ListTagsForResourceCommand,
SendDataIntegrationEventCommand,
TagResourceCommand,
UntagResourceCommand,
UpdateDataIntegrationFlowCommand,
UpdateDataLakeDatasetCommand,
UpdateInstanceCommand,
};

export interface SupplyChain {
Expand Down Expand Up @@ -151,6 +177,21 @@ export interface SupplyChain {
cb: (err: any, data?: CreateDataLakeDatasetCommandOutput) => void
): void;

/**
* @see {@link CreateInstanceCommand}
*/
createInstance(): Promise<CreateInstanceCommandOutput>;
createInstance(
args: CreateInstanceCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateInstanceCommandOutput>;
createInstance(args: CreateInstanceCommandInput, cb: (err: any, data?: CreateInstanceCommandOutput) => void): void;
createInstance(
args: CreateInstanceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateInstanceCommandOutput) => void
): void;

/**
* @see {@link DeleteDataIntegrationFlowCommand}
*/
Expand Down Expand Up @@ -185,6 +226,20 @@ export interface SupplyChain {
cb: (err: any, data?: DeleteDataLakeDatasetCommandOutput) => void
): void;

/**
* @see {@link DeleteInstanceCommand}
*/
deleteInstance(
args: DeleteInstanceCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteInstanceCommandOutput>;
deleteInstance(args: DeleteInstanceCommandInput, cb: (err: any, data?: DeleteInstanceCommandOutput) => void): void;
deleteInstance(
args: DeleteInstanceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteInstanceCommandOutput) => void
): void;

/**
* @see {@link GetBillOfMaterialsImportJobCommand}
*/
Expand Down Expand Up @@ -236,6 +291,17 @@ export interface SupplyChain {
cb: (err: any, data?: GetDataLakeDatasetCommandOutput) => void
): void;

/**
* @see {@link GetInstanceCommand}
*/
getInstance(args: GetInstanceCommandInput, options?: __HttpHandlerOptions): Promise<GetInstanceCommandOutput>;
getInstance(args: GetInstanceCommandInput, cb: (err: any, data?: GetInstanceCommandOutput) => void): void;
getInstance(
args: GetInstanceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetInstanceCommandOutput) => void
): void;

/**
* @see {@link ListDataIntegrationFlowsCommand}
*/
Expand Down Expand Up @@ -270,6 +336,18 @@ export interface SupplyChain {
cb: (err: any, data?: ListDataLakeDatasetsCommandOutput) => void
): void;

/**
* @see {@link ListInstancesCommand}
*/
listInstances(): Promise<ListInstancesCommandOutput>;
listInstances(args: ListInstancesCommandInput, options?: __HttpHandlerOptions): Promise<ListInstancesCommandOutput>;
listInstances(args: ListInstancesCommandInput, cb: (err: any, data?: ListInstancesCommandOutput) => void): void;
listInstances(
args: ListInstancesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListInstancesCommandOutput) => void
): void;

/**
* @see {@link ListTagsForResourceCommand}
*/
Expand Down Expand Up @@ -359,6 +437,20 @@ export interface SupplyChain {
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateDataLakeDatasetCommandOutput) => void
): void;

/**
* @see {@link UpdateInstanceCommand}
*/
updateInstance(
args: UpdateInstanceCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateInstanceCommandOutput>;
updateInstance(args: UpdateInstanceCommandInput, cb: (err: any, data?: UpdateInstanceCommandOutput) => void): void;
updateInstance(
args: UpdateInstanceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateInstanceCommandOutput) => void
): void;
}

/**
Expand Down
Loading

0 comments on commit 4d99777

Please sign in to comment.