Skip to content

batch_update_category async

batch_update_category(
    instance_id: InstanceId,
    categories: CategoryListInput,
    *,
    config_overrides: Optional[AsyncQAppsClientConfig] = None,
) -> None

Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.

Parameters:

  • instance_id (InstanceId) –

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

  • categories (CategoryListInput) –

    The list of categories to be updated with their new values.

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:

Updates the categories in the library

>>> await client.batch_update_category(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', categories=[{'id': '549abfe0-f5c4-45a2-bb9b-c05987a49c6d', 'title': 'HR Management'}, {'id': '18cbebaa-196a-4aa5-a840-88d548e07f8f', 'title': 'Sales'}])
Source code in docs_src/capo_qapps/_services/async_q_apps.py
async def batch_update_category(
    self,
    instance_id: "capo_qapps.types.instance_id.InstanceId",
    categories: "capo_qapps.types.category_list_input.CategoryListInput",
    *,
    config_overrides: Optional[AsyncQAppsClientConfig] = None,
) -> None:
    """<p>Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html">Custom labels for Amazon Q Apps</a>.</p>

    Args:
        instance_id: <p>The unique identifier of the Amazon Q Business application environment instance.</p>
        categories: <p>The list of categories to be updated with their new values.</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:
        Updates the categories in the library

        >>> await client.batch_update_category(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', categories=[{'id': '549abfe0-f5c4-45a2-bb9b-c05987a49c6d', 'title': 'HR Management'}, {'id': '18cbebaa-196a-4aa5-a840-88d548e07f8f', 'title': 'Sales'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qapps.types.batch_update_category_input.BatchUpdateCategoryInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_qapps._operations.q_apps_service.batch_update_category

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchUpdateCategory")
    )
    input_: capo_qapps.types.batch_update_category_input.BatchUpdateCategoryInput = {
        "instance_id": instance_id,
        "categories": categories,
    }

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