Skip to content

batch_get_intent_for_profile async

batch_get_intent_for_profile(
    domain_name: name,
    intent_domain: IntentDomain,
    intents: IntentTypeList,
    key_name: BatchGetIntentForProfileRequestKeyNameString,
    key_values: KeyValues,
    *,
    config_overrides: Optional[AsyncCustomerProfilesClientConfig] = None,
) -> BatchGetIntentForProfileResponse

Returns intents for a profile. Predictive Intent analyzes the recent web clickstream activity of the profile to generate the requested intents. The profile is identified using a search key, which consists of a KeyName and a KeyValues list.

The search key must match exactly one profile. If no profile matches the search key, the operation returns a ResourceNotFoundException. If more than one profile matches the search key, the operation returns a BadRequestException.

The operation supports partial success. Intents that can't be generated, for example because the intent type isn't enabled in the intent definition or the profile doesn't have enough recent activity, are returned in Errors.

Parameters:

  • domain_name (name) –

    The unique name of the Customer Profiles domain.

  • intent_domain (IntentDomain) –

    The intent domain of the intent definition. The only supported value is DEFAULT.

  • intents (IntentTypeList) –

    A list of intent types to generate. Intent types that aren't enabled in the intent definition are returned in Errors with the INTENT_NOT_ENABLED error code.

  • key_name (BatchGetIntentForProfileRequestKeyNameString) –

    A searchable identifier of a customer profile. You can use a predefined key, such as _profileId, _phone, or _email, or a custom-defined key. For more information, see Key definitions in Customer Profiles object type mappings.

  • key_values (KeyValues) –

    A list of key values. Provide one value for each field of the search key.

Raises:

Source code in docs_src/capo_customer_profiles/_services/async_customer_profiles.py
async def batch_get_intent_for_profile(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    intent_domain: "capo_customer_profiles.types.intent_domain.IntentDomain",
    intents: "capo_customer_profiles.types.intent_type_list.IntentTypeList",
    key_name: "capo_customer_profiles.types.batch_get_intent_for_profile_request_key_name_string.BatchGetIntentForProfileRequestKeyNameString",
    key_values: "capo_customer_profiles.types.key_values.KeyValues",
    *,
    config_overrides: Optional[AsyncCustomerProfilesClientConfig] = None,
) -> "capo_customer_profiles.types.batch_get_intent_for_profile_response.BatchGetIntentForProfileResponse":
    """<p>Returns intents for a profile. Predictive Intent analyzes the recent web clickstream activity of the profile to generate the requested intents. The profile is identified using a search key, which consists of a <code>KeyName</code> and a <code>KeyValues</code> list.</p> <p>The search key must match exactly one profile. If no profile matches the search key, the operation returns a <code>ResourceNotFoundException</code>. If more than one profile matches the search key, the operation returns a <code>BadRequestException</code>.</p> <p>The operation supports partial success. Intents that can't be generated, for example because the intent type isn't enabled in the intent definition or the profile doesn't have enough recent activity, are returned in <code>Errors</code>.</p>

    Args:
        domain_name: <p>The unique name of the Customer Profiles domain.</p>
        intent_domain: <p>The intent domain of the intent definition. The only supported value is <code>DEFAULT</code>.</p>
        intents: <p>A list of intent types to generate. Intent types that aren't enabled in the intent definition are returned in <code>Errors</code> with the <code>INTENT_NOT_ENABLED</code> error code.</p>
        key_name: <p>A searchable identifier of a customer profile. You can use a predefined key, such as <code>_profileId</code>, <code>_phone</code>, or <code>_email</code>, or a custom-defined key. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/mapping-key-definitions.html#object-type-mapping-default-search-keys">Key definitions in Customer Profiles object type mappings</a>.</p>
        key_values: <p>A list of key values. Provide one value for each field of the search key.</p>

    Raises:
        capo_customer_profiles.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_customer_profiles.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_customer_profiles.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred.</p>
        capo_customer_profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
        capo_customer_profiles.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_customer_profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_customer_profiles.types.batch_get_intent_for_profile_request.BatchGetIntentForProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_customer_profiles.types.batch_get_intent_for_profile_response.BatchGetIntentForProfileResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.batch_get_intent_for_profile

        (
            output,
            http_response,
        ) = await capo_customer_profiles._operations.customer_profiles_20200815.batch_get_intent_for_profile.async_batch_get_intent_for_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_customer_profiles.types.batch_get_intent_for_profile_request.BatchGetIntentForProfileRequest",
    ) -> dict[str, Any]:
        import capo_customer_profiles.types.batch_get_intent_for_profile_request

        return capo_customer_profiles.types.batch_get_intent_for_profile_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_customer_profiles.types.batch_get_intent_for_profile_response.BatchGetIntentForProfileResponse",
    ) -> dict[str, Any]:
        import capo_customer_profiles.types.batch_get_intent_for_profile_response

        return capo_customer_profiles.types.batch_get_intent_for_profile_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "BatchGetIntentForProfile",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_customer_profiles.types.batch_get_intent_for_profile_request.BatchGetIntentForProfileRequest = {
        "domain_name": domain_name,
        "intent_domain": intent_domain,
        "intents": intents,
        "key_name": key_name,
        "key_values": key_values,
    }

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