Skip to content

put_intent_definition

put_intent_definition(
    domain_name: name,
    intent_domain: IntentDomain,
    intents: IntentConfigList,
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    tags: Optional[TagMap] = None,
) -> PutIntentDefinitionResponse

Creates or updates the intent definition for an intent domain in a domain. The intent definition specifies which Predictive Intent types are enabled. Each request replaces the full set of intent configurations, so include every intent type that you want to keep.

To add or remove tags on an existing intent definition, see TagResource/UntagResource.

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 (IntentConfigList) –

    A list of intent configurations. Each entry configures one intent type, and each intent type can appear at most once. At least one intent type must be enabled.

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

    The tags used to organize, track, or control access for this resource. You can specify tags only when you create the intent definition. If you specify tags when you update an existing intent definition, the operation returns a BadRequestException.

Raises:

Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
def put_intent_definition(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    intent_domain: "capo_customer_profiles.types.intent_domain.IntentDomain",
    intents: "capo_customer_profiles.types.intent_config_list.IntentConfigList",
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    tags: Optional["capo_customer_profiles.types.tag_map.TagMap"] = None,
) -> "capo_customer_profiles.types.put_intent_definition_response.PutIntentDefinitionResponse":
    """<p>Creates or updates the intent definition for an intent domain in a domain. The intent definition specifies which Predictive Intent types are enabled. Each request replaces the full set of intent configurations, so include every intent type that you want to keep.</p> <p>To add or remove tags on an existing intent definition, see <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_TagResource.html">TagResource</a>/<a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UntagResource.html">UntagResource</a>.</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 configurations. Each entry configures one intent type, and each intent type can appear at most once. At least one intent type must be enabled.</p>
        tags: <p>The tags used to organize, track, or control access for this resource. You can specify tags only when you create the intent definition. If you specify tags when you update an existing intent definition, the operation returns a <code>BadRequestException</code>.</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.
    """

    def _handler(
        req: "OperationRequest[capo_customer_profiles.types.put_intent_definition_request.PutIntentDefinitionRequest]",
    ) -> OperationResponse[
        "capo_customer_profiles.types.put_intent_definition_response.PutIntentDefinitionResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.put_intent_definition

        output, http_response = (
            capo_customer_profiles._operations.customer_profiles_20200815.put_intent_definition.put_intent_definition(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutIntentDefinition")
    )
    input_: capo_customer_profiles.types.put_intent_definition_request.PutIntentDefinitionRequest = {
        "domain_name": domain_name,
        "intent_domain": intent_domain,
        "intents": intents,
    }
    if tags is not None:
        input_["tags"] = tags

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