def _delete(module, api_url, project, hook_id, access_token, private_token): path = "/hooks/%s" % str(hook_id) return request(module, api_url, project, path, access_token, private_token, method='DELETE')
def _delete(module, api_url, project, key_id, access_token, private_token): path = "/deploy_keys/%s" % str(key_id) return request(module, api_url, project, path, access_token, private_token, method='DELETE')
def _publish(module, api_url, project, data, access_token, private_token): path = "/hooks" method = "POST" if 'id' in data: path += "/%s" % str(data["id"]) method = "PUT" data = deepcopy(data) data.pop('id', None) return request(module, api_url, project, path, access_token, private_token, json.dumps(data, sort_keys=True), method)
def _list(module, api_url, project, access_token, private_token): path = "/hooks" return request(module, api_url, project, path, access_token, private_token)