Skip to content

list_library_items async

list_library_items(
    instance_id: InstanceId,
    *,
    config_overrides: Optional[AsyncQAppsClientConfig] = None,
    limit: Optional[PageLimit] = None,
    next_token: Optional[PaginationToken] = None,
    category_id: Optional[UUID] = None,
) -> ListLibraryItemsOutput

Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.

Parameters:

  • instance_id (InstanceId) –

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

  • limit (Optional[PageLimit], default: None ) –

    The maximum number of library items to return in the response.

  • next_token (Optional[PaginationToken], default: None ) –

    The token to request the next page of results.

  • category_id (Optional[UUID], default: None ) –

    Optional category to filter the library items by.

Raises:

Examples:

List at most 3 library items for this instance

>>> await client.list_library_items(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', limit=3)
Source code in docs_src/capo_qapps/_services/async_q_apps.py
async def list_library_items(
    self,
    instance_id: "capo_qapps.types.instance_id.InstanceId",
    *,
    config_overrides: Optional[AsyncQAppsClientConfig] = None,
    limit: Optional["capo_qapps.types.page_limit.PageLimit"] = None,
    next_token: Optional[
        "capo_qapps.types.pagination_token.PaginationToken"
    ] = None,
    category_id: Optional["capo_qapps.types.uuid.UUID"] = None,
) -> "capo_qapps.types.list_library_items_output.ListLibraryItemsOutput":
    """<p>Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.</p>

    Args:
        instance_id: <p>The unique identifier of the Amazon Q Business application environment instance.</p>
        limit: <p>The maximum number of library items to return in the response.</p>
        next_token: <p>The token to request the next page of results.</p>
        category_id: <p>Optional category to filter the library items by.</p>

    Raises:
        capo_qapps.errors.access_denied_exception.AccessDeniedException: <p>The client is not authorized to perform the requested operation.</p>
        capo_qapps.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred while processing the request.</p>
        capo_qapps.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_qapps.errors.throttling_exception.ThrottlingException: <p>The requested operation could not be completed because too many requests were sent at once. Wait a bit and try again later.</p>
        capo_qapps.errors.unauthorized_exception.UnauthorizedException: <p>The client is not authenticated or authorized to perform the requested operation.</p>
        capo_qapps.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by the service.</p>
        capo_qapps.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List at most 3 library items for this instance

        >>> await client.list_library_items(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', limit=3)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qapps.types.list_library_items_input.ListLibraryItemsInput]",
    ) -> AsyncOperationResponse[
        "capo_qapps.types.list_library_items_output.ListLibraryItemsOutput"
    ]:
        import capo_qapps._operations.q_apps_service.list_library_items

        (
            output,
            http_response,
        ) = await capo_qapps._operations.q_apps_service.list_library_items.async_list_library_items(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListLibraryItems")
    )
    input_: capo_qapps.types.list_library_items_input.ListLibraryItemsInput = {
        "instance_id": instance_id
    }
    if limit is not None:
        input_["limit"] = limit
    if next_token is not None:
        input_["next_token"] = next_token
    if category_id is not None:
        input_["category_id"] = category_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output