:doc:`CodeCommit <../../codecommit>` / Client / put_repository_triggers

***********************
put_repository_triggers
***********************



.. py:method:: CodeCommit.Client.put_repository_triggers(**kwargs)

  

  Replaces all triggers for a repository. Used to create or delete triggers.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers>`_  


  **Request Syntax**
  ::

    response = client.put_repository_triggers(
        repositoryName='string',
        triggers=[
            {
                'name': 'string',
                'destinationArn': 'string',
                'customData': 'string',
                'branches': [
                    'string',
                ],
                'events': [
                    'all'|'updateReference'|'createReference'|'deleteReference',
                ]
            },
        ]
    )
    
  :type repositoryName: string
  :param repositoryName: **[REQUIRED]** 

    The name of the repository where you want to create or update the trigger.

    

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

    The JSON block of configuration information for each trigger.

    

  
    - *(dict) --* 

      Information about a trigger for a repository.

       

      .. note::

        

        If you want to receive notifications about repository events, consider using notifications instead of triggers. For more information, see `Configuring notifications for repository events <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html>`__.

        

      

    
      - **name** *(string) --* **[REQUIRED]** 

        The name of the trigger.

        

      
      - **destinationArn** *(string) --* **[REQUIRED]** 

        The ARN of the resource that is the target for a trigger (for example, the ARN of a topic in Amazon SNS).

        

      
      - **customData** *(string) --* 

        Any custom data associated with the trigger to be included in the information sent to the target of the trigger.

        

      
      - **branches** *(list) --* 

        The branches to be included in the trigger configuration. If you specify an empty array, the trigger applies to all branches.

         

        .. note::

          

          Although no content is required in the array, you must include the array itself.

          

        

      
        - *(string) --* 

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

        The repository events that cause the trigger to run actions in another service, such as sending a notification through Amazon SNS.

         

        .. note::

          

          The valid value "all" cannot be used with any other values.

          

        

      
        - *(string) --* 

        
    
    

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

    
    ::

      {
          'configurationId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the output of a put repository triggers operation.

      
      

      - **configurationId** *(string) --* 

        The system-generated unique ID for the create or update operation.

        
  
  **Exceptions**
  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryDoesNotExistException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryNameRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryNameException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryTriggersListRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.MaximumRepositoryTriggersExceededException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryTriggerNameException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryTriggerDestinationArnException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryTriggerRegionException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryTriggerCustomDataException`

  
  *   :py:class:`CodeCommit.Client.exceptions.MaximumBranchesExceededException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryTriggerBranchNameException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryTriggerEventsException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryTriggerNameRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryTriggerDestinationArnRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryTriggerBranchNameListRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryTriggerEventsListRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyAccessDeniedException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyDisabledException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyNotFoundException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyUnavailableException`

  