Skip to content

put_event_type async

put_event_type(
    name: identifier,
    event_variables: NonEmptyListOfStrings,
    entity_types: NonEmptyListOfStrings,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    description: Optional[description] = None,
    labels: Optional[ListOfStrings] = None,
    event_ingestion: Optional[EventIngestion] = None,
    tags: Optional[tagList] = None,
    event_orchestration: Optional[EventOrchestration] = None,
) -> PutEventTypeResult

Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.

Parameters:

  • name (identifier) –

    The name.

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

    The description of the event type.

  • event_variables (NonEmptyListOfStrings) –

    The event type variables.

  • labels (Optional[ListOfStrings], default: None ) –

    The event type labels.

  • entity_types (NonEmptyListOfStrings) –

    The entity type for the event type. Example entity types: customer, merchant, account.

  • event_ingestion (Optional[EventIngestion], default: None ) –

    Specifies if ingestion is enabled or disabled.

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

    A collection of key and value pairs.

  • event_orchestration (Optional[EventOrchestration], default: None ) –

    Enables or disables event orchestration. If enabled, you can send event predictions to select AWS services for downstream processing of the events.

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • ConflictException –

    An exception indicating there was a conflict during a delete operation.

  • InternalServerException –

    An exception indicating an internal server error.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_frauddetector/_services/async_fraud_detector.py
async def put_event_type(
    self,
    name: "capo_frauddetector.types.identifier.identifier",
    event_variables: "capo_frauddetector.types.non_empty_list_of_strings.NonEmptyListOfStrings",
    entity_types: "capo_frauddetector.types.non_empty_list_of_strings.NonEmptyListOfStrings",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    description: Optional[
        "capo_frauddetector.types.description.description"
    ] = None,
    labels: Optional[
        "capo_frauddetector.types.list_of_strings.ListOfStrings"
    ] = None,
    event_ingestion: Optional[
        "capo_frauddetector.types.event_ingestion.EventIngestion"
    ] = None,
    tags: Optional["capo_frauddetector.types.tag_list.tagList"] = None,
    event_orchestration: Optional[
        "capo_frauddetector.types.event_orchestration.EventOrchestration"
    ] = None,
) -> "capo_frauddetector.types.put_event_type_result.PutEventTypeResult":
    """<p>Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.</p>

    Args:
        name: <p>The name.</p>
        description: <p>The description of the event type.</p>
        event_variables: <p>The event type variables.</p>
        labels: <p>The event type labels.</p>
        entity_types: <p>The entity type for the event type. Example entity types: customer, merchant, account.</p>
        event_ingestion: <p>Specifies if ingestion is enabled or disabled.</p>
        tags: <p>A collection of key and value pairs.</p>
        event_orchestration: <p>Enables or disables event orchestration. If enabled, you can send event predictions to select AWS services for downstream processing of the events.</p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.conflict_exception.ConflictException: <p>An exception indicating there was a conflict during a delete operation.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_frauddetector.types.put_event_type_request.PutEventTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.put_event_type_result.PutEventTypeResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.put_event_type

        (
            output,
            http_response,
        ) = await capo_frauddetector._operations.aws_hawks_nest_service_facade.put_event_type.async_put_event_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutEventType")
    )
    input_: capo_frauddetector.types.put_event_type_request.PutEventTypeRequest = {
        "name": name,
        "event_variables": event_variables,
        "entity_types": entity_types,
    }
    if description is not None:
        input_["description"] = description
    if labels is not None:
        input_["labels"] = labels
    if event_ingestion is not None:
        input_["event_ingestion"] = event_ingestion
    if tags is not None:
        input_["tags"] = tags
    if event_orchestration is not None:
        input_["event_orchestration"] = event_orchestration

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