Skip to content

create_quick_response async

create_quick_response(
    knowledge_base_id: UuidOrArn,
    name: QuickResponseName,
    content: QuickResponseDataProvider,
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    content_type: Optional[QuickResponseType] = None,
    grouping_configuration: Optional[GroupingConfiguration] = None,
    description: Optional[QuickResponseDescription] = None,
    shortcut_key: Optional[ShortCutKey] = None,
    is_active: Optional[bool] = None,
    channels: Optional[Channels] = None,
    language: Optional[LanguageCode] = None,
    client_token: Optional[NonEmptyString] = None,
    tags: Optional[Tags] = None,
) -> CreateQuickResponseResponse

Creates a Wisdom quick response.

Parameters:

  • knowledge_base_id (UuidOrArn) –

    The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • name (QuickResponseName) –

    The name of the quick response.

  • content (QuickResponseDataProvider) –

    The 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 a quick response written in plain text.

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

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

    The configuration information of the user groups that the quick response is accessible to.

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

    The description of 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.

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

    Whether the quick response is active.

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

    The Amazon Connect channels this quick response applies to.

  • 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

  • client_token (Optional[NonEmptyString], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

  • tags (Optional[Tags], default: None ) –

    The tags used to organize, track, or control access for this resource.

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.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • ServiceQuotaExceededException –

    You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.

  • 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_wisdom/_services/async_wisdom.py
async def create_quick_response(
    self,
    knowledge_base_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    name: "capo_wisdom.types.quick_response_name.QuickResponseName",
    content: "capo_wisdom.types.quick_response_data_provider.QuickResponseDataProvider",
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    content_type: Optional[
        "capo_wisdom.types.quick_response_type.QuickResponseType"
    ] = None,
    grouping_configuration: Optional[
        "capo_wisdom.types.grouping_configuration.GroupingConfiguration"
    ] = None,
    description: Optional[
        "capo_wisdom.types.quick_response_description.QuickResponseDescription"
    ] = None,
    shortcut_key: Optional["capo_wisdom.types.short_cut_key.ShortCutKey"] = None,
    is_active: Optional[bool] = None,
    channels: Optional["capo_wisdom.types.channels.Channels"] = None,
    language: Optional["capo_wisdom.types.language_code.LanguageCode"] = None,
    client_token: Optional[
        "capo_wisdom.types.non_empty_string.NonEmptyString"
    ] = None,
    tags: Optional["capo_wisdom.types.tags.Tags"] = None,
) -> "capo_wisdom.types.create_quick_response_response.CreateQuickResponseResponse":
    """<p>Creates a Wisdom quick response.</p>

    Args:
        knowledge_base_id: <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        name: <p>The name of the quick response.</p>
        content: <p>The 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 a quick response written in plain text.</p> </li> <li> <p>Use <code>application/x.quickresponse;format=markdown</code> for a quick response written in richtext.</p> </li> </ul>
        grouping_configuration: <p>The configuration information of the user groups that the quick response is accessible to.</p>
        description: <p>The description of the quick response.</p>
        shortcut_key: <p>The shortcut key of the quick response. The value should be unique across the knowledge base. </p>
        is_active: <p>Whether the quick response is active.</p>
        channels: <p>The Amazon Connect channels this quick response applies to.</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>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        tags: <p>The tags used to organize, track, or control access for this resource.</p>

    Raises:
        capo_wisdom.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_wisdom.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_wisdom.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_wisdom.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.</p>
        capo_wisdom.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_wisdom.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wisdom.types.create_quick_response_request.CreateQuickResponseRequest]",
    ) -> AsyncOperationResponse[
        "capo_wisdom.types.create_quick_response_response.CreateQuickResponseResponse"
    ]:
        import capo_wisdom._operations.wisdom_service.create_quick_response

        (
            output,
            http_response,
        ) = await capo_wisdom._operations.wisdom_service.create_quick_response.async_create_quick_response(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_wisdom.types.create_quick_response_request.CreateQuickResponseRequest",
    ) -> dict[str, Any]:
        import capo_wisdom.types.create_quick_response_request

        return capo_wisdom.types.create_quick_response_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_wisdom.types.create_quick_response_response.CreateQuickResponseResponse",
    ) -> dict[str, Any]:
        import capo_wisdom.types.create_quick_response_response

        return capo_wisdom.types.create_quick_response_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateQuickResponse",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_wisdom.types.create_quick_response_request.CreateQuickResponseRequest = {
        "knowledge_base_id": knowledge_base_id,
        "name": name,
        "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 description is not None:
        input_["description"] = description
    if shortcut_key is not None:
        input_["shortcut_key"] = 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
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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