:doc:`RAM <../../ram>` / Paginator / ListPrincipals

**************
ListPrincipals
**************



.. py:class:: RAM.Paginator.ListPrincipals

  ::

    
    paginator = client.get_paginator('list_principals')

  
  

  .. py:method:: paginate(**kwargs)

    Creates an iterator that will paginate through responses from :py:meth:`RAM.Client.list_principals`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPrincipals>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          resourceOwner='SELF'|'OTHER-ACCOUNTS',
          resourceArn='string',
          principals=[
              'string',
          ],
          resourceType='string',
          resourceShareArns=[
              'string',
          ],
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type resourceOwner: string
    :param resourceOwner: **[REQUIRED]** 

      Specifies that you want to list information for only resource shares that match the following:

       

      
      * ``SELF`` – principals that your account is sharing resources with
       
      * ``OTHER-ACCOUNTS`` – principals that are sharing resources with your account
      

      

    
    :type resourceArn: string
    :param resourceArn: 

      Specifies that you want to list principal information for the resource share with the specified `Amazon Resource Name (ARN) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__.

      

    
    :type principals: list
    :param principals: 

      Specifies that you want to list information for only the listed principals.

       

      You can include the following values:

       

      
      * An Amazon Web Services account ID, for example: ``123456789012``
       
      * An `Amazon Resource Name (ARN) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of an organization in Organizations, for example: ``organizations::123456789012:organization/o-exampleorgid``
       
      * An ARN of an organizational unit (OU) in Organizations, for example: ``organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123``
       
      * An ARN of an IAM role, for example: ``iam::123456789012:role/rolename``
       
      * An ARN of an IAM user, for example: ``iam::123456789012user/username``
       
      * A service principal name, for example: ``service-id.amazonaws.com``
      

       

      .. note::

        

        Not all resource types can be shared with IAM roles and users. For more information, see `Sharing with IAM roles and users <https://docs.aws.amazon.com/ram/latest/userguide/permissions.html#permissions-rbp-supported-resource-types>`__ in the *Resource Access Manager User Guide*.

        

      

    
      - *(string) --* 

      
  
    :type resourceType: string
    :param resourceType: 

      Specifies that you want to list information for only principals associated with resource shares that include the specified resource type.

       

      For a list of valid values, query the  ListResourceTypes operation.

      

    
    :type resourceShareArns: list
    :param resourceShareArns: 

      Specifies that you want to list information for only principals associated with the resource shares specified by a list the `Amazon Resource Names (ARNs) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__.

      

    
      - *(string) --* 

      
  
    :type PaginationConfig: dict
    :param PaginationConfig: 

      A dictionary that provides parameters to control pagination.

      

    
      - **MaxItems** *(integer) --* 

        The total number of items to return. If the total number of items available is more than the value specified in max-items then a ``NextToken`` will be provided in the output that you can use to resume pagination.

        

      
      - **PageSize** *(integer) --* 

        The size of each page.

        

      
      - **StartingToken** *(string) --* 

        A token to specify where to start paginating. This is the ``NextToken`` from a previous response.

        

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

      
      ::

        {
            'principals': [
                {
                    'id': 'string',
                    'resourceShareArn': 'string',
                    'creationTime': datetime(2015, 1, 1),
                    'lastUpdatedTime': datetime(2015, 1, 1),
                    'external': True|False
                },
            ],
            'NextToken': 'string'
        }
        
      **Response Structure**

      

      - *(dict) --* 
        

        - **principals** *(list) --* 

          An array of objects that contain the details about the principals.

          
          

          - *(dict) --* 

            Describes a principal for use with Resource Access Manager.

            
            

            - **id** *(string) --* 

              The ID of the principal that can be associated with a resource share.

              
            

            - **resourceShareArn** *(string) --* 

              The `Amazon Resource Name (ARN) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of a resource share the principal is associated with.

              
            

            - **creationTime** *(datetime) --* 

              The date and time when the principal was associated with the resource share.

              
            

            - **lastUpdatedTime** *(datetime) --* 

              The date and time when the association between the resource share and the principal was last updated.

              
            

            - **external** *(boolean) --* 

              Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:

               

              
              * ``True`` – The two accounts belong to same organization.
               
              * ``False`` – The two accounts do not belong to the same organization.
              

              
        
      
        

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

          A token to resume pagination.

          
    