:doc:`SSO <../../sso>` / Client / list_account_roles

******************
list_account_roles
******************



.. py:method:: SSO.Client.list_account_roles(**kwargs)

  

  Lists all roles that are assigned to the user for a given AWS account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles>`_  


  **Request Syntax**
  ::

    response = client.list_account_roles(
        nextToken='string',
        maxResults=123,
        accessToken='string',
        accountId='string'
    )
    
  :type nextToken: string
  :param nextToken: 

    The page token from the previous response output when you request subsequent pages.

    

  
  :type maxResults: integer
  :param maxResults: 

    The number of items that clients can request per page.

    

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

    The token issued by the ``CreateToken`` API call. For more information, see `CreateToken <https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html>`__ in the *IAM Identity Center OIDC API Reference Guide*.

    

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

    The identifier for the AWS account that is assigned to the user.

    

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

    
    ::

      {
          'nextToken': 'string',
          'roleList': [
              {
                  'roleName': 'string',
                  'accountId': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The page token client that is used to retrieve the list of accounts.

        
      

      - **roleList** *(list) --* 

        A paginated response with the list of roles and the next token if more results are available.

        
        

        - *(dict) --* 

          Provides information about the role that is assigned to the user.

          
          

          - **roleName** *(string) --* 

            The friendly name of the role that is assigned to the user.

            
          

          - **accountId** *(string) --* 

            The identifier of the AWS account assigned to the user.

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

  
  *   :py:class:`SSO.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`SSO.Client.exceptions.TooManyRequestsException`

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

  