diff --git a/clients/client-qapps/README.md b/clients/client-qapps/README.md index a19e5e6199ac..985189eca7ea 100644 --- a/clients/client-qapps/README.md +++ b/clients/client-qapps/README.md @@ -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/) + +
+ +BatchCreateCategory + + +[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/) + +
+
+ +BatchDeleteCategory + + +[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/) + +
+
+ +BatchUpdateCategory + + +[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/) +
@@ -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/) +
+
+ +ListCategories + + +[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/) +
diff --git a/clients/client-qapps/src/QApps.ts b/clients/client-qapps/src/QApps.ts index ea99f560d8dc..5b90b0cb720f 100644 --- a/clients/client-qapps/src/QApps.ts +++ b/clients/client-qapps/src/QApps.ts @@ -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, @@ -50,6 +65,11 @@ import { ImportDocumentCommandInput, ImportDocumentCommandOutput, } from "./commands/ImportDocumentCommand"; +import { + ListCategoriesCommand, + ListCategoriesCommandInput, + ListCategoriesCommandOutput, +} from "./commands/ListCategoriesCommand"; import { ListLibraryItemsCommand, ListLibraryItemsCommandInput, @@ -99,6 +119,9 @@ import { QAppsClient, QAppsClientConfig } from "./QAppsClient"; const commands = { AssociateLibraryItemReviewCommand, AssociateQAppWithUserCommand, + BatchCreateCategoryCommand, + BatchDeleteCategoryCommand, + BatchUpdateCategoryCommand, CreateLibraryItemCommand, CreateQAppCommand, DeleteLibraryItemCommand, @@ -109,6 +132,7 @@ const commands = { GetQAppCommand, GetQAppSessionCommand, ImportDocumentCommand, + ListCategoriesCommand, ListLibraryItemsCommand, ListQAppsCommand, ListTagsForResourceCommand, @@ -158,6 +182,57 @@ export interface QApps { cb: (err: any, data?: AssociateQAppWithUserCommandOutput) => void ): void; + /** + * @see {@link BatchCreateCategoryCommand} + */ + batchCreateCategory( + args: BatchCreateCategoryCommandInput, + options?: __HttpHandlerOptions + ): Promise; + 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; + 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; + 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} */ @@ -301,6 +376,20 @@ export interface QApps { cb: (err: any, data?: ImportDocumentCommandOutput) => void ): void; + /** + * @see {@link ListCategoriesCommand} + */ + listCategories( + args: ListCategoriesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + 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} */ diff --git a/clients/client-qapps/src/QAppsClient.ts b/clients/client-qapps/src/QAppsClient.ts index fed5a57da35a..7e3139589e2f 100644 --- a/clients/client-qapps/src/QAppsClient.ts +++ b/clients/client-qapps/src/QAppsClient.ts @@ -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"; @@ -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 { @@ -112,6 +125,9 @@ export { __Client }; export type ServiceInputTypes = | AssociateLibraryItemReviewCommandInput | AssociateQAppWithUserCommandInput + | BatchCreateCategoryCommandInput + | BatchDeleteCategoryCommandInput + | BatchUpdateCategoryCommandInput | CreateLibraryItemCommandInput | CreateQAppCommandInput | DeleteLibraryItemCommandInput @@ -122,6 +138,7 @@ export type ServiceInputTypes = | GetQAppCommandInput | GetQAppSessionCommandInput | ImportDocumentCommandInput + | ListCategoriesCommandInput | ListLibraryItemsCommandInput | ListQAppsCommandInput | ListTagsForResourceCommandInput @@ -141,6 +158,9 @@ export type ServiceInputTypes = export type ServiceOutputTypes = | AssociateLibraryItemReviewCommandOutput | AssociateQAppWithUserCommandOutput + | BatchCreateCategoryCommandOutput + | BatchDeleteCategoryCommandOutput + | BatchUpdateCategoryCommandOutput | CreateLibraryItemCommandOutput | CreateQAppCommandOutput | DeleteLibraryItemCommandOutput @@ -151,6 +171,7 @@ export type ServiceOutputTypes = | GetQAppCommandOutput | GetQAppSessionCommandOutput | ImportDocumentCommandOutput + | ListCategoriesCommandOutput | ListLibraryItemsCommandOutput | ListQAppsCommandOutput | ListTagsForResourceCommandOutput diff --git a/clients/client-qapps/src/commands/BatchCreateCategoryCommand.ts b/clients/client-qapps/src/commands/BatchCreateCategoryCommand.ts new file mode 100644 index 000000000000..77b427134bb8 --- /dev/null +++ b/clients/client-qapps/src/commands/BatchCreateCategoryCommand.ts @@ -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 {} + +/** + *

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 Custom labels for Amazon Q Apps.

+ * @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) + *

The client is not authorized to perform the requested operation.

+ * + * @throws {@link ConflictException} (client fault) + *

The requested operation could not be completed due to a + * conflict with the current state of the resource.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred while processing the request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The requested resource could not be found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The requested operation could not be completed because too many + * requests were sent at once. Wait a bit and try again later.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The client is not authenticated or authorized to perform the requested operation.

+ * + * @throws {@link ValidationException} (client fault) + *

The input failed to satisfy the constraints specified by the service.

+ * + * @throws {@link QAppsServiceException} + *

Base exception class for all service exceptions from QApps service.

+ * + * @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; + }; + }; +} diff --git a/clients/client-qapps/src/commands/BatchDeleteCategoryCommand.ts b/clients/client-qapps/src/commands/BatchDeleteCategoryCommand.ts new file mode 100644 index 000000000000..fb69a51b48e0 --- /dev/null +++ b/clients/client-qapps/src/commands/BatchDeleteCategoryCommand.ts @@ -0,0 +1,130 @@ +// 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 { BatchDeleteCategoryInput } from "../models/models_0"; +import { de_BatchDeleteCategoryCommand, se_BatchDeleteCategoryCommand } from "../protocols/Aws_restJson1"; +import { QAppsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QAppsClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link BatchDeleteCategoryCommand}. + */ +export interface BatchDeleteCategoryCommandInput extends BatchDeleteCategoryInput {} +/** + * @public + * + * The output of {@link BatchDeleteCategoryCommand}. + */ +export interface BatchDeleteCategoryCommandOutput extends __MetadataBearer {} + +/** + *

Deletes Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QAppsClient, BatchDeleteCategoryCommand } from "@aws-sdk/client-qapps"; // ES Modules import + * // const { QAppsClient, BatchDeleteCategoryCommand } = require("@aws-sdk/client-qapps"); // CommonJS import + * const client = new QAppsClient(config); + * const input = { // BatchDeleteCategoryInput + * instanceId: "STRING_VALUE", // required + * categories: [ // DeleteCategoryInputList // required + * "STRING_VALUE", + * ], + * }; + * const command = new BatchDeleteCategoryCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param BatchDeleteCategoryCommandInput - {@link BatchDeleteCategoryCommandInput} + * @returns {@link BatchDeleteCategoryCommandOutput} + * @see {@link BatchDeleteCategoryCommandInput} for command's `input` shape. + * @see {@link BatchDeleteCategoryCommandOutput} for command's `response` shape. + * @see {@link QAppsClientResolvedConfig | config} for QAppsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The client is not authorized to perform the requested operation.

+ * + * @throws {@link ConflictException} (client fault) + *

The requested operation could not be completed due to a + * conflict with the current state of the resource.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred while processing the request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The requested resource could not be found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The requested operation could not be completed because too many + * requests were sent at once. Wait a bit and try again later.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The client is not authenticated or authorized to perform the requested operation.

+ * + * @throws {@link ValidationException} (client fault) + *

The input failed to satisfy the constraints specified by the service.

+ * + * @throws {@link QAppsServiceException} + *

Base exception class for all service exceptions from QApps service.

+ * + * @public + * @example Deletes the categories in the library + * ```javascript + * // + * const input = { + * "categories": [ + * "9c871ed4-1c41-4065-aefe-321cd4b61cf8" + * ], + * "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f" + * }; + * const command = new BatchDeleteCategoryCommand(input); + * await client.send(command); + * // example id: example-1 + * ``` + * + */ +export class BatchDeleteCategoryCommand extends $Command + .classBuilder< + BatchDeleteCategoryCommandInput, + BatchDeleteCategoryCommandOutput, + 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", "BatchDeleteCategory", {}) + .n("QAppsClient", "BatchDeleteCategoryCommand") + .f(void 0, void 0) + .ser(se_BatchDeleteCategoryCommand) + .de(de_BatchDeleteCategoryCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: BatchDeleteCategoryInput; + output: {}; + }; + sdk: { + input: BatchDeleteCategoryCommandInput; + output: BatchDeleteCategoryCommandOutput; + }; + }; +} diff --git a/clients/client-qapps/src/commands/BatchUpdateCategoryCommand.ts b/clients/client-qapps/src/commands/BatchUpdateCategoryCommand.ts new file mode 100644 index 000000000000..efbc64336511 --- /dev/null +++ b/clients/client-qapps/src/commands/BatchUpdateCategoryCommand.ts @@ -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 { BatchUpdateCategoryInput } from "../models/models_0"; +import { de_BatchUpdateCategoryCommand, se_BatchUpdateCategoryCommand } from "../protocols/Aws_restJson1"; +import { QAppsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QAppsClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link BatchUpdateCategoryCommand}. + */ +export interface BatchUpdateCategoryCommandInput extends BatchUpdateCategoryInput {} +/** + * @public + * + * The output of {@link BatchUpdateCategoryCommand}. + */ +export interface BatchUpdateCategoryCommandOutput extends __MetadataBearer {} + +/** + *

Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QAppsClient, BatchUpdateCategoryCommand } from "@aws-sdk/client-qapps"; // ES Modules import + * // const { QAppsClient, BatchUpdateCategoryCommand } = require("@aws-sdk/client-qapps"); // CommonJS import + * const client = new QAppsClient(config); + * const input = { // BatchUpdateCategoryInput + * instanceId: "STRING_VALUE", // required + * categories: [ // CategoryListInput // required + * { // CategoryInput + * id: "STRING_VALUE", // required + * title: "STRING_VALUE", // required + * color: "STRING_VALUE", + * }, + * ], + * }; + * const command = new BatchUpdateCategoryCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param BatchUpdateCategoryCommandInput - {@link BatchUpdateCategoryCommandInput} + * @returns {@link BatchUpdateCategoryCommandOutput} + * @see {@link BatchUpdateCategoryCommandInput} for command's `input` shape. + * @see {@link BatchUpdateCategoryCommandOutput} for command's `response` shape. + * @see {@link QAppsClientResolvedConfig | config} for QAppsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The client is not authorized to perform the requested operation.

+ * + * @throws {@link ConflictException} (client fault) + *

The requested operation could not be completed due to a + * conflict with the current state of the resource.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred while processing the request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The requested resource could not be found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The requested operation could not be completed because too many + * requests were sent at once. Wait a bit and try again later.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The client is not authenticated or authorized to perform the requested operation.

+ * + * @throws {@link ValidationException} (client fault) + *

The input failed to satisfy the constraints specified by the service.

+ * + * @throws {@link QAppsServiceException} + *

Base exception class for all service exceptions from QApps service.

+ * + * @public + * @example Updates the categories in the library + * ```javascript + * // + * const input = { + * "categories": [ + * { + * "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d", + * "title": "HR Management" + * }, + * { + * "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f", + * "title": "Sales" + * } + * ], + * "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f" + * }; + * const command = new BatchUpdateCategoryCommand(input); + * await client.send(command); + * // example id: example-1 + * ``` + * + */ +export class BatchUpdateCategoryCommand extends $Command + .classBuilder< + BatchUpdateCategoryCommandInput, + BatchUpdateCategoryCommandOutput, + 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", "BatchUpdateCategory", {}) + .n("QAppsClient", "BatchUpdateCategoryCommand") + .f(void 0, void 0) + .ser(se_BatchUpdateCategoryCommand) + .de(de_BatchUpdateCategoryCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: BatchUpdateCategoryInput; + output: {}; + }; + sdk: { + input: BatchUpdateCategoryCommandInput; + output: BatchUpdateCategoryCommandOutput; + }; + }; +} diff --git a/clients/client-qapps/src/commands/GetLibraryItemCommand.ts b/clients/client-qapps/src/commands/GetLibraryItemCommand.ts index 9751465ae226..10d9a8d2889b 100644 --- a/clients/client-qapps/src/commands/GetLibraryItemCommand.ts +++ b/clients/client-qapps/src/commands/GetLibraryItemCommand.ts @@ -51,6 +51,8 @@ export interface GetLibraryItemCommandOutput extends GetLibraryItemOutput, __Met * // { // Category * // id: "STRING_VALUE", // required * // title: "STRING_VALUE", // required + * // color: "STRING_VALUE", + * // appCount: Number("int"), * // }, * // ], * // status: "STRING_VALUE", // required diff --git a/clients/client-qapps/src/commands/GetQAppSessionCommand.ts b/clients/client-qapps/src/commands/GetQAppSessionCommand.ts index 52eea0e0926b..8c797373236d 100644 --- a/clients/client-qapps/src/commands/GetQAppSessionCommand.ts +++ b/clients/client-qapps/src/commands/GetQAppSessionCommand.ts @@ -102,11 +102,11 @@ export interface GetQAppSessionCommandOutput extends GetQAppSessionOutput, __Met * "cardStatus": { * "1e6caeac-b481-45ff-a082-8b9a4a0b72e8": { * "currentState": "COMPLETED", - * "currentValue": "Earth's circumference is 24,901 miles" + * "currentValue": "Based on the responses, the most popular color is red, with 1 vote from the user \"user1\"." * }, * "6fb5b404-3b7b-48a4-8a8b-56406922a606": { * "currentState": "COMPLETED", - * "currentValue": "What is the circumference of Earth?" + * "currentValue": "" * } * }, * "sessionArn": "arn:aws:qapps:us-west-2:0123456789012:application/a929ecd6-5765-4ec7-bd3e-2ca90098b18e/qapp/65e7dce7-226a-47f9-b689-22850becef89/session/1fca878e-64c5-4dc4-b1d9-c93effed4e82", diff --git a/clients/client-qapps/src/commands/ListCategoriesCommand.ts b/clients/client-qapps/src/commands/ListCategoriesCommand.ts new file mode 100644 index 000000000000..8bf70bfceed7 --- /dev/null +++ b/clients/client-qapps/src/commands/ListCategoriesCommand.ts @@ -0,0 +1,147 @@ +// 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 { ListCategoriesInput, ListCategoriesOutput } from "../models/models_0"; +import { de_ListCategoriesCommand, se_ListCategoriesCommand } from "../protocols/Aws_restJson1"; +import { QAppsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QAppsClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListCategoriesCommand}. + */ +export interface ListCategoriesCommandInput extends ListCategoriesInput {} +/** + * @public + * + * The output of {@link ListCategoriesCommand}. + */ +export interface ListCategoriesCommandOutput extends ListCategoriesOutput, __MetadataBearer {} + +/** + *

Lists the categories of a Amazon Q Business application environment instance. For more information, see Custom labels for Amazon Q Apps.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QAppsClient, ListCategoriesCommand } from "@aws-sdk/client-qapps"; // ES Modules import + * // const { QAppsClient, ListCategoriesCommand } = require("@aws-sdk/client-qapps"); // CommonJS import + * const client = new QAppsClient(config); + * const input = { // ListCategoriesInput + * instanceId: "STRING_VALUE", // required + * }; + * const command = new ListCategoriesCommand(input); + * const response = await client.send(command); + * // { // ListCategoriesOutput + * // categories: [ // CategoriesList + * // { // Category + * // id: "STRING_VALUE", // required + * // title: "STRING_VALUE", // required + * // color: "STRING_VALUE", + * // appCount: Number("int"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListCategoriesCommandInput - {@link ListCategoriesCommandInput} + * @returns {@link ListCategoriesCommandOutput} + * @see {@link ListCategoriesCommandInput} for command's `input` shape. + * @see {@link ListCategoriesCommandOutput} for command's `response` shape. + * @see {@link QAppsClientResolvedConfig | config} for QAppsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The client is not authorized to perform the requested operation.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred while processing the request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The requested resource could not be found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The requested operation could not be completed because too many + * requests were sent at once. Wait a bit and try again later.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

The client is not authenticated or authorized to perform the requested operation.

+ * + * @throws {@link ValidationException} (client fault) + *

The input failed to satisfy the constraints specified by the service.

+ * + * @throws {@link QAppsServiceException} + *

Base exception class for all service exceptions from QApps service.

+ * + * @public + * @example List categories available for the library items in this instance + * ```javascript + * // + * const input = { + * "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f" + * }; + * const command = new ListCategoriesCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "categories": [ + * { + * "appCount": 10, + * "color": "#FF6600", + * "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d", + * "title": "HR" + * }, + * { + * "appCount": 11, + * "color": "#FFFF00", + * "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f", + * "title": "Marketing" + * } + * ] + * } + * *\/ + * // example id: example-1 + * ``` + * + */ +export class ListCategoriesCommand extends $Command + .classBuilder< + ListCategoriesCommandInput, + ListCategoriesCommandOutput, + 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", "ListCategories", {}) + .n("QAppsClient", "ListCategoriesCommand") + .f(void 0, void 0) + .ser(se_ListCategoriesCommand) + .de(de_ListCategoriesCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListCategoriesInput; + output: ListCategoriesOutput; + }; + sdk: { + input: ListCategoriesCommandInput; + output: ListCategoriesCommandOutput; + }; + }; +} diff --git a/clients/client-qapps/src/commands/ListLibraryItemsCommand.ts b/clients/client-qapps/src/commands/ListLibraryItemsCommand.ts index a2d5ef0b3c57..d916c53fb70f 100644 --- a/clients/client-qapps/src/commands/ListLibraryItemsCommand.ts +++ b/clients/client-qapps/src/commands/ListLibraryItemsCommand.ts @@ -53,6 +53,8 @@ export interface ListLibraryItemsCommandOutput extends ListLibraryItemsOutput, _ * // { // Category * // id: "STRING_VALUE", // required * // title: "STRING_VALUE", // required + * // color: "STRING_VALUE", + * // appCount: Number("int"), * // }, * // ], * // status: "STRING_VALUE", // required diff --git a/clients/client-qapps/src/commands/UpdateLibraryItemCommand.ts b/clients/client-qapps/src/commands/UpdateLibraryItemCommand.ts index ebdab08e7fb4..c2928b8a0b24 100644 --- a/clients/client-qapps/src/commands/UpdateLibraryItemCommand.ts +++ b/clients/client-qapps/src/commands/UpdateLibraryItemCommand.ts @@ -53,6 +53,8 @@ export interface UpdateLibraryItemCommandOutput extends UpdateLibraryItemOutput, * // { // Category * // id: "STRING_VALUE", // required * // title: "STRING_VALUE", // required + * // color: "STRING_VALUE", + * // appCount: Number("int"), * // }, * // ], * // status: "STRING_VALUE", // required diff --git a/clients/client-qapps/src/commands/index.ts b/clients/client-qapps/src/commands/index.ts index 03c4ed3854e3..0a4d488aca22 100644 --- a/clients/client-qapps/src/commands/index.ts +++ b/clients/client-qapps/src/commands/index.ts @@ -1,6 +1,9 @@ // smithy-typescript generated code export * from "./AssociateLibraryItemReviewCommand"; export * from "./AssociateQAppWithUserCommand"; +export * from "./BatchCreateCategoryCommand"; +export * from "./BatchDeleteCategoryCommand"; +export * from "./BatchUpdateCategoryCommand"; export * from "./CreateLibraryItemCommand"; export * from "./CreateQAppCommand"; export * from "./DeleteLibraryItemCommand"; @@ -11,6 +14,7 @@ export * from "./GetLibraryItemCommand"; export * from "./GetQAppCommand"; export * from "./GetQAppSessionCommand"; export * from "./ImportDocumentCommand"; +export * from "./ListCategoriesCommand"; export * from "./ListLibraryItemsCommand"; export * from "./ListQAppsCommand"; export * from "./ListTagsForResourceCommand"; diff --git a/clients/client-qapps/src/models/models_0.ts b/clients/client-qapps/src/models/models_0.ts index 8ab11b1a5003..3e7025b162d2 100644 --- a/clients/client-qapps/src/models/models_0.ts +++ b/clients/client-qapps/src/models/models_0.ts @@ -734,6 +734,105 @@ export interface AssociateQAppWithUserInput { appId: string | undefined; } +/** + *

The category object to be created.

+ * @public + */ +export interface BatchCreateCategoryInputCategory { + /** + *

The unique identifier to be associated with a category. If you don't include a value, the category is automatically assigned a unique identifier.

+ * @public + */ + id?: string; + + /** + *

The name of the category.

+ * @public + */ + title: string | undefined; + + /** + *

The color to be associated with a category. The color must be a hexadecimal value of either 3 or 6 digits.

+ * @public + */ + color?: string; +} + +/** + * @public + */ +export interface BatchCreateCategoryInput { + /** + *

The unique identifier of the Amazon Q Business application environment instance.

+ * @public + */ + instanceId: string | undefined; + + /** + *

The list of category objects to be created

+ * @public + */ + categories: BatchCreateCategoryInputCategory[] | undefined; +} + +/** + * @public + */ +export interface BatchDeleteCategoryInput { + /** + *

The unique identifier of the Amazon Q Business application environment instance.

+ * @public + */ + instanceId: string | undefined; + + /** + *

The list of IDs of the categories to be deleted.

+ * @public + */ + categories: string[] | undefined; +} + +/** + *

A label that web experience users associate with a library item. Web experience users use Categories to tag and filter library items.

+ * @public + */ +export interface CategoryInput { + /** + *

The unique identifier of the category.

+ * @public + */ + id: string | undefined; + + /** + *

The name of the category.

+ * @public + */ + title: string | undefined; + + /** + *

The color of the category, represented as a hexadecimal value of either 3 or 6 digits.

+ * @public + */ + color?: string; +} + +/** + * @public + */ +export interface BatchUpdateCategoryInput { + /** + *

The unique identifier of the Amazon Q Business application environment instance.

+ * @public + */ + instanceId: string | undefined; + + /** + *

The list of categories to be updated with their new values.

+ * @public + */ + categories: CategoryInput[] | undefined; +} + /** * @public * @enum @@ -801,6 +900,18 @@ export interface Category { * @public */ title: string | undefined; + + /** + *

The color of the category

+ * @public + */ + color?: string; + + /** + *

The number of published Amazon Q Apps associated with a category

+ * @public + */ + appCount?: number; } /** @@ -1438,6 +1549,28 @@ export const LibraryItemStatus = { */ export type LibraryItemStatus = (typeof LibraryItemStatus)[keyof typeof LibraryItemStatus]; +/** + * @public + */ +export interface ListCategoriesInput { + /** + *

The unique identifier of the Amazon Q Business application environment instance.

+ * @public + */ + instanceId: string | undefined; +} + +/** + * @public + */ +export interface ListCategoriesOutput { + /** + *

The categories of a Amazon Q Business application environment instance.

+ * @public + */ + categories?: Category[]; +} + /** * @public */ diff --git a/clients/client-qapps/src/protocols/Aws_restJson1.ts b/clients/client-qapps/src/protocols/Aws_restJson1.ts index 01fd3379acde..7317831e8e7c 100644 --- a/clients/client-qapps/src/protocols/Aws_restJson1.ts +++ b/clients/client-qapps/src/protocols/Aws_restJson1.ts @@ -42,6 +42,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"; @@ -58,6 +70,7 @@ import { GetLibraryItemCommandInput, GetLibraryItemCommandOutput } from "../comm 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 { @@ -81,9 +94,11 @@ import { AppDefinition, AppDefinitionInput, AttributeFilter, + BatchCreateCategoryInputCategory, Card, CardInput, CardValue, + CategoryInput, ConflictException, ContentTooLargeException, ConversationMessage, @@ -153,6 +168,75 @@ export const se_AssociateQAppWithUserCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1BatchCreateCategoryCommand + */ +export const se_BatchCreateCategoryCommand = async ( + input: BatchCreateCategoryCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_ii]: input[_iI]!, + }); + b.bp("/catalog.createCategories"); + let body: any; + body = JSON.stringify( + take(input, { + categories: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1BatchDeleteCategoryCommand + */ +export const se_BatchDeleteCategoryCommand = async ( + input: BatchDeleteCategoryCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_ii]: input[_iI]!, + }); + b.bp("/catalog.deleteCategories"); + let body: any; + body = JSON.stringify( + take(input, { + categories: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1BatchUpdateCategoryCommand + */ +export const se_BatchUpdateCategoryCommand = async ( + input: BatchUpdateCategoryCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_ii]: input[_iI]!, + }); + b.bp("/catalog.updateCategories"); + let body: any; + body = JSON.stringify( + take(input, { + categories: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1CreateLibraryItemCommand */ @@ -385,6 +469,23 @@ export const se_ImportDocumentCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1ListCategoriesCommand + */ +export const se_ListCategoriesCommand = async ( + input: ListCategoriesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_ii]: input[_iI]!, + }); + b.bp("/catalog.listCategories"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1ListLibraryItemsCommand */ @@ -691,6 +792,57 @@ export const de_AssociateQAppWithUserCommand = async ( return contents; }; +/** + * deserializeAws_restJson1BatchCreateCategoryCommand + */ +export const de_BatchCreateCategoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1BatchDeleteCategoryCommand + */ +export const de_BatchDeleteCategoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1BatchUpdateCategoryCommand + */ +export const de_BatchUpdateCategoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + /** * deserializeAws_restJson1CreateLibraryItemCommand */ @@ -930,6 +1082,27 @@ export const de_ImportDocumentCommand = async ( return contents; }; +/** + * deserializeAws_restJson1ListCategoriesCommand + */ +export const de_ListCategoriesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + categories: _json, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1ListLibraryItemsCommand */ @@ -1468,6 +1641,10 @@ const se_AttributeFilters = (input: AttributeFilter[], context: __SerdeContext): }); }; +// se_BatchCreateCategoryInputCategory omitted. + +// se_BatchCreateCategoryInputCategoryList omitted. + /** * serializeAws_restJson1CardInput */ @@ -1498,8 +1675,14 @@ const se_CardList = (input: CardInput[], context: __SerdeContext): any => { // se_CategoryIdList omitted. +// se_CategoryInput omitted. + +// se_CategoryListInput omitted. + // se_ConversationMessage omitted. +// se_DeleteCategoryInputList omitted. + /** * serializeAws_restJson1DocumentAttribute */ @@ -1688,6 +1871,8 @@ const de_CardModelList = (output: any, context: __SerdeContext): Card[] => { // de_CardStatusMap omitted. +// de_CategoriesList omitted. + // de_Category omitted. // de_CategoryList omitted. diff --git a/codegen/sdk-codegen/aws-models/qapps.json b/codegen/sdk-codegen/aws-models/qapps.json index 25f4815cc375..783e4a4ac81e 100644 --- a/codegen/sdk-codegen/aws-models/qapps.json +++ b/codegen/sdk-codegen/aws-models/qapps.json @@ -180,7 +180,7 @@ } ], "traits": { - "smithy.api#documentation": "

Associates a rating or review for a library item with the user submitting \n the request. This increments the rating count for the specified library item.

", + "smithy.api#documentation": "

Associates a rating or review for a library item with the user submitting\n the request. This increments the rating count for the specified library item.

", "smithy.api#examples": [ { "title": "Increase the rating counter by 1 for the related app for this user", @@ -364,6 +364,285 @@ "target": "com.amazonaws.qapps#AttributeFilter" } }, + "com.amazonaws.qapps#BatchCreateCategory": { + "type": "operation", + "input": { + "target": "com.amazonaws.qapps#BatchCreateCategoryInput" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.qapps#AccessDeniedException" + }, + { + "target": "com.amazonaws.qapps#ConflictException" + }, + { + "target": "com.amazonaws.qapps#InternalServerException" + }, + { + "target": "com.amazonaws.qapps#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qapps#ThrottlingException" + }, + { + "target": "com.amazonaws.qapps#UnauthorizedException" + }, + { + "target": "com.amazonaws.qapps#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

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 Custom labels for Amazon Q Apps.

", + "smithy.api#examples": [ + { + "title": "Creates the categories for the library", + "input": { + "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f", + "categories": [ + { + "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d", + "title": "HR" + }, + { + "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f", + "title": "Marketing" + } + ] + } + } + ], + "smithy.api#http": { + "method": "POST", + "uri": "/catalog.createCategories" + } + } + }, + "com.amazonaws.qapps#BatchCreateCategoryInput": { + "type": "structure", + "members": { + "instanceId": { + "target": "com.amazonaws.qapps#InstanceId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Amazon Q Business application environment instance.

", + "smithy.api#httpHeader": "instance-id", + "smithy.api#required": {} + } + }, + "categories": { + "target": "com.amazonaws.qapps#BatchCreateCategoryInputCategoryList", + "traits": { + "smithy.api#documentation": "

The list of category objects to be created

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qapps#BatchCreateCategoryInputCategory": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qapps#UUID", + "traits": { + "smithy.api#documentation": "

The unique identifier to be associated with a category. If you don't include a value, the category is automatically assigned a unique identifier.

" + } + }, + "title": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the category.

", + "smithy.api#length": { + "min": 1, + "max": 30 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_]+( [a-zA-Z0-9_]+)*$", + "smithy.api#required": {} + } + }, + "color": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The color to be associated with a category. The color must be a hexadecimal value of either 3 or 6 digits.

", + "smithy.api#length": { + "min": 4, + "max": 7 + }, + "smithy.api#pattern": "^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$" + } + } + }, + "traits": { + "smithy.api#documentation": "

The category object to be created.

" + } + }, + "com.amazonaws.qapps#BatchCreateCategoryInputCategoryList": { + "type": "list", + "member": { + "target": "com.amazonaws.qapps#BatchCreateCategoryInputCategory" + }, + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.qapps#BatchDeleteCategory": { + "type": "operation", + "input": { + "target": "com.amazonaws.qapps#BatchDeleteCategoryInput" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.qapps#AccessDeniedException" + }, + { + "target": "com.amazonaws.qapps#ConflictException" + }, + { + "target": "com.amazonaws.qapps#InternalServerException" + }, + { + "target": "com.amazonaws.qapps#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qapps#ThrottlingException" + }, + { + "target": "com.amazonaws.qapps#UnauthorizedException" + }, + { + "target": "com.amazonaws.qapps#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.

", + "smithy.api#examples": [ + { + "title": "Deletes the categories in the library", + "input": { + "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f", + "categories": ["9c871ed4-1c41-4065-aefe-321cd4b61cf8"] + } + } + ], + "smithy.api#http": { + "method": "POST", + "uri": "/catalog.deleteCategories" + } + } + }, + "com.amazonaws.qapps#BatchDeleteCategoryInput": { + "type": "structure", + "members": { + "instanceId": { + "target": "com.amazonaws.qapps#InstanceId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Amazon Q Business application environment instance.

", + "smithy.api#httpHeader": "instance-id", + "smithy.api#required": {} + } + }, + "categories": { + "target": "com.amazonaws.qapps#DeleteCategoryInputList", + "traits": { + "smithy.api#documentation": "

The list of IDs of the categories to be deleted.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qapps#BatchUpdateCategory": { + "type": "operation", + "input": { + "target": "com.amazonaws.qapps#BatchUpdateCategoryInput" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.qapps#AccessDeniedException" + }, + { + "target": "com.amazonaws.qapps#ConflictException" + }, + { + "target": "com.amazonaws.qapps#InternalServerException" + }, + { + "target": "com.amazonaws.qapps#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qapps#ThrottlingException" + }, + { + "target": "com.amazonaws.qapps#UnauthorizedException" + }, + { + "target": "com.amazonaws.qapps#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.

", + "smithy.api#examples": [ + { + "title": "Updates the categories in the library", + "input": { + "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f", + "categories": [ + { + "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d", + "title": "HR Management" + }, + { + "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f", + "title": "Sales" + } + ] + } + } + ], + "smithy.api#http": { + "method": "POST", + "uri": "/catalog.updateCategories" + } + } + }, + "com.amazonaws.qapps#BatchUpdateCategoryInput": { + "type": "structure", + "members": { + "instanceId": { + "target": "com.amazonaws.qapps#InstanceId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Amazon Q Business application environment instance.

", + "smithy.api#httpHeader": "instance-id", + "smithy.api#required": {} + } + }, + "categories": { + "target": "com.amazonaws.qapps#CategoryListInput", + "traits": { + "smithy.api#documentation": "

The list of categories to be updated with their new values.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, "com.amazonaws.qapps#Card": { "type": "union", "members": { @@ -563,6 +842,17 @@ } } }, + "com.amazonaws.qapps#CategoriesList": { + "type": "list", + "member": { + "target": "com.amazonaws.qapps#Category" + }, + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, "com.amazonaws.qapps#Category": { "type": "structure", "members": { @@ -579,6 +869,18 @@ "smithy.api#documentation": "

The title or name of the category.

", "smithy.api#required": {} } + }, + "color": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The color of the category

" + } + }, + "appCount": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The number of published Amazon Q Apps associated with a category

" + } } }, "traits": { @@ -596,6 +898,44 @@ } } }, + "com.amazonaws.qapps#CategoryInput": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qapps#UUID", + "traits": { + "smithy.api#documentation": "

The unique identifier of the category.

", + "smithy.api#required": {} + } + }, + "title": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the category.

", + "smithy.api#length": { + "min": 1, + "max": 30 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_]+( [a-zA-Z0-9_]+)*$", + "smithy.api#required": {} + } + }, + "color": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The color of the category, represented as a hexadecimal value of either 3 or 6 digits.

", + "smithy.api#length": { + "min": 4, + "max": 7 + }, + "smithy.api#pattern": "^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$" + } + } + }, + "traits": { + "smithy.api#documentation": "

A label that web experience users associate with a library item. Web experience users use Categories to tag and filter library items.

" + } + }, "com.amazonaws.qapps#CategoryList": { "type": "list", "member": { @@ -607,6 +947,17 @@ } } }, + "com.amazonaws.qapps#CategoryListInput": { + "type": "list", + "member": { + "target": "com.amazonaws.qapps#CategoryInput" + }, + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, "com.amazonaws.qapps#ConflictException": { "type": "structure", "members": { @@ -632,7 +983,7 @@ } }, "traits": { - "smithy.api#documentation": "

The requested operation could not be completed due to a \n conflict with the current state of the resource.

", + "smithy.api#documentation": "

The requested operation could not be completed due to a\n conflict with the current state of the resource.

", "smithy.api#error": "client", "smithy.api#httpError": 409 } @@ -662,7 +1013,7 @@ } }, "traits": { - "smithy.api#documentation": "

The requested operation could not be completed because \n the content exceeds the maximum allowed size.

", + "smithy.api#documentation": "

The requested operation could not be completed because\n the content exceeds the maximum allowed size.

", "smithy.api#error": "client", "smithy.api#httpError": 413 } @@ -724,7 +1075,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a new library item for an Amazon Q App, allowing it to be discovered and \n used by other allowed users.

", + "smithy.api#documentation": "

Creates a new library item for an Amazon Q App, allowing it to be discovered and\n used by other allowed users.

", "smithy.api#examples": [ { "title": "Create a Library Item", @@ -1073,6 +1424,17 @@ } } }, + "com.amazonaws.qapps#DeleteCategoryInputList": { + "type": "list", + "member": { + "target": "com.amazonaws.qapps#UUID" + }, + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, "com.amazonaws.qapps#DeleteLibraryItem": { "type": "operation", "input": { @@ -1105,7 +1467,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes a library item for an Amazon Q App, removing it from the library \n so it can no longer be discovered or used by other users.

", + "smithy.api#documentation": "

Deletes a library item for an Amazon Q App, removing it from the library\n so it can no longer be discovered or used by other users.

", "smithy.api#examples": [ { "title": "Delete a library item", @@ -1590,7 +1952,7 @@ } }, "traits": { - "smithy.api#documentation": "

Represents a file upload card. It can optionally \n receive a filename and fileId to set a \n default file. If not received, the user must provide the file \n when the Q App runs.

" + "smithy.api#documentation": "

Represents a file upload card. It can optionally\n receive a filename and fileId to set a\n default file. If not received, the user must provide the file\n when the Q App runs.

" } }, "com.amazonaws.qapps#Filename": { @@ -1630,7 +1992,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieves details about a library item for an Amazon Q App, including its metadata, \n categories, ratings, and usage statistics.

", + "smithy.api#documentation": "

Retrieves details about a library item for an Amazon Q App, including its metadata,\n categories, ratings, and usage statistics.

", "smithy.api#examples": [ { "title": "Retrieve a library item", @@ -2047,11 +2409,11 @@ "cardStatus": { "6fb5b404-3b7b-48a4-8a8b-56406922a606": { "currentState": "COMPLETED", - "currentValue": "What is the circumference of Earth?" + "currentValue": "" }, "1e6caeac-b481-45ff-a082-8b9a4a0b72e8": { "currentState": "COMPLETED", - "currentValue": "Earth's circumference is 24,901 miles" + "currentValue": "Based on the responses, the most popular color is red, with 1 vote from the user \"user1\"." } } } @@ -2159,7 +2521,7 @@ } ], "traits": { - "smithy.api#documentation": "

Uploads a file that can then be used either as a default in a \n FileUploadCard from Q App definition or as a file that \n is used inside a single Q App run. The purpose of the document is \n determined by a scope parameter that indicates whether it is at the \n app definition level or at the app session level.

", + "smithy.api#documentation": "

Uploads a file that can then be used either as a default in a\n FileUploadCard from Q App definition or as a file that\n is used inside a single Q App run. The purpose of the document is\n determined by a scope parameter that indicates whether it is at the\n app definition level or at the app session level.

", "smithy.api#examples": [ { "title": "Upload a file to a specific session", @@ -2400,7 +2762,7 @@ } }, "traits": { - "smithy.api#documentation": "

A library item is a snapshot of an Amazon Q App \n that can be published so the users in their Amazon Q Apps library \n can discover it, clone it, and run it.

" + "smithy.api#documentation": "

A library item is a snapshot of an Amazon Q App\n that can be published so the users in their Amazon Q Apps library\n can discover it, clone it, and run it.

" } }, "com.amazonaws.qapps#LibraryItemStatus": { @@ -2420,6 +2782,97 @@ } } }, + "com.amazonaws.qapps#ListCategories": { + "type": "operation", + "input": { + "target": "com.amazonaws.qapps#ListCategoriesInput" + }, + "output": { + "target": "com.amazonaws.qapps#ListCategoriesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.qapps#AccessDeniedException" + }, + { + "target": "com.amazonaws.qapps#InternalServerException" + }, + { + "target": "com.amazonaws.qapps#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qapps#ThrottlingException" + }, + { + "target": "com.amazonaws.qapps#UnauthorizedException" + }, + { + "target": "com.amazonaws.qapps#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the categories of a Amazon Q Business application environment instance. For more information, see Custom labels for Amazon Q Apps.

", + "smithy.api#examples": [ + { + "title": "List categories available for the library items in this instance", + "input": { + "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f" + }, + "output": { + "categories": [ + { + "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d", + "title": "HR", + "color": "#FF6600", + "appCount": 10 + }, + { + "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f", + "title": "Marketing", + "color": "#FFFF00", + "appCount": 11 + } + ] + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/catalog.listCategories" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qapps#ListCategoriesInput": { + "type": "structure", + "members": { + "instanceId": { + "target": "com.amazonaws.qapps#InstanceId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Amazon Q Business application environment instance.

", + "smithy.api#httpHeader": "instance-id", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qapps#ListCategoriesOutput": { + "type": "structure", + "members": { + "categories": { + "target": "com.amazonaws.qapps#CategoriesList", + "traits": { + "smithy.api#documentation": "

The categories of a Amazon Q Business application environment instance.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.qapps#ListLibraryItems": { "type": "operation", "input": { @@ -2624,7 +3077,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the Amazon Q Apps owned by or associated with the user either because \n they created it or because they used it from the library in the past. The user \n identity is extracted from the credentials used to invoke this operation..

", + "smithy.api#documentation": "

Lists the Amazon Q Apps owned by or associated with the user either because\n they created it or because they used it from the library in the past. The user\n identity is extracted from the credentials used to invoke this operation..

", "smithy.api#examples": [ { "title": "List at most 3 Amazon Q Apps in an Q Business application", @@ -2960,7 +3413,7 @@ } }, "traits": { - "smithy.api#documentation": "

The definition of an Amazon Q App generated based on input such as a conversation \n or problem statement.

" + "smithy.api#documentation": "

The definition of an Amazon Q App generated based on input such as a conversation\n or problem statement.

" } }, "com.amazonaws.qapps#PredictQApp": { @@ -2989,7 +3442,7 @@ } ], "traits": { - "smithy.api#documentation": "

Generates an Amazon Q App definition based on either a conversation or \n a problem statement provided as input.The resulting app definition\n can be used to call CreateQApp. This API doesn't create \n Amazon Q Apps directly.

", + "smithy.api#documentation": "

Generates an Amazon Q App definition based on either a conversation or\n a problem statement provided as input.The resulting app definition\n can be used to call CreateQApp. This API doesn't create\n Amazon Q Apps directly.

", "smithy.api#http": { "method": "POST", "uri": "/apps.predictQApp" @@ -3086,6 +3539,15 @@ { "target": "com.amazonaws.qapps#AssociateQAppWithUser" }, + { + "target": "com.amazonaws.qapps#BatchCreateCategory" + }, + { + "target": "com.amazonaws.qapps#BatchDeleteCategory" + }, + { + "target": "com.amazonaws.qapps#BatchUpdateCategory" + }, { "target": "com.amazonaws.qapps#CreateLibraryItem" }, @@ -3116,6 +3578,9 @@ { "target": "com.amazonaws.qapps#ImportDocument" }, + { + "target": "com.amazonaws.qapps#ListCategories" + }, { "target": "com.amazonaws.qapps#ListLibraryItems" }, @@ -3163,7 +3628,7 @@ "name": "qapps" }, "aws.protocols#restJson1": {}, - "smithy.api#documentation": "

The Amazon Q Apps feature capability within Amazon Q Business allows web experience \n users to create lightweight, purpose-built AI apps to fulfill specific tasks from \n within their web experience. For example, users can create a Q App that exclusively \n generates marketing-related content to improve your marketing team's productivity or a \n Q App for writing customer emails and creating promotional content using a certain \n style of voice, tone, and branding. For more information on the capabilities, see \n Amazon Q Apps capabilities in the Amazon Q Business User Guide. \n

\n

For an overview of the Amazon Q App APIs, see Overview of \n Amazon Q Apps API operations.

\n

For information about the IAM access control permissions you need to\n use the Amazon Q Apps API, see \n IAM role for the Amazon Q Business web experience including Amazon Q Apps in the\n Amazon Q Business User Guide.

", + "smithy.api#documentation": "

The Amazon Q Apps feature capability within Amazon Q Business allows web experience\n users to create lightweight, purpose-built AI apps to fulfill specific tasks from\n within their web experience. For example, users can create a Q App that exclusively\n generates marketing-related content to improve your marketing team's productivity or a\n Q App for writing customer emails and creating promotional content using a certain\n style of voice, tone, and branding. For more information on the capabilities, see\n Amazon Q Apps capabilities in the Amazon Q Business User Guide.\n

\n

For an overview of the Amazon Q App APIs, see Overview of\n Amazon Q Apps API operations.

\n

For information about the IAM access control permissions you need to\n use the Amazon Q Apps API, see \n IAM role for the Amazon Q Business web experience including Amazon Q Apps in the\n Amazon Q Business User Guide.

", "smithy.api#title": "QApps", "smithy.rules#endpointRuleSet": { "version": "1.0", @@ -3991,7 +4456,7 @@ } }, "traits": { - "smithy.api#documentation": "

A card in a Amazon Q App that generates a response \n based on the Amazon Q Business service.

" + "smithy.api#documentation": "

A card in a Amazon Q App that generates a response\n based on the Amazon Q Business service.

" } }, "com.amazonaws.qapps#QQueryCardInput": { @@ -4130,7 +4595,7 @@ } }, "traits": { - "smithy.api#documentation": "

The requested operation could not be completed because \n it would exceed the service's quota or limit.

", + "smithy.api#documentation": "

The requested operation could not be completed because\n it would exceed the service's quota or limit.

", "smithy.api#error": "client", "smithy.api#httpError": 402 } @@ -4167,7 +4632,7 @@ } ], "traits": { - "smithy.api#documentation": "

Starts a new session for an Amazon Q App, allowing inputs to be provided \n and the app to be run.

\n \n

Each Q App session will be condensed into a single conversation \n in the web experience.

\n
", + "smithy.api#documentation": "

Starts a new session for an Amazon Q App, allowing inputs to be provided\n and the app to be run.

\n \n

Each Q App session will be condensed into a single conversation\n in the web experience.

\n
", "smithy.api#examples": [ { "title": "Start a session for an Amazon Q App using version 1, passing in initial values for one card", @@ -4290,7 +4755,7 @@ } ], "traits": { - "smithy.api#documentation": "

Stops an active session for an Amazon Q App.This deletes all data \n related to the session and makes it invalid for future uses. The \n results of the session will be persisted as part of the conversation.

", + "smithy.api#documentation": "

Stops an active session for an Amazon Q App.This deletes all data\n related to the session and makes it invalid for future uses. The\n results of the session will be persisted as part of the conversation.

", "smithy.api#http": { "method": "POST", "uri": "/runtime.deleteMiniAppRun" @@ -4569,7 +5034,7 @@ } }, "traits": { - "smithy.api#documentation": "

The requested operation could not be completed because too many \n requests were sent at once. Wait a bit and try again later.

", + "smithy.api#documentation": "

The requested operation could not be completed because too many\n requests were sent at once. Wait a bit and try again later.

", "smithy.api#error": "client", "smithy.api#httpError": 429, "smithy.api#retryable": { @@ -4592,7 +5057,7 @@ "com.amazonaws.qapps#UUID": { "type": "string", "traits": { - "smithy.api#pattern": "^[\\da-f]{8}-[\\da-f]{4}-4[\\da-f]{3}-[89ABab][\\da-f]{3}-[\\da-f]{12}$" + "smithy.api#pattern": "^[\\da-f]{8}-[\\da-f]{4}-[45][\\da-f]{3}-[89ABab][\\da-f]{3}-[\\da-f]{12}$" } }, "com.amazonaws.qapps#UnauthorizedException": { @@ -5223,7 +5688,7 @@ } ], "traits": { - "smithy.api#documentation": "

Updates the session for a given Q App sessionId. This is only \n valid when at least one card of the session is in the WAITING state. \n Data for each WAITING card can be provided as input. If inputs \n are not provided, the call will be accepted but session will not move forward. \n Inputs for cards that are not in the WAITING status will be ignored.

", + "smithy.api#documentation": "

Updates the session for a given Q App sessionId. This is only\n valid when at least one card of the session is in the WAITING state.\n Data for each WAITING card can be provided as input. If inputs\n are not provided, the call will be accepted but session will not move forward.\n Inputs for cards that are not in the WAITING status will be ignored.

", "smithy.api#http": { "method": "POST", "uri": "/runtime.updateQAppSession"