Skip to content

update_q_app

update_q_app(
    instance_id: InstanceId,
    app_id: UUID,
    *,
    config_overrides: Optional[QAppsClientConfig] = None,
    title: Optional[Title] = None,
    description: Optional[Description] = None,
    app_definition: Optional[AppDefinitionInput] = None,
) -> UpdateQAppOutput

Updates an existing Amazon Q App, allowing modifications to its title, description, and definition.

Parameters:

  • instance_id (InstanceId) –

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

  • app_id (UUID) –

    The unique identifier of the Q App to update.

  • title (Optional[Title], default: None ) –

    The new title for the Q App.

  • description (Optional[Description], default: None ) –

    The new description for the Q App.

  • app_definition (Optional[AppDefinitionInput], default: None ) –

    The new definition specifying the cards and flow for the Q App.

Raises:

Examples:

Updating the title of an app

>>> client.update_q_app(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', app_id='7212ff04-de7b-4831-bd80-45d6975ba1b0', title='This is the new title')
Updating the app so it has a single q-query card
>>> client.update_q_app(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', app_id='7212ff04-de7b-4831-bd80-45d6975ba1b0', app_definition={'cards': [{'qQuery': {'type': 'q-query', 'title': 'Trip Ideas', 'id': '18870b94-1e63-40e0-8c12-669c90ac5acc', 'prompt': 'Recommend me an itinerary for a trip'}}]})
Source code in docs_src/capo_qapps/_services/q_apps.py
def update_q_app(
    self,
    instance_id: "capo_qapps.types.instance_id.InstanceId",
    app_id: "capo_qapps.types.uuid.UUID",
    *,
    config_overrides: Optional[QAppsClientConfig] = None,
    title: Optional["capo_qapps.types.title.Title"] = None,
    description: Optional["capo_qapps.types.description.Description"] = None,
    app_definition: Optional[
        "capo_qapps.types.app_definition_input.AppDefinitionInput"
    ] = None,
) -> "capo_qapps.types.update_q_app_output.UpdateQAppOutput":
    """<p>Updates an existing Amazon Q App, allowing modifications to its title, description, and definition.</p>

    Args:
        instance_id: <p>The unique identifier of the Amazon Q Business application environment instance.</p>
        app_id: <p>The unique identifier of the Q App to update.</p>
        title: <p>The new title for the Q App.</p>
        description: <p>The new description for the Q App.</p>
        app_definition: <p>The new definition specifying the cards and flow for the Q App.</p>

    Raises:
        capo_qapps.errors.access_denied_exception.AccessDeniedException: <p>The client is not authorized to perform the requested operation.</p>
        capo_qapps.errors.content_too_large_exception.ContentTooLargeException: <p>The requested operation could not be completed because the content exceeds the maximum allowed size.</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:
        Updating the title of an app

        >>> client.update_q_app(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', app_id='7212ff04-de7b-4831-bd80-45d6975ba1b0', title='This is the new title')
        Updating the app so it has a single q-query card

        >>> client.update_q_app(instance_id='0b95c9c4-89cc-4aa8-9aae-aa91cbec699f', app_id='7212ff04-de7b-4831-bd80-45d6975ba1b0', app_definition={'cards': [{'qQuery': {'type': 'q-query', 'title': 'Trip Ideas', 'id': '18870b94-1e63-40e0-8c12-669c90ac5acc', 'prompt': 'Recommend me an itinerary for a trip'}}]})
    """

    def _handler(
        req: "OperationRequest[capo_qapps.types.update_q_app_input.UpdateQAppInput]",
    ) -> OperationResponse["capo_qapps.types.update_q_app_output.UpdateQAppOutput"]:
        import capo_qapps._operations.q_apps_service.update_q_app

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateQApp")
    )
    input_: capo_qapps.types.update_q_app_input.UpdateQAppInput = {
        "instance_id": instance_id,
        "app_id": app_id,
    }
    if title is not None:
        input_["title"] = title
    if description is not None:
        input_["description"] = description
    if app_definition is not None:
        input_["app_definition"] = app_definition

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