Skip to content

update_library_item

update_library_item(
    instance_id: InstanceId,
    library_item_id: UUID,
    *,
    config_overrides: Optional[QAppsClientConfig] = None,
    status: Optional[LibraryItemStatus] = None,
    categories: Optional[CategoryIdList] = None,
) -> UpdateLibraryItemOutput

Updates the library item for an Amazon Q App.

Parameters:

  • instance_id (InstanceId) –

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

  • library_item_id (UUID) –

    The unique identifier of the library item to update.

  • status (Optional[LibraryItemStatus], default: None ) –

    The new status to set for the library item, such as "Published" or "Hidden".

  • categories (Optional[CategoryIdList], default: None ) –

    The new categories to associate with the library item.

Raises:

  • AccessDeniedException –

    The client is not authorized to perform the requested operation.

  • ConflictException –

    The requested operation could not be completed due to a conflict with the current state of the resource.

  • InternalServerException –

    An internal service error occurred while processing the request.

  • ResourceNotFoundException –

    The requested resource could not be found.

  • ThrottlingException –

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

  • UnauthorizedException –

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

  • ValidationException –

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

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Sets the status of a library item to DISABLED

>>> client.update_library_item(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', library_item_id='cb9ecf72-8563-450d-9db9-994f98297316', status='DISABLED')
Source code in docs_src/capo_qapps/_services/q_apps.py
def update_library_item(
    self,
    instance_id: "capo_qapps.types.instance_id.InstanceId",
    library_item_id: "capo_qapps.types.uuid.UUID",
    *,
    config_overrides: Optional[QAppsClientConfig] = None,
    status: Optional[
        "capo_qapps.types.library_item_status.LibraryItemStatus"
    ] = None,
    categories: Optional["capo_qapps.types.category_id_list.CategoryIdList"] = None,
) -> "capo_qapps.types.update_library_item_output.UpdateLibraryItemOutput":
    """<p>Updates the library item for an Amazon Q App.</p>

    Args:
        instance_id: <p>The unique identifier of the Amazon Q Business application environment instance.</p>
        library_item_id: <p>The unique identifier of the library item to update.</p>
        status: <p>The new status to set for the library item, such as "Published" or "Hidden".</p>
        categories: <p>The new categories to associate with the library item.</p>

    Raises:
        capo_qapps.errors.access_denied_exception.AccessDeniedException: <p>The client is not authorized to perform the requested operation.</p>
        capo_qapps.errors.conflict_exception.ConflictException: <p>The requested operation could not be completed due to a conflict with the current state of the resource.</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:
        Sets the status of a library item to DISABLED

        >>> client.update_library_item(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', library_item_id='cb9ecf72-8563-450d-9db9-994f98297316', status='DISABLED')
    """

    def _handler(
        req: "OperationRequest[capo_qapps.types.update_library_item_input.UpdateLibraryItemInput]",
    ) -> OperationResponse[
        "capo_qapps.types.update_library_item_output.UpdateLibraryItemOutput"
    ]:
        import capo_qapps._operations.q_apps_service.update_library_item

        output, http_response = (
            capo_qapps._operations.q_apps_service.update_library_item.update_library_item(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLibraryItem")
    )
    input_: capo_qapps.types.update_library_item_input.UpdateLibraryItemInput = {
        "instance_id": instance_id,
        "library_item_id": library_item_id,
    }
    if status is not None:
        input_["status"] = status
    if categories is not None:
        input_["categories"] = categories

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output