Skip to content

get_message_template async

get_message_template(
    message_template_id: UuidOrArnOrEitherWithQualifier,
    knowledge_base_id: UuidOrArn,
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
) -> GetMessageTemplateResponse

Retrieves the Amazon Q in Connect message template. The message template identifier can contain an optional qualifier, for example, <message-template-id>:<qualifier>, which is either an actual version number or an Amazon Q Connect managed qualifier $ACTIVE_VERSION | $LATEST. If it is not supplied, then $LATEST is assumed implicitly.

Parameters:

  • message_template_id (UuidOrArnOrEitherWithQualifier) –

    The identifier of the message template. Can be either the ID or the ARN.

  • knowledge_base_id (UuidOrArn) –

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

Raises:

Source code in docs_src/capo_qconnect/_services/async_q_connect.py
async def get_message_template(
    self,
    message_template_id: "capo_qconnect.types.uuid_or_arn_or_either_with_qualifier.UuidOrArnOrEitherWithQualifier",
    knowledge_base_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
) -> "capo_qconnect.types.get_message_template_response.GetMessageTemplateResponse":
    """<p>Retrieves the Amazon Q in Connect message template. The message template identifier can contain an optional qualifier, for example, <code>&lt;message-template-id&gt;:&lt;qualifier&gt;</code>, which is either an actual version number or an Amazon Q Connect managed qualifier <code>$ACTIVE_VERSION</code> | <code>$LATEST</code>. If it is not supplied, then <code>$LATEST</code> is assumed implicitly.</p>

    Args:
        message_template_id: <p>The identifier of the message template. Can be either the ID or the ARN.</p>
        knowledge_base_id: <p>The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_qconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_qconnect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</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.get_message_template_request.GetMessageTemplateRequest]",
    ) -> AsyncOperationResponse[
        "capo_qconnect.types.get_message_template_response.GetMessageTemplateResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.get_message_template

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

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

        return capo_qconnect.types.get_message_template_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetMessageTemplate", redact_output=_redact_output),
    )
    input_: capo_qconnect.types.get_message_template_request.GetMessageTemplateRequest = {
        "message_template_id": message_template_id,
        "knowledge_base_id": knowledge_base_id,
    }

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