:doc:`CodeStarNotifications <../../codestar-notifications>` / Client / list_targets

************
list_targets
************



.. py:method:: CodeStarNotifications.Client.list_targets(**kwargs)

  

  Returns a list of the notification rule targets for an Amazon Web Services account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTargets>`_  


  **Request Syntax**
  ::

    response = client.list_targets(
        Filters=[
            {
                'Name': 'TARGET_TYPE'|'TARGET_ADDRESS'|'TARGET_STATUS',
                'Value': 'string'
            },
        ],
        NextToken='string',
        MaxResults=123
    )
    
  :type Filters: list
  :param Filters: 

    The filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.

     

    .. note::

      

      A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.

      

    

  
    - *(dict) --* 

      Information about a filter to apply to the list of returned targets. You can filter by target type, address, or status. For example, to filter results to notification rules that have active Amazon Q Developer in chat applications topics as targets, you could specify a ListTargetsFilter Name as ``TargetType`` and a Value of ``SNS``, and a Name of ``TARGET_STATUS`` and a Value of ``ACTIVE``.

      

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

        The name of the attribute you want to use to filter the returned targets.

        

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

        The value of the attribute you want to use to filter the returned targets. For example, if you specify ``SNS`` for the Target type, you could specify an Amazon Resource Name (ARN) for a topic as the value.

        

      
    

  :type NextToken: string
  :param NextToken: 

    An enumeration token that, when provided in a request, returns the next batch of the results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.

    

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

    
    ::

      {
          'Targets': [
              {
                  'TargetAddress': 'string',
                  'TargetType': 'string',
                  'TargetStatus': 'PENDING'|'ACTIVE'|'UNREACHABLE'|'INACTIVE'|'DEACTIVATED'
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Targets** *(list) --* 

        The list of notification rule targets.

        
        

        - *(dict) --* 

          Information about the targets specified for a notification rule.

          
          

          - **TargetAddress** *(string) --* 

            The Amazon Resource Name (ARN) of the Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client.

            
          

          - **TargetType** *(string) --* 

            The type of the target (for example, ``SNS``).

             

            
            * Amazon Q Developer in chat applications topics are specified as ``SNS``.
             
            * Amazon Q Developer in chat applications clients are specified as ``AWSChatbotSlack``.
            

            
          

          - **TargetStatus** *(string) --* 

            The status of the target.

            
      
    
      

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

        An enumeration token that can be used in a request to return the next batch of results.

        
  
  **Exceptions**
  
  *   :py:class:`CodeStarNotifications.Client.exceptions.InvalidNextTokenException`

  
  *   :py:class:`CodeStarNotifications.Client.exceptions.ValidationException`

  