:doc:`Connect <../../connect>` / Client / list_rules

**********
list_rules
**********



.. py:method:: Connect.Client.list_rules(**kwargs)

  

  List all rules for the specified Amazon Connect instance.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/ListRules>`_  


  **Request Syntax**
  ::

    response = client.list_rules(
        InstanceId='string',
        PublishStatus='DRAFT'|'PUBLISHED',
        EventSourceName='OnPostCallAnalysisAvailable'|'OnRealTimeCallAnalysisAvailable'|'OnRealTimeChatAnalysisAvailable'|'OnPostChatAnalysisAvailable'|'OnZendeskTicketCreate'|'OnZendeskTicketStatusUpdate'|'OnSalesforceCaseCreate'|'OnContactEvaluationSubmit'|'OnMetricDataUpdate'|'OnCaseCreate'|'OnCaseUpdate'|'OnSlaBreach',
        MaxResults=123,
        NextToken='string'
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The identifier of the Amazon Connect instance. You can `find the instance ID <https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html>`__ in the Amazon Resource Name (ARN) of the instance.

    

  
  :type PublishStatus: string
  :param PublishStatus: 

    The publish status of the rule.

    

  
  :type EventSourceName: string
  :param EventSourceName: 

    The name of the event source.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return per page.

    

  
  :type NextToken: string
  :param NextToken: 

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

    

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

    
    ::

      {
          'RuleSummaryList': [
              {
                  'Name': 'string',
                  'RuleId': 'string',
                  'RuleArn': 'string',
                  'EventSourceName': 'OnPostCallAnalysisAvailable'|'OnRealTimeCallAnalysisAvailable'|'OnRealTimeChatAnalysisAvailable'|'OnPostChatAnalysisAvailable'|'OnZendeskTicketCreate'|'OnZendeskTicketStatusUpdate'|'OnSalesforceCaseCreate'|'OnContactEvaluationSubmit'|'OnMetricDataUpdate'|'OnCaseCreate'|'OnCaseUpdate'|'OnSlaBreach',
                  'PublishStatus': 'DRAFT'|'PUBLISHED',
                  'ActionSummaries': [
                      {
                          'ActionType': 'CREATE_TASK'|'ASSIGN_CONTACT_CATEGORY'|'GENERATE_EVENTBRIDGE_EVENT'|'SEND_NOTIFICATION'|'CREATE_CASE'|'UPDATE_CASE'|'ASSIGN_SLA'|'END_ASSOCIATED_TASKS'|'SUBMIT_AUTO_EVALUATION'
                      },
                  ],
                  'CreatedTime': datetime(2015, 1, 1),
                  'LastUpdatedTime': datetime(2015, 1, 1)
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **RuleSummaryList** *(list) --* 

        Summary information about a rule.

        
        

        - *(dict) --* 

          A list of ``ActionTypes`` associated with a rule.

          
          

          - **Name** *(string) --* 

            The name of the rule.

            
          

          - **RuleId** *(string) --* 

            A unique identifier for the rule.

            
          

          - **RuleArn** *(string) --* 

            The Amazon Resource Name (ARN) of the rule.

            
          

          - **EventSourceName** *(string) --* 

            The name of the event source.

            
          

          - **PublishStatus** *(string) --* 

            The publish status of the rule.

            
          

          - **ActionSummaries** *(list) --* 

            A list of ActionTypes associated with a rule.

            
            

            - *(dict) --* 

              Information about an action.

              
              

              - **ActionType** *(string) --* 

                The action type.

                
          
        
          

          - **CreatedTime** *(datetime) --* 

            The timestamp for when the rule was created.

            
          

          - **LastUpdatedTime** *(datetime) --* 

            The timestamp for when the rule was last updated.

            
      
    
      

      - **NextToken** *(string) --* 

        If there are additional results, this is the token for the next set of results.

        
  
  **Exceptions**
  
  *   :py:class:`Connect.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Connect.Client.exceptions.InternalServiceException`

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

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

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

  