Skip to main content

library_items

Creates, updates, deletes, gets or lists a library_items resource.

Overview

Namelibrary_items
TypeResource
Idaws.qapps.library_items

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
app_idstringThe unique identifier of the Q App associated with the library item. (pattern: <code>[\da-f]{8}-[\da-f]{4}-[45][\da-f]{3}-[89ABab][\da-f]{3}-[\da-f]{12}</code>)
app_versionintegerThe version of the Q App associated with the library item.
categoriesarrayThe categories associated with the library item for discovery.
created_atstring (date-time)The date and time the library item was created.
created_bystringThe user who created the library item.
is_rated_by_userbooleanWhether the current user has rated the library item.
is_verifiedbooleanIndicates whether the library item has been verified.
library_item_idstringThe unique identifier of the library item. (pattern: <code>[\da-f]{8}-[\da-f]{4}-[45][\da-f]{3}-[89ABab][\da-f]{3}-[\da-f]{12}</code>)
rating_countintegerThe number of ratings the library item has received from users.
statusstringThe status of the library item, such as "Published".
updated_atstring (date-time)The date and time the library item was last updated.
updated_bystringThe user who last updated the library item.
user_countintegerThe number of users who have associated the Q App with their account.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_library_itemselectinstance-id, libraryItemId, regionappIdRetrieves details about a library item for an Amazon Q App, including its metadata, categories, ratings, and usage statistics.
list_library_itemsselectinstance-id, regionlimit, nextToken, categoryIdLists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.
create_library_iteminsertinstance-id, region, appId, appVersion, categoriesCreates a new library item for an Amazon Q App, allowing it to be discovered and used by other allowed users.
update_library_itemupdateinstance-id, region, libraryItemIdUpdates the library item for an Amazon Q App.
delete_library_itemdeleteinstance-id, regionDeletes a library item for an Amazon Q App, removing it from the library so it can no longer be discovered or used by other users.
associate_library_item_reviewexecinstance-id, region, libraryItemIdAssociates a rating or review for a library item with the user submitting the request. This increments the rating count for the specified library item.
disassociate_library_item_reviewexecinstance-id, region, libraryItemIdRemoves a rating or review previously submitted by the user for a library item.
update_library_item_metadataexecinstance-id, region, libraryItemIdUpdates the verification status of a library item for an Amazon Q App.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instance-idstringThe unique identifier of the Amazon Q Business application environment instance.
libraryItemIdstringThe unique identifier of the library item to retrieve.
regionstringAWS region (default: us-east-1)
appIdstringThe unique identifier of the Amazon Q App associated with the library item.
categoryIdstringOptional category to filter the library items by.
limitintegerThe maximum number of library items to return in the response.
nextTokenstringThe token to request the next page of results.

SELECT examples

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

SELECT
app_id,
app_version,
categories,
created_at,
created_by,
is_rated_by_user,
is_verified,
library_item_id,
rating_count,
status,
updated_at,
updated_by,
user_count
FROM aws.qapps.library_items
WHERE `instance-id` = '{{ instance-id }}' -- required
AND libraryItemId = '{{ libraryItemId }}' -- required
AND region = '{{ region }}' -- required
AND appId = '{{ appId }}'
;

INSERT examples

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

INSERT INTO aws.qapps.library_items (
appId,
appVersion,
categories,
`instance-id`,
region
)
SELECT
'{{ appId }}' /* required */,
{{ appVersion }} /* required */,
'{{ categories }}' /* required */,
'{{ instance-id }}',
'{{ region }}'
RETURNING
created_at,
created_by,
is_verified,
library_item_id,
rating_count,
status,
updated_at,
updated_by
;

UPDATE examples

Updates the library item for an Amazon Q App.

UPDATE aws.qapps.library_items
SET
libraryItemId = '{{ libraryItemId }}',
status = '{{ status }}',
categories = '{{ categories }}'
WHERE
`instance-id` = '{{ instance-id }}' --required
AND region = '{{ region }}' --required
AND libraryItemId = '{{ libraryItemId }}' --required
RETURNING
app_id,
app_version,
categories,
created_at,
created_by,
is_rated_by_user,
is_verified,
library_item_id,
rating_count,
status,
updated_at,
updated_by,
user_count;

DELETE examples

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

DELETE FROM aws.qapps.library_items
WHERE `instance-id` = '{{ instance-id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

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

EXEC aws.qapps.library_items.associate_library_item_review
@instance-id='{{ instance-id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"libraryItemId": "{{ libraryItemId }}"
}'
;