:doc:`IoT <../../iot>` / Client / list_principal_policies

***********************
list_principal_policies
***********************



.. py:method:: IoT.Client.list_principal_policies(**kwargs)

  

  Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in `AmazonCognito Identity format <https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax>`__.

   

  **Note:** This action is deprecated and works as expected for backward compatibility, but we won't add enhancements. Use  ListAttachedPolicies instead.

   

  Requires permission to access the `ListPrincipalPolicies <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalPolicies>`_  


  **Request Syntax**
  ::

    response = client.list_principal_policies(
        principal='string',
        marker='string',
        pageSize=123,
        ascendingOrder=True|False
    )
    
  :type principal: string
  :param principal: **[REQUIRED]** 

    The principal. Valid principals are CertificateArn (arn:aws:iot:*region*:*accountId*:cert/*certificateId*), thingGroupArn (arn:aws:iot:*region*:*accountId*:thinggroup/*groupName*) and CognitoId (*region*:*id*).

    

  
  :type marker: string
  :param marker: 

    The marker for the next set of results.

    

  
  :type pageSize: integer
  :param pageSize: 

    The result page size.

    

  
  :type ascendingOrder: boolean
  :param ascendingOrder: 

    Specifies the order for results. If true, results are returned in ascending creation order.

    

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

    
    ::

      {
          'policies': [
              {
                  'policyName': 'string',
                  'policyArn': 'string'
              },
          ],
          'nextMarker': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output from the ListPrincipalPolicies operation.

      
      

      - **policies** *(list) --* 

        The policies.

        
        

        - *(dict) --* 

          Describes an IoT policy.

          
          

          - **policyName** *(string) --* 

            The policy name.

            
          

          - **policyArn** *(string) --* 

            The policy ARN.

            
      
    
      

      - **nextMarker** *(string) --* 

        The marker for the next set of results, or null if there are no additional results.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

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

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

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  