Skip to content

create_event_trigger

create_event_trigger(
    domain_name: name,
    event_trigger_name: name,
    object_type_name: typeName,
    event_trigger_conditions: EventTriggerConditions,
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    description: Optional[sensitiveText] = None,
    segment_filter: Optional[name] = None,
    event_trigger_limits: Optional[EventTriggerLimits] = None,
    tags: Optional[TagMap] = None,
) -> CreateEventTriggerResponse

Creates an event trigger, which specifies the rules when to perform action based on customer's ingested data.

Each event stream can be associated with only one integration in the same region and AWS account as the event stream.

Parameters:

  • domain_name (name) –

    The unique name of the domain.

  • event_trigger_name (name) –

    The unique name of the event trigger.

  • object_type_name (typeName) –

    The unique name of the object type.

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

    The description of the event trigger.

  • event_trigger_conditions (EventTriggerConditions) –

    A list of conditions that determine when an event should trigger the destination.

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

    The destination is triggered only for profiles that meet the criteria of a segment definition.

  • event_trigger_limits (Optional[EventTriggerLimits], default: None ) –

    Defines limits controlling whether an event triggers the destination, based on ingestion latency and the number of invocations per profile over specific time periods.

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

    An array of key-value pairs to apply to this resource.

Raises:

Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
def create_event_trigger(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    event_trigger_name: "capo_customer_profiles.types.name.name",
    object_type_name: "capo_customer_profiles.types.type_name.typeName",
    event_trigger_conditions: "capo_customer_profiles.types.event_trigger_conditions.EventTriggerConditions",
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    description: Optional[
        "capo_customer_profiles.types.sensitive_text.sensitiveText"
    ] = None,
    segment_filter: Optional["capo_customer_profiles.types.name.name"] = None,
    event_trigger_limits: Optional[
        "capo_customer_profiles.types.event_trigger_limits.EventTriggerLimits"
    ] = None,
    tags: Optional["capo_customer_profiles.types.tag_map.TagMap"] = None,
) -> "capo_customer_profiles.types.create_event_trigger_response.CreateEventTriggerResponse":
    """<p>Creates an event trigger, which specifies the rules when to perform action based on customer's ingested data.</p> <p>Each event stream can be associated with only one integration in the same region and AWS account as the event stream. </p>

    Args:
        domain_name: <p>The unique name of the domain.</p>
        event_trigger_name: <p>The unique name of the event trigger.</p>
        object_type_name: <p>The unique name of the object type.</p>
        description: <p>The description of the event trigger.</p>
        event_trigger_conditions: <p>A list of conditions that determine when an event should trigger the destination.</p>
        segment_filter: <p>The destination is triggered only for profiles that meet the criteria of a segment definition.</p>
        event_trigger_limits: <p>Defines limits controlling whether an event triggers the destination, based on ingestion latency and the number of invocations per profile over specific time periods.</p>
        tags: <p>An array of key-value pairs to apply to this resource.</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.create_event_trigger_request.CreateEventTriggerRequest]",
    ) -> OperationResponse[
        "capo_customer_profiles.types.create_event_trigger_response.CreateEventTriggerResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.create_event_trigger

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

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

        return capo_customer_profiles.types.create_event_trigger_request.redact_sensitive(
            input_
        )

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

        return capo_customer_profiles.types.create_event_trigger_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateEventTrigger",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_customer_profiles.types.create_event_trigger_request.CreateEventTriggerRequest = {
        "domain_name": domain_name,
        "event_trigger_name": event_trigger_name,
        "object_type_name": object_type_name,
        "event_trigger_conditions": event_trigger_conditions,
    }
    if description is not None:
        input_["description"] = description
    if segment_filter is not None:
        input_["segment_filter"] = segment_filter
    if event_trigger_limits is not None:
        input_["event_trigger_limits"] = event_trigger_limits
    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