:doc:`DataZone <../../datazone>` / Client / list_subscription_grants

************************
list_subscription_grants
************************



.. py:method:: DataZone.Client.list_subscription_grants(**kwargs)

  

  Lists subscription grants.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionGrants>`_  


  **Request Syntax**
  ::

    response = client.list_subscription_grants(
        domainIdentifier='string',
        environmentId='string',
        subscriptionTargetId='string',
        subscribedListingId='string',
        subscriptionId='string',
        owningProjectId='string',
        owningIamPrincipalArn='string',
        owningUserId='string',
        owningGroupId='string',
        sortBy='CREATED_AT'|'UPDATED_AT',
        sortOrder='ASCENDING'|'DESCENDING',
        maxResults=123,
        nextToken='string'
    )
    
  :type domainIdentifier: string
  :param domainIdentifier: **[REQUIRED]** 

    The identifier of the Amazon DataZone domain.

    

  
  :type environmentId: string
  :param environmentId: 

    The identifier of the Amazon DataZone environment.

    

  
  :type subscriptionTargetId: string
  :param subscriptionTargetId: 

    The identifier of the subscription target.

    

  
  :type subscribedListingId: string
  :param subscribedListingId: 

    The identifier of the subscribed listing.

    

  
  :type subscriptionId: string
  :param subscriptionId: 

    The identifier of the subscription.

    

  
  :type owningProjectId: string
  :param owningProjectId: 

    The ID of the owning project of the subscription grants.

    

  
  :type owningIamPrincipalArn: string
  :param owningIamPrincipalArn: 

    The ARN of the owning IAM principal.

    

  
  :type owningUserId: string
  :param owningUserId: 

    The ID of the owning user.

    

  
  :type owningGroupId: string
  :param owningGroupId: 

    The ID of the owning group.

    

  
  :type sortBy: string
  :param sortBy: 

    Specifies the way of sorting the results of this action.

    

  
  :type sortOrder: string
  :param sortOrder: 

    Specifies the sort order of this action.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of subscription grants to return in a single call to ``ListSubscriptionGrants``. When the number of subscription grants to be listed is greater than the value of ``MaxResults``, the response contains a ``NextToken`` value that you can use in a subsequent call to ``ListSubscriptionGrants`` to list the next set of subscription grants.

    

  
  :type nextToken: string
  :param nextToken: 

    When the number of subscription grants is greater than the default value for the ``MaxResults`` parameter, or if you explicitly specify a value for ``MaxResults`` that is less than the number of subscription grants, the response includes a pagination token named ``NextToken``. You can specify this ``NextToken`` value in a subsequent call to ``ListSubscriptionGrants`` to list the next set of subscription grants.

    

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

    
    ::

      {
          'items': [
              {
                  'id': 'string',
                  'createdBy': 'string',
                  'updatedBy': 'string',
                  'domainId': 'string',
                  'createdAt': datetime(2015, 1, 1),
                  'updatedAt': datetime(2015, 1, 1),
                  'environmentId': 'string',
                  'subscriptionTargetId': 'string',
                  'grantedEntity': {
                      'listing': {
                          'id': 'string',
                          'revision': 'string'
                      }
                  },
                  'status': 'PENDING'|'IN_PROGRESS'|'GRANT_FAILED'|'REVOKE_FAILED'|'GRANT_AND_REVOKE_FAILED'|'COMPLETED'|'INACCESSIBLE',
                  'assets': [
                      {
                          'assetId': 'string',
                          'assetRevision': 'string',
                          'status': 'GRANT_PENDING'|'REVOKE_PENDING'|'GRANT_IN_PROGRESS'|'REVOKE_IN_PROGRESS'|'GRANTED'|'REVOKED'|'GRANT_FAILED'|'REVOKE_FAILED',
                          'targetName': 'string',
                          'failureCause': {
                              'message': 'string'
                          },
                          'grantedTimestamp': datetime(2015, 1, 1),
                          'failureTimestamp': datetime(2015, 1, 1),
                          'assetScope': {
                              'assetId': 'string',
                              'filterIds': [
                                  'string',
                              ],
                              'status': 'string',
                              'errorMessage': 'string'
                          },
                          'permissions': {
                              's3': [
                                  'READ'|'WRITE',
                              ]
                          }
                      },
                  ],
                  'subscriptionId': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **items** *(list) --* 

        The results of the ``ListSubscriptionGrants`` action.

        
        

        - *(dict) --* 

          The details of the subscription grant.

          
          

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

            The identifier of the subscription grant.

            
          

          - **createdBy** *(string) --* 

            The datazone user who created the subscription grant.

            
          

          - **updatedBy** *(string) --* 

            The Amazon DataZone user who updated the subscription grant.

            
          

          - **domainId** *(string) --* 

            The identifier of the Amazon DataZone domain in which a subscription grant exists.

            
          

          - **createdAt** *(datetime) --* 

            The timestamp of when a subscription grant was created.

            
          

          - **updatedAt** *(datetime) --* 

            The timestamp of when the subscription grant was updated.

            
          

          - **environmentId** *(string) --* 

            The environment ID of the subscription grant.

            
          

          - **subscriptionTargetId** *(string) --* 

            The identifier of the target of the subscription grant.

            
          

          - **grantedEntity** *(dict) --* 

            The entity to which the subscription is granted.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``listing``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **listing** *(dict) --* 

              The listing for which a subscription is granted.

              
              

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

                An identifier of a revision of an asset published in a Amazon DataZone catalog.

                
              

              - **revision** *(string) --* 

                The details of a revision of an asset published in a Amazon DataZone catalog.

                
          
        
          

          - **status** *(string) --* 

            The status of the subscription grant.

            
          

          - **assets** *(list) --* 

            The assets included in the subscription grant.

            
            

            - *(dict) --* 

              The details of the asset for which the subscription grant is created.

              
              

              - **assetId** *(string) --* 

                The identifier of the asset for which the subscription grant is created.

                
              

              - **assetRevision** *(string) --* 

                The revision of the asset for which the subscription grant is created.

                
              

              - **status** *(string) --* 

                The status of the asset for which the subscription grant is created.

                
              

              - **targetName** *(string) --* 

                The target name of the asset for which the subscription grant is created.

                
              

              - **failureCause** *(dict) --* 

                The failure cause included in the details of the asset for which the subscription grant is created.

                
                

                - **message** *(string) --* 

                  The description of the error message.

                  
            
              

              - **grantedTimestamp** *(datetime) --* 

                The timestamp of when the subscription grant to the asset is created.

                
              

              - **failureTimestamp** *(datetime) --* 

                The failure timestamp included in the details of the asset for which the subscription grant is created.

                
              

              - **assetScope** *(dict) --* 

                The asset scope of the subscribed asset.

                
                

                - **assetId** *(string) --* 

                  The asset ID of the asset scope.

                  
                

                - **filterIds** *(list) --* 

                  The filter IDs of the asset scope.

                  
                  

                  - *(string) --* 
              
                

                - **status** *(string) --* 

                  The status of the asset scope.

                  
                

                - **errorMessage** *(string) --* 

                  The error message of the asset scope.

                  
            
              

              - **permissions** *(dict) --* 

                The asset permissions.

                .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``s3``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


              
                

                - **s3** *(list) --* 

                  The S3 details of the asset permissions.

                  
                  

                  - *(string) --* 
              
            
          
        
          

          - **subscriptionId** *(string) --* 

            The ID of the subscription.

            
      
    
      

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

        When the number of subscription grants is greater than the default value for the ``MaxResults`` parameter, or if you explicitly specify a value for ``MaxResults`` that is less than the number of subscription grants, the response includes a pagination token named ``NextToken``. You can specify this ``NextToken`` value in a subsequent call to ``ListSubscriptionGrants`` to list the next set of subscription grants.

        
  
  **Exceptions**
  
  *   :py:class:`DataZone.Client.exceptions.InternalServerException`

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

  
  *   :py:class:`DataZone.Client.exceptions.AccessDeniedException`

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

  
  *   :py:class:`DataZone.Client.exceptions.ValidationException`

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

  