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

*********
get_rules
*********



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

  

  Get all rules for a detector (paginated) if ``ruleId`` and ``ruleVersion`` are not specified. Gets all rules for the detector and the ``ruleId`` if present (paginated). Gets a specific rule if both the ``ruleId`` and the ``ruleVersion`` are specified.

   

  This is a paginated API. Providing null maxResults results in retrieving maximum of 100 records per page. If you provide maxResults the value must be between 50 and 100. To get the next page result, a provide a pagination token from GetRulesResult as part of your request. Null pagination token fetches the records from the beginning.

  

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


  **Request Syntax**
  ::

    response = client.get_rules(
        ruleId='string',
        detectorId='string',
        ruleVersion='string',
        nextToken='string',
        maxResults=123
    )
    
  :type ruleId: string
  :param ruleId: 

    The rule ID.

    

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

    The detector ID.

    

  
  :type ruleVersion: string
  :param ruleVersion: 

    The rule version.

    

  
  :type nextToken: string
  :param nextToken: 

    The next page token.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of rules to return for the request.

    

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

    
    ::

      {
          'ruleDetails': [
              {
                  'ruleId': 'string',
                  'description': 'string',
                  'detectorId': 'string',
                  'ruleVersion': 'string',
                  'expression': 'string',
                  'language': 'DETECTORPL',
                  'outcomes': [
                      'string',
                  ],
                  'lastUpdatedTime': 'string',
                  'createdTime': 'string',
                  'arn': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ruleDetails** *(list) --* 

        The details of the requested rule.

        
        

        - *(dict) --* 

          The details of the rule.

          
          

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

            The rule ID.

            
          

          - **description** *(string) --* 

            The rule description.

            
          

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

            The detector for which the rule is associated.

            
          

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

            The rule version.

            
          

          - **expression** *(string) --* 

            The rule expression.

            
          

          - **language** *(string) --* 

            The rule language.

            
          

          - **outcomes** *(list) --* 

            The rule outcomes.

            
            

            - *(string) --* 
        
          

          - **lastUpdatedTime** *(string) --* 

            Timestamp of the last time the rule was updated.

            
          

          - **createdTime** *(string) --* 

            The timestamp of when the rule was created.

            
          

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

            The rule ARN.

            
      
    
      

      - **nextToken** *(string) --* 

        The next page token to be used in subsequent requests.

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

  