def addprojecthook(self, project_id, url, push=False, issues=False, merge_requests=False, tag_push=False):
        """
        add a hook to a project

        :param project_id: project id
        :param url: url of the hook
        :return: True if success
        """
        data = {
            'id': project_id,
            'url': url,
            'push_events': int(bool(push)),
            'issues_events': int(bool(issues)),
            'merge_requests_events': int(bool(merge_requests)),
            'tag_push_events': int(bool(tag_push)),
        }

        request = requests.post(
            '{0}/{1}/hooks'.format(self.projects_url, project_id),
            headers=self.headers, data=data, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return request.json()
        else:
            return False
def addprojecthook ( self , project_id , url , push = False , issues = False , merge_requests = False , tag_push = False ) : data = { 'id' : project_id , 'url' : url , 'push_events' : int ( bool ( push ) ) , 'issues_events' : int ( bool ( issues ) ) , 'merge_requests_events' : int ( bool ( merge_requests ) ) , 'tag_push_events' : int ( bool ( tag_push ) ) , } request = requests . post ( '{0}/{1}/hooks' . format ( self . projects_url , project_id ) , headers = self . headers , data = data , verify = self . verify_ssl , auth = self . auth , timeout = self . timeout ) if request . status_code == 201 : return request . json ( ) else : return False
add a hook to a project

        :param project_id: project id
        :param url: url of the hook
        :return: True if success