:doc:`ServerlessApplicationRepository <../../serverlessrepo>` / Client / put_application_policy

**********************
put_application_policy
**********************



.. py:method:: ServerlessApplicationRepository.Client.put_application_policy(**kwargs)

  

  Sets the permission policy for an application. For the list of actions supported for this operation, see
 `Application Permissions <https://docs.aws.amazon.com/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions>`__
 .

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/PutApplicationPolicy>`_  


  **Request Syntax**
  ::

    response = client.put_application_policy(
        ApplicationId='string',
        Statements=[
            {
                'Actions': [
                    'string',
                ],
                'PrincipalOrgIDs': [
                    'string',
                ],
                'Principals': [
                    'string',
                ],
                'StatementId': 'string'
            },
        ]
    )
    
  :type ApplicationId: string
  :param ApplicationId: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the application.

    

  
  :type Statements: list
  :param Statements: **[REQUIRED]** 

    An array of policy statements applied to the application.

    

  
    - *(dict) --* 

      Policy statement applied to the application.

      

    
      - **Actions** *(list) --* **[REQUIRED]** 

        For the list of actions supported for this operation, see `Application Permissions <https://docs.aws.amazon.com/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions>`__.

        

      
        - *(string) --* 

        
    
      - **PrincipalOrgIDs** *(list) --* 

        An array of PrinciplalOrgIDs, which corresponds to AWS IAM `aws\:PrincipalOrgID <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#principal-org-id>`__ global condition key.

        

      
        - *(string) --* 

        
    
      - **Principals** *(list) --* **[REQUIRED]** 

        An array of AWS account IDs, or * to make the application public.

        

      
        - *(string) --* 

        
    
      - **StatementId** *(string) --* 

        A unique ID for the statement.

        

      
    

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

    
    ::

      {
          'Statements': [
              {
                  'Actions': [
                      'string',
                  ],
                  'PrincipalOrgIDs': [
                      'string',
                  ],
                  'Principals': [
                      'string',
                  ],
                  'StatementId': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Success

      
      

      - **Statements** *(list) --* 

        An array of policy statements applied to the application.

        
        

        - *(dict) --* 

          Policy statement applied to the application.

          
          

          - **Actions** *(list) --* 

            For the list of actions supported for this operation, see `Application Permissions <https://docs.aws.amazon.com/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions>`__.

            
            

            - *(string) --* 
        
          

          - **PrincipalOrgIDs** *(list) --* 

            An array of PrinciplalOrgIDs, which corresponds to AWS IAM `aws\:PrincipalOrgID <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#principal-org-id>`__ global condition key.

            
            

            - *(string) --* 
        
          

          - **Principals** *(list) --* 

            An array of AWS account IDs, or * to make the application public.

            
            

            - *(string) --* 
        
          

          - **StatementId** *(string) --* 

            A unique ID for the statement.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ServerlessApplicationRepository.Client.exceptions.NotFoundException`

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

  
  *   :py:class:`ServerlessApplicationRepository.Client.exceptions.BadRequestException`

  
  *   :py:class:`ServerlessApplicationRepository.Client.exceptions.InternalServerErrorException`

  
  *   :py:class:`ServerlessApplicationRepository.Client.exceptions.ForbiddenException`

  