Skip to content

Commit 9e3e6fb

Browse files
author
awstools
committed
feat(client-qapps): Introduces category apis in AmazonQApps. Web experience users use Categories to tag and filter library items.
1 parent 6860b35 commit 9e3e6fb

15 files changed

+1518
-24
lines changed

clients/client-qapps/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,30 @@ AssociateQAppWithUser
231231

232232
[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/)
233233

234+
</details>
235+
<details>
236+
<summary>
237+
BatchCreateCategory
238+
</summary>
239+
240+
[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/)
241+
242+
</details>
243+
<details>
244+
<summary>
245+
BatchDeleteCategory
246+
</summary>
247+
248+
[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/)
249+
250+
</details>
251+
<details>
252+
<summary>
253+
BatchUpdateCategory
254+
</summary>
255+
256+
[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/)
257+
234258
</details>
235259
<details>
236260
<summary>
@@ -311,6 +335,14 @@ ImportDocument
311335

312336
[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/)
313337

338+
</details>
339+
<details>
340+
<summary>
341+
ListCategories
342+
</summary>
343+
344+
[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/)
345+
314346
</details>
315347
<details>
316348
<summary>

clients/client-qapps/src/QApps.ts

+89
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ import {
1212
AssociateQAppWithUserCommandInput,
1313
AssociateQAppWithUserCommandOutput,
1414
} from "./commands/AssociateQAppWithUserCommand";
15+
import {
16+
BatchCreateCategoryCommand,
17+
BatchCreateCategoryCommandInput,
18+
BatchCreateCategoryCommandOutput,
19+
} from "./commands/BatchCreateCategoryCommand";
20+
import {
21+
BatchDeleteCategoryCommand,
22+
BatchDeleteCategoryCommandInput,
23+
BatchDeleteCategoryCommandOutput,
24+
} from "./commands/BatchDeleteCategoryCommand";
25+
import {
26+
BatchUpdateCategoryCommand,
27+
BatchUpdateCategoryCommandInput,
28+
BatchUpdateCategoryCommandOutput,
29+
} from "./commands/BatchUpdateCategoryCommand";
1530
import {
1631
CreateLibraryItemCommand,
1732
CreateLibraryItemCommandInput,
@@ -50,6 +65,11 @@ import {
5065
ImportDocumentCommandInput,
5166
ImportDocumentCommandOutput,
5267
} from "./commands/ImportDocumentCommand";
68+
import {
69+
ListCategoriesCommand,
70+
ListCategoriesCommandInput,
71+
ListCategoriesCommandOutput,
72+
} from "./commands/ListCategoriesCommand";
5373
import {
5474
ListLibraryItemsCommand,
5575
ListLibraryItemsCommandInput,
@@ -99,6 +119,9 @@ import { QAppsClient, QAppsClientConfig } from "./QAppsClient";
99119
const commands = {
100120
AssociateLibraryItemReviewCommand,
101121
AssociateQAppWithUserCommand,
122+
BatchCreateCategoryCommand,
123+
BatchDeleteCategoryCommand,
124+
BatchUpdateCategoryCommand,
102125
CreateLibraryItemCommand,
103126
CreateQAppCommand,
104127
DeleteLibraryItemCommand,
@@ -109,6 +132,7 @@ const commands = {
109132
GetQAppCommand,
110133
GetQAppSessionCommand,
111134
ImportDocumentCommand,
135+
ListCategoriesCommand,
112136
ListLibraryItemsCommand,
113137
ListQAppsCommand,
114138
ListTagsForResourceCommand,
@@ -158,6 +182,57 @@ export interface QApps {
158182
cb: (err: any, data?: AssociateQAppWithUserCommandOutput) => void
159183
): void;
160184

185+
/**
186+
* @see {@link BatchCreateCategoryCommand}
187+
*/
188+
batchCreateCategory(
189+
args: BatchCreateCategoryCommandInput,
190+
options?: __HttpHandlerOptions
191+
): Promise<BatchCreateCategoryCommandOutput>;
192+
batchCreateCategory(
193+
args: BatchCreateCategoryCommandInput,
194+
cb: (err: any, data?: BatchCreateCategoryCommandOutput) => void
195+
): void;
196+
batchCreateCategory(
197+
args: BatchCreateCategoryCommandInput,
198+
options: __HttpHandlerOptions,
199+
cb: (err: any, data?: BatchCreateCategoryCommandOutput) => void
200+
): void;
201+
202+
/**
203+
* @see {@link BatchDeleteCategoryCommand}
204+
*/
205+
batchDeleteCategory(
206+
args: BatchDeleteCategoryCommandInput,
207+
options?: __HttpHandlerOptions
208+
): Promise<BatchDeleteCategoryCommandOutput>;
209+
batchDeleteCategory(
210+
args: BatchDeleteCategoryCommandInput,
211+
cb: (err: any, data?: BatchDeleteCategoryCommandOutput) => void
212+
): void;
213+
batchDeleteCategory(
214+
args: BatchDeleteCategoryCommandInput,
215+
options: __HttpHandlerOptions,
216+
cb: (err: any, data?: BatchDeleteCategoryCommandOutput) => void
217+
): void;
218+
219+
/**
220+
* @see {@link BatchUpdateCategoryCommand}
221+
*/
222+
batchUpdateCategory(
223+
args: BatchUpdateCategoryCommandInput,
224+
options?: __HttpHandlerOptions
225+
): Promise<BatchUpdateCategoryCommandOutput>;
226+
batchUpdateCategory(
227+
args: BatchUpdateCategoryCommandInput,
228+
cb: (err: any, data?: BatchUpdateCategoryCommandOutput) => void
229+
): void;
230+
batchUpdateCategory(
231+
args: BatchUpdateCategoryCommandInput,
232+
options: __HttpHandlerOptions,
233+
cb: (err: any, data?: BatchUpdateCategoryCommandOutput) => void
234+
): void;
235+
161236
/**
162237
* @see {@link CreateLibraryItemCommand}
163238
*/
@@ -301,6 +376,20 @@ export interface QApps {
301376
cb: (err: any, data?: ImportDocumentCommandOutput) => void
302377
): void;
303378

379+
/**
380+
* @see {@link ListCategoriesCommand}
381+
*/
382+
listCategories(
383+
args: ListCategoriesCommandInput,
384+
options?: __HttpHandlerOptions
385+
): Promise<ListCategoriesCommandOutput>;
386+
listCategories(args: ListCategoriesCommandInput, cb: (err: any, data?: ListCategoriesCommandOutput) => void): void;
387+
listCategories(
388+
args: ListCategoriesCommandInput,
389+
options: __HttpHandlerOptions,
390+
cb: (err: any, data?: ListCategoriesCommandOutput) => void
391+
): void;
392+
304393
/**
305394
* @see {@link ListLibraryItemsCommand}
306395
*/

clients/client-qapps/src/QAppsClient.ts

+21
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ import {
6161
AssociateQAppWithUserCommandInput,
6262
AssociateQAppWithUserCommandOutput,
6363
} from "./commands/AssociateQAppWithUserCommand";
64+
import {
65+
BatchCreateCategoryCommandInput,
66+
BatchCreateCategoryCommandOutput,
67+
} from "./commands/BatchCreateCategoryCommand";
68+
import {
69+
BatchDeleteCategoryCommandInput,
70+
BatchDeleteCategoryCommandOutput,
71+
} from "./commands/BatchDeleteCategoryCommand";
72+
import {
73+
BatchUpdateCategoryCommandInput,
74+
BatchUpdateCategoryCommandOutput,
75+
} from "./commands/BatchUpdateCategoryCommand";
6476
import { CreateLibraryItemCommandInput, CreateLibraryItemCommandOutput } from "./commands/CreateLibraryItemCommand";
6577
import { CreateQAppCommandInput, CreateQAppCommandOutput } from "./commands/CreateQAppCommand";
6678
import { DeleteLibraryItemCommandInput, DeleteLibraryItemCommandOutput } from "./commands/DeleteLibraryItemCommand";
@@ -77,6 +89,7 @@ import { GetLibraryItemCommandInput, GetLibraryItemCommandOutput } from "./comma
7789
import { GetQAppCommandInput, GetQAppCommandOutput } from "./commands/GetQAppCommand";
7890
import { GetQAppSessionCommandInput, GetQAppSessionCommandOutput } from "./commands/GetQAppSessionCommand";
7991
import { ImportDocumentCommandInput, ImportDocumentCommandOutput } from "./commands/ImportDocumentCommand";
92+
import { ListCategoriesCommandInput, ListCategoriesCommandOutput } from "./commands/ListCategoriesCommand";
8093
import { ListLibraryItemsCommandInput, ListLibraryItemsCommandOutput } from "./commands/ListLibraryItemsCommand";
8194
import { ListQAppsCommandInput, ListQAppsCommandOutput } from "./commands/ListQAppsCommand";
8295
import {
@@ -112,6 +125,9 @@ export { __Client };
112125
export type ServiceInputTypes =
113126
| AssociateLibraryItemReviewCommandInput
114127
| AssociateQAppWithUserCommandInput
128+
| BatchCreateCategoryCommandInput
129+
| BatchDeleteCategoryCommandInput
130+
| BatchUpdateCategoryCommandInput
115131
| CreateLibraryItemCommandInput
116132
| CreateQAppCommandInput
117133
| DeleteLibraryItemCommandInput
@@ -122,6 +138,7 @@ export type ServiceInputTypes =
122138
| GetQAppCommandInput
123139
| GetQAppSessionCommandInput
124140
| ImportDocumentCommandInput
141+
| ListCategoriesCommandInput
125142
| ListLibraryItemsCommandInput
126143
| ListQAppsCommandInput
127144
| ListTagsForResourceCommandInput
@@ -141,6 +158,9 @@ export type ServiceInputTypes =
141158
export type ServiceOutputTypes =
142159
| AssociateLibraryItemReviewCommandOutput
143160
| AssociateQAppWithUserCommandOutput
161+
| BatchCreateCategoryCommandOutput
162+
| BatchDeleteCategoryCommandOutput
163+
| BatchUpdateCategoryCommandOutput
144164
| CreateLibraryItemCommandOutput
145165
| CreateQAppCommandOutput
146166
| DeleteLibraryItemCommandOutput
@@ -151,6 +171,7 @@ export type ServiceOutputTypes =
151171
| GetQAppCommandOutput
152172
| GetQAppSessionCommandOutput
153173
| ImportDocumentCommandOutput
174+
| ListCategoriesCommandOutput
154175
| ListLibraryItemsCommandOutput
155176
| ListQAppsCommandOutput
156177
| ListTagsForResourceCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { BatchCreateCategoryInput } from "../models/models_0";
9+
import { de_BatchCreateCategoryCommand, se_BatchCreateCategoryCommand } from "../protocols/Aws_restJson1";
10+
import { QAppsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QAppsClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link BatchCreateCategoryCommand}.
21+
*/
22+
export interface BatchCreateCategoryCommandInput extends BatchCreateCategoryInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link BatchCreateCategoryCommand}.
27+
*/
28+
export interface BatchCreateCategoryCommandOutput extends __MetadataBearer {}
29+
30+
/**
31+
* <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>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { QAppsClient, BatchCreateCategoryCommand } from "@aws-sdk/client-qapps"; // ES Modules import
36+
* // const { QAppsClient, BatchCreateCategoryCommand } = require("@aws-sdk/client-qapps"); // CommonJS import
37+
* const client = new QAppsClient(config);
38+
* const input = { // BatchCreateCategoryInput
39+
* instanceId: "STRING_VALUE", // required
40+
* categories: [ // BatchCreateCategoryInputCategoryList // required
41+
* { // BatchCreateCategoryInputCategory
42+
* id: "STRING_VALUE",
43+
* title: "STRING_VALUE", // required
44+
* color: "STRING_VALUE",
45+
* },
46+
* ],
47+
* };
48+
* const command = new BatchCreateCategoryCommand(input);
49+
* const response = await client.send(command);
50+
* // {};
51+
*
52+
* ```
53+
*
54+
* @param BatchCreateCategoryCommandInput - {@link BatchCreateCategoryCommandInput}
55+
* @returns {@link BatchCreateCategoryCommandOutput}
56+
* @see {@link BatchCreateCategoryCommandInput} for command's `input` shape.
57+
* @see {@link BatchCreateCategoryCommandOutput} for command's `response` shape.
58+
* @see {@link QAppsClientResolvedConfig | config} for QAppsClient's `config` shape.
59+
*
60+
* @throws {@link AccessDeniedException} (client fault)
61+
* <p>The client is not authorized to perform the requested operation.</p>
62+
*
63+
* @throws {@link ConflictException} (client fault)
64+
* <p>The requested operation could not be completed due to a
65+
* conflict with the current state of the resource.</p>
66+
*
67+
* @throws {@link InternalServerException} (server fault)
68+
* <p>An internal service error occurred while processing the request.</p>
69+
*
70+
* @throws {@link ResourceNotFoundException} (client fault)
71+
* <p>The requested resource could not be found.</p>
72+
*
73+
* @throws {@link ThrottlingException} (client fault)
74+
* <p>The requested operation could not be completed because too many
75+
* requests were sent at once. Wait a bit and try again later.</p>
76+
*
77+
* @throws {@link UnauthorizedException} (client fault)
78+
* <p>The client is not authenticated or authorized to perform the requested operation.</p>
79+
*
80+
* @throws {@link ValidationException} (client fault)
81+
* <p>The input failed to satisfy the constraints specified by the service.</p>
82+
*
83+
* @throws {@link QAppsServiceException}
84+
* <p>Base exception class for all service exceptions from QApps service.</p>
85+
*
86+
* @public
87+
* @example Creates the categories for the library
88+
* ```javascript
89+
* //
90+
* const input = {
91+
* "categories": [
92+
* {
93+
* "id": "549abfe0-f5c4-45a2-bb9b-c05987a49c6d",
94+
* "title": "HR"
95+
* },
96+
* {
97+
* "id": "18cbebaa-196a-4aa5-a840-88d548e07f8f",
98+
* "title": "Marketing"
99+
* }
100+
* ],
101+
* "instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f"
102+
* };
103+
* const command = new BatchCreateCategoryCommand(input);
104+
* await client.send(command);
105+
* // example id: example-1
106+
* ```
107+
*
108+
*/
109+
export class BatchCreateCategoryCommand extends $Command
110+
.classBuilder<
111+
BatchCreateCategoryCommandInput,
112+
BatchCreateCategoryCommandOutput,
113+
QAppsClientResolvedConfig,
114+
ServiceInputTypes,
115+
ServiceOutputTypes
116+
>()
117+
.ep(commonParams)
118+
.m(function (this: any, Command: any, cs: any, config: QAppsClientResolvedConfig, o: any) {
119+
return [
120+
getSerdePlugin(config, this.serialize, this.deserialize),
121+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
122+
];
123+
})
124+
.s("QAppsService", "BatchCreateCategory", {})
125+
.n("QAppsClient", "BatchCreateCategoryCommand")
126+
.f(void 0, void 0)
127+
.ser(se_BatchCreateCategoryCommand)
128+
.de(de_BatchCreateCategoryCommand)
129+
.build() {
130+
/** @internal type navigation helper, not in runtime. */
131+
protected declare static __types: {
132+
api: {
133+
input: BatchCreateCategoryInput;
134+
output: {};
135+
};
136+
sdk: {
137+
input: BatchCreateCategoryCommandInput;
138+
output: BatchCreateCategoryCommandOutput;
139+
};
140+
};
141+
}

0 commit comments

Comments
 (0)