library_items
Creates, updates, deletes, gets or lists a library_items resource.
Overview
| Name | library_items |
| Type | Resource |
| Id | aws.qapps.library_items |
Fields
The following fields are returned by SELECT queries:
- get_library_item
- list_library_items
| Name | Datatype | Description |
|---|---|---|
app_id | string | The 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_version | integer | The version of the Q App associated with the library item. |
categories | array | The categories associated with the library item for discovery. |
created_at | string (date-time) | The date and time the library item was created. |
created_by | string | The user who created the library item. |
is_rated_by_user | boolean | Whether the current user has rated the library item. |
is_verified | boolean | Indicates whether the library item has been verified. |
library_item_id | string | The 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_count | integer | The number of ratings the library item has received from users. |
status | string | The status of the library item, such as "Published". |
updated_at | string (date-time) | The date and time the library item was last updated. |
updated_by | string | The user who last updated the library item. |
user_count | integer | The number of users who have associated the Q App with their account. |
| Name | Datatype | Description |
|---|---|---|
app_id | string | The 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_version | integer | The version of the Q App associated with the library item. |
categories | array | The categories associated with the library item. |
created_at | string (date-time) | The date and time the library item was created. |
created_by | string | The user who created the library item. |
is_rated_by_user | boolean | Whether the current user has rated the library item. |
is_verified | boolean | Indicates whether the library item has been verified. |
library_item_id | string | The 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_count | integer | The number of ratings the library item has received. |
status | string | The status of the library item. |
updated_at | string (date-time) | The date and time the library item was last updated. |
updated_by | string | The user who last updated the library item. |
user_count | integer | The number of users who have the associated Q App. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_library_item | select | instance-id, libraryItemId, region | appId | Retrieves details about a library item for an Amazon Q App, including its metadata, categories, ratings, and usage statistics. |
list_library_items | select | instance-id, region | limit, nextToken, categoryId | Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account. |
create_library_item | insert | instance-id, region, appId, appVersion, categories | Creates a new library item for an Amazon Q App, allowing it to be discovered and used by other allowed users. | |
update_library_item | update | instance-id, region, libraryItemId | Updates the library item for an Amazon Q App. | |
delete_library_item | delete | instance-id, region | 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. | |
associate_library_item_review | exec | instance-id, region, libraryItemId | 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. | |
disassociate_library_item_review | exec | instance-id, region, libraryItemId | Removes a rating or review previously submitted by the user for a library item. | |
update_library_item_metadata | exec | instance-id, region, libraryItemId | Updates 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.
| Name | Datatype | Description |
|---|---|---|
instance-id | string | The unique identifier of the Amazon Q Business application environment instance. |
libraryItemId | string | The unique identifier of the library item to retrieve. |
region | string | AWS region (default: us-east-1) |
appId | string | The unique identifier of the Amazon Q App associated with the library item. |
categoryId | string | Optional category to filter the library items by. |
limit | integer | The maximum number of library items to return in the response. |
nextToken | string | The token to request the next page of results. |
SELECT examples
- get_library_item
- list_library_items
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 }}'
;
Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.
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 region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND nextToken = '{{ nextToken }}'
AND categoryId = '{{ categoryId }}'
;
INSERT examples
- create_library_item
- Manifest
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
;
# Description fields are for documentation purposes
- name: library_items
props:
- name: instance-id
value: "{{ instance-id }}"
description: Required parameter for the library_items resource.
- name: region
value: "{{ region }}"
description: Required parameter for the library_items resource.
- name: appId
value: "{{ appId }}"
- name: appVersion
value: {{ appVersion }}
- name: categories
value:
- "{{ categories }}"
UPDATE examples
- update_library_item
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
- delete_library_item
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
- associate_library_item_review
- disassociate_library_item_review
- update_library_item_metadata
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 }}"
}'
;
Removes a rating or review previously submitted by the user for a library item.
EXEC aws.qapps.library_items.disassociate_library_item_review
@instance-id='{{ instance-id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"libraryItemId": "{{ libraryItemId }}"
}'
;
Updates the verification status of a library item for an Amazon Q App.
EXEC aws.qapps.library_items.update_library_item_metadata
@instance-id='{{ instance-id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"libraryItemId": "{{ libraryItemId }}",
"isVerified": {{ isVerified }}
}'
;