Skip to content

Commit

Permalink
feat(client-qapps): Introduces category apis in AmazonQApps. Web expe…
Browse files Browse the repository at this point in the history
…rience users use Categories to tag and filter library items.
  • Loading branch information
awstools committed Nov 6, 2024
1 parent 6860b35 commit 9e3e6fb
Show file tree
Hide file tree
Showing 15 changed files with 1,518 additions and 24 deletions.
32 changes: 32 additions & 0 deletions clients/client-qapps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,30 @@ AssociateQAppWithUser

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qapps/command/AssociateQAppWithUserCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/AssociateQAppWithUserCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/AssociateQAppWithUserCommandOutput/)

</details>
<details>
<summary>
BatchCreateCategory
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qapps/command/BatchCreateCategoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/BatchCreateCategoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/BatchCreateCategoryCommandOutput/)

</details>
<details>
<summary>
BatchDeleteCategory
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qapps/command/BatchDeleteCategoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/BatchDeleteCategoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/BatchDeleteCategoryCommandOutput/)

</details>
<details>
<summary>
BatchUpdateCategory
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qapps/command/BatchUpdateCategoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/BatchUpdateCategoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/BatchUpdateCategoryCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -311,6 +335,14 @@ ImportDocument

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qapps/command/ImportDocumentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/ImportDocumentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/ImportDocumentCommandOutput/)

</details>
<details>
<summary>
ListCategories
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qapps/command/ListCategoriesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/ListCategoriesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qapps/Interface/ListCategoriesCommandOutput/)

</details>
<details>
<summary>
Expand Down
89 changes: 89 additions & 0 deletions clients/client-qapps/src/QApps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ import {
AssociateQAppWithUserCommandInput,
AssociateQAppWithUserCommandOutput,
} from "./commands/AssociateQAppWithUserCommand";
import {
BatchCreateCategoryCommand,
BatchCreateCategoryCommandInput,
BatchCreateCategoryCommandOutput,
} from "./commands/BatchCreateCategoryCommand";
import {
BatchDeleteCategoryCommand,
BatchDeleteCategoryCommandInput,
BatchDeleteCategoryCommandOutput,
} from "./commands/BatchDeleteCategoryCommand";
import {
BatchUpdateCategoryCommand,
BatchUpdateCategoryCommandInput,
BatchUpdateCategoryCommandOutput,
} from "./commands/BatchUpdateCategoryCommand";
import {
CreateLibraryItemCommand,
CreateLibraryItemCommandInput,
Expand Down Expand Up @@ -50,6 +65,11 @@ import {
ImportDocumentCommandInput,
ImportDocumentCommandOutput,
} from "./commands/ImportDocumentCommand";
import {
ListCategoriesCommand,
ListCategoriesCommandInput,
ListCategoriesCommandOutput,
} from "./commands/ListCategoriesCommand";
import {
ListLibraryItemsCommand,
ListLibraryItemsCommandInput,
Expand Down Expand Up @@ -99,6 +119,9 @@ import { QAppsClient, QAppsClientConfig } from "./QAppsClient";
const commands = {
AssociateLibraryItemReviewCommand,
AssociateQAppWithUserCommand,
BatchCreateCategoryCommand,
BatchDeleteCategoryCommand,
BatchUpdateCategoryCommand,
CreateLibraryItemCommand,
CreateQAppCommand,
DeleteLibraryItemCommand,
Expand All @@ -109,6 +132,7 @@ const commands = {
GetQAppCommand,
GetQAppSessionCommand,
ImportDocumentCommand,
ListCategoriesCommand,
ListLibraryItemsCommand,
ListQAppsCommand,
ListTagsForResourceCommand,
Expand Down Expand Up @@ -158,6 +182,57 @@ export interface QApps {
cb: (err: any, data?: AssociateQAppWithUserCommandOutput) => void
): void;

/**
* @see {@link BatchCreateCategoryCommand}
*/
batchCreateCategory(
args: BatchCreateCategoryCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchCreateCategoryCommandOutput>;
batchCreateCategory(
args: BatchCreateCategoryCommandInput,
cb: (err: any, data?: BatchCreateCategoryCommandOutput) => void
): void;
batchCreateCategory(
args: BatchCreateCategoryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchCreateCategoryCommandOutput) => void
): void;

/**
* @see {@link BatchDeleteCategoryCommand}
*/
batchDeleteCategory(
args: BatchDeleteCategoryCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchDeleteCategoryCommandOutput>;
batchDeleteCategory(
args: BatchDeleteCategoryCommandInput,
cb: (err: any, data?: BatchDeleteCategoryCommandOutput) => void
): void;
batchDeleteCategory(
args: BatchDeleteCategoryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchDeleteCategoryCommandOutput) => void
): void;

/**
* @see {@link BatchUpdateCategoryCommand}
*/
batchUpdateCategory(
args: BatchUpdateCategoryCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchUpdateCategoryCommandOutput>;
batchUpdateCategory(
args: BatchUpdateCategoryCommandInput,
cb: (err: any, data?: BatchUpdateCategoryCommandOutput) => void
): void;
batchUpdateCategory(
args: BatchUpdateCategoryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchUpdateCategoryCommandOutput) => void
): void;

/**
* @see {@link CreateLibraryItemCommand}
*/
Expand Down Expand Up @@ -301,6 +376,20 @@ export interface QApps {
cb: (err: any, data?: ImportDocumentCommandOutput) => void
): void;

/**
* @see {@link ListCategoriesCommand}
*/
listCategories(
args: ListCategoriesCommandInput,
options?: __HttpHandlerOptions
): Promise<ListCategoriesCommandOutput>;
listCategories(args: ListCategoriesCommandInput, cb: (err: any, data?: ListCategoriesCommandOutput) => void): void;
listCategories(
args: ListCategoriesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListCategoriesCommandOutput) => void
): void;

/**
* @see {@link ListLibraryItemsCommand}
*/
Expand Down
21 changes: 21 additions & 0 deletions clients/client-qapps/src/QAppsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ import {
AssociateQAppWithUserCommandInput,
AssociateQAppWithUserCommandOutput,
} from "./commands/AssociateQAppWithUserCommand";
import {
BatchCreateCategoryCommandInput,
BatchCreateCategoryCommandOutput,
} from "./commands/BatchCreateCategoryCommand";
import {
BatchDeleteCategoryCommandInput,
BatchDeleteCategoryCommandOutput,
} from "./commands/BatchDeleteCategoryCommand";
import {
BatchUpdateCategoryCommandInput,
BatchUpdateCategoryCommandOutput,
} from "./commands/BatchUpdateCategoryCommand";
import { CreateLibraryItemCommandInput, CreateLibraryItemCommandOutput } from "./commands/CreateLibraryItemCommand";
import { CreateQAppCommandInput, CreateQAppCommandOutput } from "./commands/CreateQAppCommand";
import { DeleteLibraryItemCommandInput, DeleteLibraryItemCommandOutput } from "./commands/DeleteLibraryItemCommand";
Expand All @@ -77,6 +89,7 @@ import { GetLibraryItemCommandInput, GetLibraryItemCommandOutput } from "./comma
import { GetQAppCommandInput, GetQAppCommandOutput } from "./commands/GetQAppCommand";
import { GetQAppSessionCommandInput, GetQAppSessionCommandOutput } from "./commands/GetQAppSessionCommand";
import { ImportDocumentCommandInput, ImportDocumentCommandOutput } from "./commands/ImportDocumentCommand";
import { ListCategoriesCommandInput, ListCategoriesCommandOutput } from "./commands/ListCategoriesCommand";
import { ListLibraryItemsCommandInput, ListLibraryItemsCommandOutput } from "./commands/ListLibraryItemsCommand";
import { ListQAppsCommandInput, ListQAppsCommandOutput } from "./commands/ListQAppsCommand";
import {
Expand Down Expand Up @@ -112,6 +125,9 @@ export { __Client };
export type ServiceInputTypes =
| AssociateLibraryItemReviewCommandInput
| AssociateQAppWithUserCommandInput
| BatchCreateCategoryCommandInput
| BatchDeleteCategoryCommandInput
| BatchUpdateCategoryCommandInput
| CreateLibraryItemCommandInput
| CreateQAppCommandInput
| DeleteLibraryItemCommandInput
Expand All @@ -122,6 +138,7 @@ export type ServiceInputTypes =
| GetQAppCommandInput
| GetQAppSessionCommandInput
| ImportDocumentCommandInput
| ListCategoriesCommandInput
| ListLibraryItemsCommandInput
| ListQAppsCommandInput
| ListTagsForResourceCommandInput
Expand All @@ -141,6 +158,9 @@ export type ServiceInputTypes =
export type ServiceOutputTypes =
| AssociateLibraryItemReviewCommandOutput
| AssociateQAppWithUserCommandOutput
| BatchCreateCategoryCommandOutput
| BatchDeleteCategoryCommandOutput
| BatchUpdateCategoryCommandOutput
| CreateLibraryItemCommandOutput
| CreateQAppCommandOutput
| DeleteLibraryItemCommandOutput
Expand All @@ -151,6 +171,7 @@ export type ServiceOutputTypes =
| GetQAppCommandOutput
| GetQAppSessionCommandOutput
| ImportDocumentCommandOutput
| ListCategoriesCommandOutput
| ListLibraryItemsCommandOutput
| ListQAppsCommandOutput
| ListTagsForResourceCommandOutput
Expand Down
141 changes: 141 additions & 0 deletions clients/client-qapps/src/commands/BatchCreateCategoryCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { BatchCreateCategoryInput } from "../models/models_0";
import { de_BatchCreateCategoryCommand, se_BatchCreateCategoryCommand } from "../protocols/Aws_restJson1";
import { QAppsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QAppsClient";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link BatchCreateCategoryCommand}.
*/
export interface BatchCreateCategoryCommandInput extends BatchCreateCategoryInput {}
/**
* @public
*
* The output of {@link BatchCreateCategoryCommand}.
*/
export interface BatchCreateCategoryCommandOutput extends __MetadataBearer {}

/**
* <p>Creates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html">Custom labels for Amazon Q Apps</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { QAppsClient, BatchCreateCategoryCommand } from "@aws-sdk/client-qapps"; // ES Modules import
* // const { QAppsClient, BatchCreateCategoryCommand } = require("@aws-sdk/client-qapps"); // CommonJS import
* const client = new QAppsClient(config);
* const input = { // BatchCreateCategoryInput
* instanceId: "STRING_VALUE", // required
* categories: [ // BatchCreateCategoryInputCategoryList // required
* { // BatchCreateCategoryInputCategory
* id: "STRING_VALUE",
* title: "STRING_VALUE", // required
* color: "STRING_VALUE",
* },
* ],
* };
* const command = new BatchCreateCategoryCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param BatchCreateCategoryCommandInput - {@link BatchCreateCategoryCommandInput}
* @returns {@link BatchCreateCategoryCommandOutput}
* @see {@link BatchCreateCategoryCommandInput} for command's `input` shape.
* @see {@link BatchCreateCategoryCommandOutput} for command's `response` shape.
* @see {@link QAppsClientResolvedConfig | config} for QAppsClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The client is not authorized to perform the requested operation.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>The requested operation could not be completed due to a
* conflict with the current state of the resource.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An internal service error occurred while processing the request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The requested resource could not be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The requested operation could not be completed because too many
* requests were sent at once. Wait a bit and try again later.</p>
*
* @throws {@link UnauthorizedException} (client fault)
* <p>The client is not authenticated or authorized to perform the requested operation.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input failed to satisfy the constraints specified by the service.</p>
*
* @throws {@link QAppsServiceException}
* <p>Base exception class for all service exceptions from QApps service.</p>
*
* @public
* @example Creates the categories for the library
* ```javascript
* //
* const input = {
* "categories": [
* {
* "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d",
* "title": "HR"
* },
* {
* "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f",
* "title": "Marketing"
* }
* ],
* "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f"
* };
* const command = new BatchCreateCategoryCommand(input);
* await client.send(command);
* // example id: example-1
* ```
*
*/
export class BatchCreateCategoryCommand extends $Command
.classBuilder<
BatchCreateCategoryCommandInput,
BatchCreateCategoryCommandOutput,
QAppsClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: QAppsClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("QAppsService", "BatchCreateCategory", {})
.n("QAppsClient", "BatchCreateCategoryCommand")
.f(void 0, void 0)
.ser(se_BatchCreateCategoryCommand)
.de(de_BatchCreateCategoryCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: BatchCreateCategoryInput;
output: {};
};
sdk: {
input: BatchCreateCategoryCommandInput;
output: BatchCreateCategoryCommandOutput;
};
};
}
Loading

0 comments on commit 9e3e6fb

Please sign in to comment.