CreateLibraryItemCommand

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QAppsClient, CreateLibraryItemCommand } from "@aws-sdk/client-qapps"; // ES Modules import
// const { QAppsClient, CreateLibraryItemCommand } = require("@aws-sdk/client-qapps"); // CommonJS import
const client = new QAppsClient(config);
const input = { // CreateLibraryItemInput
  instanceId: "STRING_VALUE", // required
  appId: "STRING_VALUE", // required
  appVersion: Number("int"), // required
  categories: [ // CategoryIdList // required
    "STRING_VALUE",
  ],
};
const command = new CreateLibraryItemCommand(input);
const response = await client.send(command);
// { // CreateLibraryItemOutput
//   libraryItemId: "STRING_VALUE", // required
//   status: "STRING_VALUE", // required
//   createdAt: new Date("TIMESTAMP"), // required
//   createdBy: "STRING_VALUE", // required
//   updatedAt: new Date("TIMESTAMP"),
//   updatedBy: "STRING_VALUE",
//   ratingCount: Number("int"), // required
//   isVerified: true || false,
// };

Example Usage

//
const input = {
"appId": "7a11f34b-42d4-4bc8-b668-ae4a788dae1e",
"appVersion": 6,
"categories": [
"9c871ed4-1c41-4065-aefe-321cd4b61cf8"
],
"instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f"
};
const command = new CreateLibraryItemCommand(input);
const response = await client.send(command);
/* response ==
{
"createdAt": "2024-05-21T23:17:27.350Z",
"createdBy": "a841e300-40c1-7062-fa34-5b46dadbbaac",
"isVerified": false,
"libraryItemId": "cb9ecf72-8563-450d-9db9-994f98297316",
"ratingCount": 0,
"status": "PUBLISHED",
"updatedAt": "2024-05-21T23:17:27.350Z",
"updatedBy": "a841e300-40c1-7062-fa34-5b46dadbbaac"
}
*\/
// example id: example-1
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
JavaScriptLn 1, Col 1
Errors: 0 Warnings: 0

CreateLibraryItemCommand Input

See CreateLibraryItemCommandInput for more details

Parameter
Type
Description
appId
Required
string | undefined

The unique identifier of the Amazon Q App to publish to the library.

appVersion
Required
number | undefined

The version of the Amazon Q App to publish to the library.

categories
Required
string[] | undefined

The categories to associate with the library item for easier discovery.

instanceId
Required
string | undefined

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

CreateLibraryItemCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
createdAt
Required
Date | undefined

The date and time the library item was created.

createdBy
Required
string | undefined

The user who created the library item.

libraryItemId
Required
string | undefined

The unique identifier of the new library item.

ratingCount
Required
number | undefined

The number of ratings the library item has received from users.

status
Required
string | undefined

The status of the new library item, such as "Published".

isVerified
boolean | undefined

Indicates whether the library item has been verified.

updatedAt
Date | undefined

The date and time the library item was last updated.

updatedBy
string | undefined

The user who last updated the library item.

Throws

Name
Fault
Details
AccessDeniedException
client

The client is not authorized to perform the requested operation.

InternalServerException
server

An internal service error occurred while processing the request.

ResourceNotFoundException
client

The requested resource could not be found.

ServiceQuotaExceededException
client

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

ThrottlingException
client

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

UnauthorizedException
client

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

ValidationException
client

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

QAppsServiceException
Base exception class for all service exceptions from QApps service.