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

***********
create_rule
***********



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

  

  Creates a rule for use with the specified detector.

  

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


  **Request Syntax**
  ::

    response = client.create_rule(
        ruleId='string',
        detectorId='string',
        description='string',
        expression='string',
        language='DETECTORPL',
        outcomes=[
            'string',
        ],
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type ruleId: string
  :param ruleId: **[REQUIRED]** 

    The rule ID.

    

  
  :type detectorId: string
  :param detectorId: **[REQUIRED]** 

    The detector ID for the rule's parent detector.

    

  
  :type description: string
  :param description: 

    The rule description.

    

  
  :type expression: string
  :param expression: **[REQUIRED]** 

    The rule expression.

    

  
  :type language: string
  :param language: **[REQUIRED]** 

    The language of the rule.

    

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

    The outcome or outcomes returned when the rule expression matches.

    

  
    - *(string) --* 

    

  :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**

    
    ::

      {
          'rule': {
              'detectorId': 'string',
              'ruleId': 'string',
              'ruleVersion': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **rule** *(dict) --* 

        The created rule.

        
        

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

          The detector for which the rule is associated.

          
        

        - **ruleId** *(string) --* 

          The rule ID.

          
        

        - **ruleVersion** *(string) --* 

          The rule version.

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

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

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

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

  