Exemplo n.º 1
0
  def update(self, uuid, description, hook_url, events, active=True):
    """ Updates an existing webhook. """
    url = repository_webhook_url(self._namespace, self._repository_name, uuid)
    data = {
      'description': description,
      'url': hook_url,
      'active': active,
      'events': events
    }

    return self._dispatcher.dispatch(url, method='PUT', access_token=self._access_token,
                                     access_token_secret=self._access_token_secret, json_body=True,
                                     **data)
Exemplo n.º 2
0
 def delete(self, uuid):
   """ Deletes the specified webhook. """
   url = repository_webhook_url(self._namespace, self._repository_name, uuid)
   return self._dispatcher.dispatch(url, method='DELETE', access_token=self._access_token,
                                         access_token_secret=self._access_token_secret)
Exemplo n.º 3
0
 def get(self, uuid):
   """ Returns the contents of the specified webhook. """
   url = repository_webhook_url(self._namespace, self._repository_name, uuid)
   return self._dispatcher.dispatch(url, access_token=self._access_token,
                                         access_token_secret=self._access_token_secret)