:doc:`IAM <../../iam>` / Paginator / ListPolicyVersions

******************
ListPolicyVersions
******************



.. py:class:: IAM.Paginator.ListPolicyVersions

  ::

    
    paginator = client.get_paginator('list_policy_versions')

  
  

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

    Creates an iterator that will paginate through responses from :py:meth:`IAM.Client.list_policy_versions`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          PolicyArn='string',
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type PolicyArn: string
    :param PolicyArn: **[REQUIRED]** 

      The Amazon Resource Name (ARN) of the IAM policy for which you want the versions.

       

      For more information about ARNs, see `Amazon Resource Names (ARNs) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ in the *Amazon Web Services General Reference*.

      

    
    :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**

      
      ::

        {
            'Versions': [
                {
                    'Document': 'string',
                    'VersionId': 'string',
                    'IsDefaultVersion': True|False,
                    'CreateDate': datetime(2015, 1, 1)
                },
            ],
            'IsTruncated': True|False,
            'NextToken': 'string'
        }
        
      **Response Structure**

      

      - *(dict) --* 

        Contains the response to a successful `ListPolicyVersions <https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListPolicyVersions.html>`__ request.

        
        

        - **Versions** *(list) --* 

          A list of policy versions.

           

          For more information about managed policy versions, see `Versioning for managed policies <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html>`__ in the *IAM User Guide*.

          
          

          - *(dict) --* 

            Contains information about a version of a managed policy.

             

            This data type is used as a response element in the `CreatePolicyVersion <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicyVersion.html>`__, `GetPolicyVersion <https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetPolicyVersion.html>`__, `ListPolicyVersions <https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListPolicyVersions.html>`__, and `GetAccountAuthorizationDetails <https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetAccountAuthorizationDetails.html>`__ operations.

             

            For more information about managed policies, refer to `Managed policies and inline policies <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html>`__ in the *IAM User Guide*.

            
            

            - **Document** *(string) --* 

              The policy document.

               

              The policy document is returned in the response to the `GetPolicyVersion <https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetPolicyVersion.html>`__ and `GetAccountAuthorizationDetails <https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetAccountAuthorizationDetails.html>`__ operations. It is not returned in the response to the `CreatePolicyVersion <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicyVersion.html>`__ or `ListPolicyVersions <https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListPolicyVersions.html>`__ operations.

               

              The policy document returned in this structure is URL-encoded compliant with `RFC 3986 <https://tools.ietf.org/html/rfc3986>`__. You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the ``decode`` method of the ``java.net.URLDecoder`` utility class in the Java SDK. Other languages and SDKs provide similar functionality.

              
            

            - **VersionId** *(string) --* 

              The identifier for the policy version.

               

              Policy version identifiers always begin with ``v`` (always lowercase). When a policy is created, the first policy version is ``v1``.

              
            

            - **IsDefaultVersion** *(boolean) --* 

              Specifies whether the policy version is set as the policy's default version.

              
            

            - **CreateDate** *(datetime) --* 

              The date and time, in `ISO 8601 date-time format <http://www.iso.org/iso/iso8601>`__, when the policy version was created.

              
        
      
        

        - **IsTruncated** *(boolean) --* 

          A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the ``Marker`` request parameter to retrieve more items. Note that IAM might return fewer than the ``MaxItems`` number of results even when there are more results available. We recommend that you check ``IsTruncated`` after every call to ensure that you receive all your results.

          
        

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

          A token to resume pagination.

          
    