:doc:`FraudDetector <../../frauddetector>` / Client / create_detector_version

***********************
create_detector_version
***********************



.. py:method:: FraudDetector.Client.create_detector_version(**kwargs)

  

  Creates a detector version. The detector version starts in a ``DRAFT`` status.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/frauddetector-2019-11-15/CreateDetectorVersion>`_  


  **Request Syntax**
  ::

    response = client.create_detector_version(
        detectorId='string',
        description='string',
        externalModelEndpoints=[
            'string',
        ],
        rules=[
            {
                'detectorId': 'string',
                'ruleId': 'string',
                'ruleVersion': 'string'
            },
        ],
        modelVersions=[
            {
                'modelId': 'string',
                'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS'|'ACCOUNT_TAKEOVER_INSIGHTS',
                'modelVersionNumber': 'string',
                'arn': 'string'
            },
        ],
        ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED',
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type detectorId: string
  :param detectorId: **[REQUIRED]** 

    The ID of the detector under which you want to create a new version.

    

  
  :type description: string
  :param description: 

    The description of the detector version.

    

  
  :type externalModelEndpoints: list
  :param externalModelEndpoints: 

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

    

  
    - *(string) --* 

    

  :type rules: list
  :param rules: **[REQUIRED]** 

    The rules to include in the detector version.

    

  
    - *(dict) --* 

      A rule.

      

    
      - **detectorId** *(string) --* **[REQUIRED]** 

        The detector for which the rule is associated.

        

      
      - **ruleId** *(string) --* **[REQUIRED]** 

        The rule ID.

        

      
      - **ruleVersion** *(string) --* **[REQUIRED]** 

        The rule version.

        

      
    

  :type modelVersions: list
  :param modelVersions: 

    The model versions to include in the detector version.

    

  
    - *(dict) --* 

      The model version.

      

    
      - **modelId** *(string) --* **[REQUIRED]** 

        The model ID.

        

      
      - **modelType** *(string) --* **[REQUIRED]** 

        The model type.

        

      
      - **modelVersionNumber** *(string) --* **[REQUIRED]** 

        The model version number.

        

      
      - **arn** *(string) --* 

        The model version ARN.

        

      
    

  :type ruleExecutionMode: string
  :param ruleExecutionMode: 

    The rule execution mode for the rules included in the detector version.

     

    You can define and edit the rule mode at the detector version level, when it is in draft status.

     

    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.

     

    The default behavior is ``FIRST_MATCHED``.

    

  
  :type tags: list
  :param tags: 

    A collection of key and value pairs.

    

  
    - *(dict) --* 

      A key and value pair.

      

    
      - **key** *(string) --* **[REQUIRED]** 

        A tag key.

        

      
      - **value** *(string) --* **[REQUIRED]** 

        A value assigned to a tag key.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'detectorId': 'string',
          'detectorVersionId': 'string',
          'status': 'DRAFT'|'ACTIVE'|'INACTIVE'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **detectorId** *(string) --* 

        The ID for the created version's parent detector.

        
      

      - **detectorVersionId** *(string) --* 

        The ID for the created detector.

        
      

      - **status** *(string) --* 

        The status of the detector version.

        
  
  **Exceptions**
  
  *   :py:class:`FraudDetector.Client.exceptions.ValidationException`

  
  *   :py:class:`FraudDetector.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`FraudDetector.Client.exceptions.InternalServerException`

  
  *   :py:class:`FraudDetector.Client.exceptions.ThrottlingException`

  
  *   :py:class:`FraudDetector.Client.exceptions.AccessDeniedException`

  