Skip to content

update_detector_version

update_detector_version(
    detector_id: identifier,
    detector_version_id: wholeNumberVersionString,
    external_model_endpoints: ListOfStrings,
    rules: RuleList,
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    description: Optional[description] = None,
    model_versions: Optional[ListOfModelVersions] = None,
    rule_execution_mode: Optional[RuleExecutionMode] = None,
) -> UpdateDetectorVersionResult

Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version.

Parameters:

  • detector_id (identifier) –

    The parent detector ID for the detector version you want to update.

  • detector_version_id (wholeNumberVersionString) –

    The detector version ID.

  • external_model_endpoints (ListOfStrings) –

    The Amazon SageMaker model endpoints to include in the detector version.

  • rules (RuleList) –

    The rules to include in the detector version.

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

    The detector version description.

  • model_versions (Optional[ListOfModelVersions], default: None ) –

    The model versions to include in the detector version.

  • rule_execution_mode (Optional[RuleExecutionMode], default: None ) –

    The rule execution mode to add to the detector.

    If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.

    If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.

    The default behavior is FIRST_MATCHED.

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.

  • ResourceNotFoundException –

    An exception indicating the specified resource was not found.

  • 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 update_detector_version(
    self,
    detector_id: "capo_frauddetector.types.identifier.identifier",
    detector_version_id: "capo_frauddetector.types.whole_number_version_string.wholeNumberVersionString",
    external_model_endpoints: "capo_frauddetector.types.list_of_strings.ListOfStrings",
    rules: "capo_frauddetector.types.rule_list.RuleList",
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    description: Optional[
        "capo_frauddetector.types.description.description"
    ] = None,
    model_versions: Optional[
        "capo_frauddetector.types.list_of_model_versions.ListOfModelVersions"
    ] = None,
    rule_execution_mode: Optional[
        "capo_frauddetector.types.rule_execution_mode.RuleExecutionMode"
    ] = None,
) -> "capo_frauddetector.types.update_detector_version_result.UpdateDetectorVersionResult":
    """<p> Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a <code>DRAFT</code> detector version.</p>

    Args:
        detector_id: <p>The parent detector ID for the detector version you want to update.</p>
        detector_version_id: <p>The detector version ID. </p>
        external_model_endpoints: <p>The Amazon SageMaker model endpoints to include in the detector version.</p>
        rules: <p>The rules to include in the detector version.</p>
        description: <p>The detector version description. </p>
        model_versions: <p>The model versions to include in the detector version.</p>
        rule_execution_mode: <p>The rule execution mode to add to the detector.</p> <p>If you specify <code>FIRST_MATCHED</code>, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.</p> <p>If you specifiy <code>ALL_MATCHED</code>, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.</p> <p>The default behavior is <code>FIRST_MATCHED</code>.</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.resource_not_found_exception.ResourceNotFoundException: <p>An exception indicating the specified resource was not found.</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.update_detector_version_request.UpdateDetectorVersionRequest]",
    ) -> OperationResponse[
        "capo_frauddetector.types.update_detector_version_result.UpdateDetectorVersionResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.update_detector_version

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDetectorVersion")
    )
    input_: capo_frauddetector.types.update_detector_version_request.UpdateDetectorVersionRequest = {
        "detector_id": detector_id,
        "detector_version_id": detector_version_id,
        "external_model_endpoints": external_model_endpoints,
        "rules": rules,
    }
    if description is not None:
        input_["description"] = description
    if model_versions is not None:
        input_["model_versions"] = model_versions
    if rule_execution_mode is not None:
        input_["rule_execution_mode"] = rule_execution_mode

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