Skip to content

put_detector

put_detector(
    detector_id: identifier,
    event_type_name: identifier,
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    description: Optional[description] = None,
    tags: Optional[tagList] = None,
) -> PutDetectorResult

Creates or updates a detector.

Parameters:

  • detector_id (identifier) –

    The detector ID.

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

    The description of the detector.

  • event_type_name (identifier) –

    The name of the event type.

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

    A collection of key and value pairs.

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/fraud_detector.py
def put_detector(
    self,
    detector_id: "capo_frauddetector.types.identifier.identifier",
    event_type_name: "capo_frauddetector.types.identifier.identifier",
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    description: Optional[
        "capo_frauddetector.types.description.description"
    ] = None,
    tags: Optional["capo_frauddetector.types.tag_list.tagList"] = None,
) -> "capo_frauddetector.types.put_detector_result.PutDetectorResult":
    """<p>Creates or updates a detector. </p>

    Args:
        detector_id: <p>The detector ID. </p>
        description: <p>The description of the detector.</p>
        event_type_name: <p>The name of the event type.</p>
        tags: <p>A collection of key and value pairs.</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.
    """

    def _handler(
        req: "OperationRequest[capo_frauddetector.types.put_detector_request.PutDetectorRequest]",
    ) -> OperationResponse[
        "capo_frauddetector.types.put_detector_result.PutDetectorResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.put_detector

        output, http_response = (
            capo_frauddetector._operations.aws_hawks_nest_service_facade.put_detector.put_detector(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutDetector")
    )
    input_: capo_frauddetector.types.put_detector_request.PutDetectorRequest = {
        "detector_id": detector_id,
        "event_type_name": event_type_name,
    }
    if description is not None:
        input_["description"] = description
    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