Skip to content

Commit

Permalink
feat(client-qapps): Adds UpdateLibraryItemMetadata api to change stat…
Browse files Browse the repository at this point in the history
…us of app for admin verification feature and returns isVerified field in any api returning the app or library item.
  • Loading branch information
awstools committed Sep 6, 2024
1 parent 6ce1172 commit 058537c
Show file tree
Hide file tree
Showing 16 changed files with 486 additions and 68 deletions.
23 changes: 18 additions & 5 deletions clients/client-qapps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ AWS SDK for JavaScript QApps Client for Node.js, Browser and React Native.

<p>The Amazon Q Apps feature capability within Amazon Q Business allows web experience
users to create lightweight, purpose-built AI apps to fulfill specific tasks from
within their web experience. For example, users can create an Q Appthat exclusively
within their web experience. For example, users can create a Q App that exclusively
generates marketing-related content to improve your marketing team's productivity or a
Q App for marketing content-generation like writing customer emails and creating
promotional content using a certain style of voice, tone, and branding.
For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/purpose-built-qapps.html">Amazon Q App</a> in the
<i>Amazon Q Business User Guide</i>.
Q App for writing customer emails and creating promotional content using a certain
style of voice, tone, and branding. For more information on the capabilities, see
<a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html#q-apps-actions">Amazon Q Apps capabilities</a> in the <i>Amazon Q Business User Guide</i>.
</p>
<p>For an overview of the Amazon Q App APIs, see <a href="https://docs.aws.amazon.com/amazonq/latest/api-reference/API_Operations_QApps.html">Overview of
Amazon Q Apps API operations</a>.</p>
<p>For information about the IAM access control permissions you need to
use the Amazon Q Apps API, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html">
IAM role for the Amazon Q Business web experience including Amazon Q Apps</a> in the
<i>Amazon Q Business User Guide</i>.</p>

## Installing

Expand Down Expand Up @@ -378,6 +383,14 @@ UpdateLibraryItem

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

</details>
<details>
<summary>
UpdateLibraryItemMetadata
</summary>

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

</details>
<details>
<summary>
Expand Down
38 changes: 33 additions & 5 deletions clients/client-qapps/src/QApps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ import {
UpdateLibraryItemCommandInput,
UpdateLibraryItemCommandOutput,
} from "./commands/UpdateLibraryItemCommand";
import {
UpdateLibraryItemMetadataCommand,
UpdateLibraryItemMetadataCommandInput,
UpdateLibraryItemMetadataCommandOutput,
} from "./commands/UpdateLibraryItemMetadataCommand";
import { UpdateQAppCommand, UpdateQAppCommandInput, UpdateQAppCommandOutput } from "./commands/UpdateQAppCommand";
import {
UpdateQAppSessionCommand,
Expand Down Expand Up @@ -113,6 +118,7 @@ const commands = {
TagResourceCommand,
UntagResourceCommand,
UpdateLibraryItemCommand,
UpdateLibraryItemMetadataCommand,
UpdateQAppCommand,
UpdateQAppSessionCommand,
};
Expand Down Expand Up @@ -421,6 +427,23 @@ export interface QApps {
cb: (err: any, data?: UpdateLibraryItemCommandOutput) => void
): void;

/**
* @see {@link UpdateLibraryItemMetadataCommand}
*/
updateLibraryItemMetadata(
args: UpdateLibraryItemMetadataCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateLibraryItemMetadataCommandOutput>;
updateLibraryItemMetadata(
args: UpdateLibraryItemMetadataCommandInput,
cb: (err: any, data?: UpdateLibraryItemMetadataCommandOutput) => void
): void;
updateLibraryItemMetadata(
args: UpdateLibraryItemMetadataCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateLibraryItemMetadataCommandOutput) => void
): void;

/**
* @see {@link UpdateQAppCommand}
*/
Expand Down Expand Up @@ -453,13 +476,18 @@ export interface QApps {
/**
* <p>The Amazon Q Apps feature capability within Amazon Q Business allows web experience
* users to create lightweight, purpose-built AI apps to fulfill specific tasks from
* within their web experience. For example, users can create an Q Appthat exclusively
* within their web experience. For example, users can create a Q App that exclusively
* generates marketing-related content to improve your marketing team's productivity or a
* Q App for marketing content-generation like writing customer emails and creating
* promotional content using a certain style of voice, tone, and branding.
* For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/purpose-built-qapps.html">Amazon Q App</a> in the
* <i>Amazon Q Business User Guide</i>.
* Q App for writing customer emails and creating promotional content using a certain
* style of voice, tone, and branding. For more information on the capabilities, see
* <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html#q-apps-actions">Amazon Q Apps capabilities</a> in the <i>Amazon Q Business User Guide</i>.
* </p>
* <p>For an overview of the Amazon Q App APIs, see <a href="https://docs.aws.amazon.com/amazonq/latest/api-reference/API_Operations_QApps.html">Overview of
* Amazon Q Apps API operations</a>.</p>
* <p>For information about the IAM access control permissions you need to
* use the Amazon Q Apps API, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html">
* IAM role for the Amazon Q Business web experience including Amazon Q Apps</a> in the
* <i>Amazon Q Business User Guide</i>.</p>
* @public
*/
export class QApps extends QAppsClient implements QApps {}
Expand Down
21 changes: 16 additions & 5 deletions clients/client-qapps/src/QAppsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ import { StopQAppSessionCommandInput, StopQAppSessionCommandOutput } from "./com
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import { UpdateLibraryItemCommandInput, UpdateLibraryItemCommandOutput } from "./commands/UpdateLibraryItemCommand";
import {
UpdateLibraryItemMetadataCommandInput,
UpdateLibraryItemMetadataCommandOutput,
} from "./commands/UpdateLibraryItemMetadataCommand";
import { UpdateQAppCommandInput, UpdateQAppCommandOutput } from "./commands/UpdateQAppCommand";
import { UpdateQAppSessionCommandInput, UpdateQAppSessionCommandOutput } from "./commands/UpdateQAppSessionCommand";
import {
Expand Down Expand Up @@ -127,6 +131,7 @@ export type ServiceInputTypes =
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateLibraryItemCommandInput
| UpdateLibraryItemMetadataCommandInput
| UpdateQAppCommandInput
| UpdateQAppSessionCommandInput;

Expand Down Expand Up @@ -155,6 +160,7 @@ export type ServiceOutputTypes =
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateLibraryItemCommandOutput
| UpdateLibraryItemMetadataCommandOutput
| UpdateQAppCommandOutput
| UpdateQAppSessionCommandOutput;

Expand Down Expand Up @@ -332,13 +338,18 @@ export interface QAppsClientResolvedConfig extends QAppsClientResolvedConfigType
/**
* <p>The Amazon Q Apps feature capability within Amazon Q Business allows web experience
* users to create lightweight, purpose-built AI apps to fulfill specific tasks from
* within their web experience. For example, users can create an Q Appthat exclusively
* within their web experience. For example, users can create a Q App that exclusively
* generates marketing-related content to improve your marketing team's productivity or a
* Q App for marketing content-generation like writing customer emails and creating
* promotional content using a certain style of voice, tone, and branding.
* For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/purpose-built-qapps.html">Amazon Q App</a> in the
* <i>Amazon Q Business User Guide</i>.
* Q App for writing customer emails and creating promotional content using a certain
* style of voice, tone, and branding. For more information on the capabilities, see
* <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html#q-apps-actions">Amazon Q Apps capabilities</a> in the <i>Amazon Q Business User Guide</i>.
* </p>
* <p>For an overview of the Amazon Q App APIs, see <a href="https://docs.aws.amazon.com/amazonq/latest/api-reference/API_Operations_QApps.html">Overview of
* Amazon Q Apps API operations</a>.</p>
* <p>For information about the IAM access control permissions you need to
* use the Amazon Q Apps API, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html">
* IAM role for the Amazon Q Business web experience including Amazon Q Apps</a> in the
* <i>Amazon Q Business User Guide</i>.</p>
* @public
*/
export class QAppsClient extends __Client<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export interface AssociateLibraryItemReviewCommandOutput extends __MetadataBeare
* @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>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface CreateLibraryItemCommandOutput extends CreateLibraryItemOutput,
* // updatedAt: new Date("TIMESTAMP"),
* // updatedBy: "STRING_VALUE",
* // ratingCount: Number("int"), // required
* // isVerified: true || false,
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export interface DisassociateLibraryItemReviewCommandOutput extends __MetadataBe
* @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>
*
Expand Down
1 change: 1 addition & 0 deletions clients/client-qapps/src/commands/GetLibraryItemCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface GetLibraryItemCommandOutput extends GetLibraryItemOutput, __Met
* // ratingCount: Number("int"), // required
* // isRatedByUser: true || false,
* // userCount: Number("int"),
* // isVerified: true || false,
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface ListLibraryItemsCommandOutput extends ListLibraryItemsOutput, _
* // ratingCount: Number("int"), // required
* // isRatedByUser: true || false,
* // userCount: Number("int"),
* // isVerified: true || false,
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
1 change: 1 addition & 0 deletions clients/client-qapps/src/commands/ListQAppsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface ListQAppsCommandOutput extends ListQAppsOutput, __MetadataBeare
* // createdAt: new Date("TIMESTAMP"), // required
* // canEdit: true || false,
* // status: "STRING_VALUE",
* // isVerified: true || false,
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface UpdateLibraryItemCommandInput extends UpdateLibraryItemInput {}
export interface UpdateLibraryItemCommandOutput extends UpdateLibraryItemOutput, __MetadataBearer {}

/**
* <p>Updates the metadata and status of a library item for an Amazon Q App.</p>
* <p>Updates the library item for an Amazon Q App.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -63,6 +63,7 @@ export interface UpdateLibraryItemCommandOutput extends UpdateLibraryItemOutput,
* // ratingCount: Number("int"), // required
* // isRatedByUser: true || false,
* // userCount: Number("int"),
* // isVerified: true || false,
* // };
*
* ```
Expand All @@ -76,6 +77,10 @@ export interface UpdateLibraryItemCommandOutput extends UpdateLibraryItemOutput,
* @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>
*
Expand Down
105 changes: 105 additions & 0 deletions clients/client-qapps/src/commands/UpdateLibraryItemMetadataCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// 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 { UpdateLibraryItemMetadataInput } from "../models/models_0";
import { de_UpdateLibraryItemMetadataCommand, se_UpdateLibraryItemMetadataCommand } from "../protocols/Aws_restJson1";
import { QAppsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QAppsClient";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link UpdateLibraryItemMetadataCommand}.
*/
export interface UpdateLibraryItemMetadataCommandInput extends UpdateLibraryItemMetadataInput {}
/**
* @public
*
* The output of {@link UpdateLibraryItemMetadataCommand}.
*/
export interface UpdateLibraryItemMetadataCommandOutput extends __MetadataBearer {}

/**
* <p>Updates the verification status of a library item for an Amazon Q App.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { QAppsClient, UpdateLibraryItemMetadataCommand } from "@aws-sdk/client-qapps"; // ES Modules import
* // const { QAppsClient, UpdateLibraryItemMetadataCommand } = require("@aws-sdk/client-qapps"); // CommonJS import
* const client = new QAppsClient(config);
* const input = { // UpdateLibraryItemMetadataInput
* instanceId: "STRING_VALUE", // required
* libraryItemId: "STRING_VALUE", // required
* isVerified: true || false,
* };
* const command = new UpdateLibraryItemMetadataCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param UpdateLibraryItemMetadataCommandInput - {@link UpdateLibraryItemMetadataCommandInput}
* @returns {@link UpdateLibraryItemMetadataCommandOutput}
* @see {@link UpdateLibraryItemMetadataCommandInput} for command's `input` shape.
* @see {@link UpdateLibraryItemMetadataCommandOutput} 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
*/
export class UpdateLibraryItemMetadataCommand extends $Command
.classBuilder<
UpdateLibraryItemMetadataCommandInput,
UpdateLibraryItemMetadataCommandOutput,
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", "UpdateLibraryItemMetadata", {})
.n("QAppsClient", "UpdateLibraryItemMetadataCommand")
.f(void 0, void 0)
.ser(se_UpdateLibraryItemMetadataCommand)
.de(de_UpdateLibraryItemMetadataCommand)
.build() {}
1 change: 1 addition & 0 deletions clients/client-qapps/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ export * from "./StopQAppSessionCommand";
export * from "./TagResourceCommand";
export * from "./UntagResourceCommand";
export * from "./UpdateLibraryItemCommand";
export * from "./UpdateLibraryItemMetadataCommand";
export * from "./UpdateQAppCommand";
export * from "./UpdateQAppSessionCommand";
15 changes: 10 additions & 5 deletions clients/client-qapps/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
/**
* <p>The Amazon Q Apps feature capability within Amazon Q Business allows web experience
* users to create lightweight, purpose-built AI apps to fulfill specific tasks from
* within their web experience. For example, users can create an Q Appthat exclusively
* within their web experience. For example, users can create a Q App that exclusively
* generates marketing-related content to improve your marketing team's productivity or a
* Q App for marketing content-generation like writing customer emails and creating
* promotional content using a certain style of voice, tone, and branding.
* For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/purpose-built-qapps.html">Amazon Q App</a> in the
* <i>Amazon Q Business User Guide</i>.
* Q App for writing customer emails and creating promotional content using a certain
* style of voice, tone, and branding. For more information on the capabilities, see
* <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html#q-apps-actions">Amazon Q Apps capabilities</a> in the <i>Amazon Q Business User Guide</i>.
* </p>
* <p>For an overview of the Amazon Q App APIs, see <a href="https://docs.aws.amazon.com/amazonq/latest/api-reference/API_Operations_QApps.html">Overview of
* Amazon Q Apps API operations</a>.</p>
* <p>For information about the IAM access control permissions you need to
* use the Amazon Q Apps API, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html">
* IAM role for the Amazon Q Business web experience including Amazon Q Apps</a> in the
* <i>Amazon Q Business User Guide</i>.</p>
*
* @packageDocumentation
*/
Expand Down
Loading

0 comments on commit 058537c

Please sign in to comment.