:doc:`WorkMail <../../workmail>` / Client / list_groups

***********
list_groups
***********



.. py:method:: WorkMail.Client.list_groups(**kwargs)

  

  Returns summaries of the organization's groups.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListGroups>`_  


  **Request Syntax**
  ::

    response = client.list_groups(
        OrganizationId='string',
        NextToken='string',
        MaxResults=123,
        Filters={
            'NamePrefix': 'string',
            'PrimaryEmailPrefix': 'string',
            'State': 'ENABLED'|'DISABLED'|'DELETED'
        }
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The identifier for the organization under which the groups exist.

    

  
  :type NextToken: string
  :param NextToken: 

    The token to use to retrieve the next page of results. The first call does not contain any tokens.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return in a single call.

    

  
  :type Filters: dict
  :param Filters: 

    Limit the search results based on the filter criteria. Only one filter per request is supported.

    

  
    - **NamePrefix** *(string) --* 

      Filters only groups with the provided name prefix.

      

    
    - **PrimaryEmailPrefix** *(string) --* 

      Filters only groups with the provided primary email prefix.

      

    
    - **State** *(string) --* 

      Filters only groups with the provided state.

      

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

    
    ::

      {
          'Groups': [
              {
                  'Id': 'string',
                  'Email': 'string',
                  'Name': 'string',
                  'State': 'ENABLED'|'DISABLED'|'DELETED',
                  'EnabledDate': datetime(2015, 1, 1),
                  'DisabledDate': datetime(2015, 1, 1)
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Groups** *(list) --* 

        The overview of groups for an organization.

        
        

        - *(dict) --* 

          The representation of an WorkMail group.

          
          

          - **Id** *(string) --* 

            The identifier of the group.

            
          

          - **Email** *(string) --* 

            The email of the group.

            
          

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

            The name of the group.

            
          

          - **State** *(string) --* 

            The state of the group, which can be ENABLED, DISABLED, or DELETED.

            
          

          - **EnabledDate** *(datetime) --* 

            The date indicating when the group was enabled for WorkMail use.

            
          

          - **DisabledDate** *(datetime) --* 

            The date indicating when the group was disabled from WorkMail use.

            
      
    
      

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

        The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.

        
  
  **Exceptions**
  
  *   :py:class:`WorkMail.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationStateException`

  