Skip to content

update_quick_response async

update_quick_response(
    knowledge_base_id: UuidOrArn,
    quick_response_id: UuidOrArn,
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    name: Optional[QuickResponseName] = None,
    content: Optional[QuickResponseDataProvider] = None,
    content_type: Optional[QuickResponseType] = None,
    grouping_configuration: Optional[GroupingConfiguration] = None,
    remove_grouping_configuration: Optional[bool] = None,
    description: Optional[QuickResponseDescription] = None,
    remove_description: Optional[bool] = None,
    shortcut_key: Optional[ShortCutKey] = None,
    remove_shortcut_key: Optional[bool] = None,
    is_active: Optional[bool] = None,
    channels: Optional[Channels] = None,
    language: Optional[LanguageCode] = None,
) -> UpdateQuickResponseResponse

Updates an existing Amazon Q in Connect quick response.

Parameters:

  • knowledge_base_id (UuidOrArn) –

    The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • quick_response_id (UuidOrArn) –

    The identifier of the quick response.

  • name (Optional[QuickResponseName], default: None ) –

    The name of the quick response.

  • content (Optional[QuickResponseDataProvider], default: None ) –

    The updated content of the quick response.

  • content_type (Optional[QuickResponseType], default: None ) –

    The media type of the quick response content.

    • Use application/x.quickresponse;format=plain for quick response written in plain text.

    • Use application/x.quickresponse;format=markdown for quick response written in richtext.

  • grouping_configuration (Optional[GroupingConfiguration], default: None ) –

    The updated grouping configuration of the quick response.

  • remove_grouping_configuration (Optional[bool], default: None ) –

    Whether to remove the grouping configuration of the quick response.

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

    The updated description of the quick response.

  • remove_description (Optional[bool], default: None ) –

    Whether to remove the description from the quick response.

  • shortcut_key (Optional[ShortCutKey], default: None ) –

    The shortcut key of the quick response. The value should be unique across the knowledge base.

  • remove_shortcut_key (Optional[bool], default: None ) –

    Whether to remove the shortcut key of the quick response.

  • is_active (Optional[bool], default: None ) –

    Whether the quick response is active.

  • channels (Optional[Channels], default: None ) –

    The Connect Customer contact channels this quick response applies to. The supported contact channel types include Chat.

  • language (Optional[LanguageCode], default: None ) –

    The language code value for the language in which the quick response is written. The supported language codes include de_DE, en_US, es_ES, fr_FR, id_ID, it_IT, ja_JP, ko_KR, pt_BR, zh_CN, zh_TW

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be processed because of conflict in the current state of the resource. For example, if you're using a Create API (such as CreateAssistant) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.

  • PreconditionFailedException –

    The provided revisionId does not match, indicating the content has been modified since it was last read.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • UnauthorizedException –

    You do not have permission to perform this action.

  • ValidationException –

    The input fails to satisfy the constraints specified by a service.

  • UnknownServiceError –

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

Source code in docs_src/capo_qconnect/_services/async_q_connect.py
async def update_quick_response(
    self,
    knowledge_base_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    quick_response_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    name: Optional[
        "capo_qconnect.types.quick_response_name.QuickResponseName"
    ] = None,
    content: Optional[
        "capo_qconnect.types.quick_response_data_provider.QuickResponseDataProvider"
    ] = None,
    content_type: Optional[
        "capo_qconnect.types.quick_response_type.QuickResponseType"
    ] = None,
    grouping_configuration: Optional[
        "capo_qconnect.types.grouping_configuration.GroupingConfiguration"
    ] = None,
    remove_grouping_configuration: Optional[bool] = None,
    description: Optional[
        "capo_qconnect.types.quick_response_description.QuickResponseDescription"
    ] = None,
    remove_description: Optional[bool] = None,
    shortcut_key: Optional["capo_qconnect.types.short_cut_key.ShortCutKey"] = None,
    remove_shortcut_key: Optional[bool] = None,
    is_active: Optional[bool] = None,
    channels: Optional["capo_qconnect.types.channels.Channels"] = None,
    language: Optional["capo_qconnect.types.language_code.LanguageCode"] = None,
) -> (
    "capo_qconnect.types.update_quick_response_response.UpdateQuickResponseResponse"
):
    """<p>Updates an existing Amazon Q in Connect quick response.</p>

    Args:
        knowledge_base_id: <p>The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        quick_response_id: <p>The identifier of the quick response.</p>
        name: <p>The name of the quick response.</p>
        content: <p>The updated content of the quick response.</p>
        content_type: <p>The media type of the quick response content.</p> <ul> <li> <p>Use <code>application/x.quickresponse;format=plain</code> for quick response written in plain text.</p> </li> <li> <p>Use <code>application/x.quickresponse;format=markdown</code> for quick response written in richtext.</p> </li> </ul>
        grouping_configuration: <p>The updated grouping configuration of the quick response.</p>
        remove_grouping_configuration: <p>Whether to remove the grouping configuration of the quick response.</p>
        description: <p>The updated description of the quick response.</p>
        remove_description: <p>Whether to remove the description from the quick response.</p>
        shortcut_key: <p>The shortcut key of the quick response. The value should be unique across the knowledge base.</p>
        remove_shortcut_key: <p>Whether to remove the shortcut key of the quick response.</p>
        is_active: <p>Whether the quick response is active. </p>
        channels: <p>The Connect Customer contact channels this quick response applies to. The supported contact channel types include <code>Chat</code>.</p>
        language: <p>The language code value for the language in which the quick response is written. The supported language codes include <code>de_DE</code>, <code>en_US</code>, <code>es_ES</code>, <code>fr_FR</code>, <code>id_ID</code>, <code>it_IT</code>, <code>ja_JP</code>, <code>ko_KR</code>, <code>pt_BR</code>, <code>zh_CN</code>, <code>zh_TW</code> </p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_qconnect.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource. For example, if you're using a <code>Create</code> API (such as <code>CreateAssistant</code>) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.</p>
        capo_qconnect.errors.precondition_failed_exception.PreconditionFailedException: <p>The provided <code>revisionId</code> does not match, indicating the content has been modified since it was last read.</p>
        capo_qconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_qconnect.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_qconnect.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_qconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qconnect.types.update_quick_response_request.UpdateQuickResponseRequest]",
    ) -> AsyncOperationResponse[
        "capo_qconnect.types.update_quick_response_response.UpdateQuickResponseResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.update_quick_response

        (
            output,
            http_response,
        ) = await capo_qconnect._operations.wisdom_service.update_quick_response.async_update_quick_response(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_qconnect.types.update_quick_response_request.UpdateQuickResponseRequest",
    ) -> dict[str, Any]:
        import capo_qconnect.types.update_quick_response_request

        return capo_qconnect.types.update_quick_response_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_qconnect.types.update_quick_response_response.UpdateQuickResponseResponse",
    ) -> dict[str, Any]:
        import capo_qconnect.types.update_quick_response_response

        return capo_qconnect.types.update_quick_response_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateQuickResponse",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_qconnect.types.update_quick_response_request.UpdateQuickResponseRequest = {
        "knowledge_base_id": knowledge_base_id,
        "quick_response_id": quick_response_id,
    }
    if name is not None:
        input_["name"] = name
    if content is not None:
        input_["content"] = content
    if content_type is not None:
        input_["content_type"] = content_type
    if grouping_configuration is not None:
        input_["grouping_configuration"] = grouping_configuration
    if remove_grouping_configuration is not None:
        input_["remove_grouping_configuration"] = remove_grouping_configuration
    if description is not None:
        input_["description"] = description
    if remove_description is not None:
        input_["remove_description"] = remove_description
    if shortcut_key is not None:
        input_["shortcut_key"] = shortcut_key
    if remove_shortcut_key is not None:
        input_["remove_shortcut_key"] = remove_shortcut_key
    if is_active is not None:
        input_["is_active"] = is_active
    if channels is not None:
        input_["channels"] = channels
    if language is not None:
        input_["language"] = language

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