summaryrefslogtreecommitdiff
path: root/docs/gl_objects/branches.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-07-16 13:18:46 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2016-07-16 13:18:46 +0200
commitcdd801ecc6e685ede6db02c9da45b581c07b162e (patch)
tree3d1eee22756fe88e4bfc8b1d8a3fee1312c40e80 /docs/gl_objects/branches.py
parentc88c6381036b8ef4668222329f543bc7d058f9c6 (diff)
downloadgitlab-cdd801ecc6e685ede6db02c9da45b581c07b162e.tar.gz
Add branches API documentation
Diffstat (limited to 'docs/gl_objects/branches.py')
-rw-r--r--docs/gl_objects/branches.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/gl_objects/branches.py b/docs/gl_objects/branches.py
new file mode 100644
index 0000000..b485ee0
--- /dev/null
+++ b/docs/gl_objects/branches.py
@@ -0,0 +1,33 @@
+# list
+branches = gl.project_branches.list(project_id=1)
+# or
+branches = project.branches.list()
+# end list
+
+# get
+branch = gl.project_branches.get(project_id=1, id='master')
+# or
+branch = project.branches.get('master')
+# end get
+
+# create
+branch = gl.project_branches.create({'branch_name': 'feature1',
+ 'ref': 'master'},
+ project_id=1)
+# or
+branch = project.branches.create({'branch_name': 'feature1',
+ 'ref': 'master'})
+# end create
+
+# delete
+gl.project_branches.delete(project_id=1, id='feature1')
+# or
+project.branches.delete('feature1')
+# or
+branch.delete()
+# end delete
+
+# protect
+branch.protect()
+branch.unprotect()
+# end protect