diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api-objects.rst | 1 | ||||
-rw-r--r-- | docs/gl_objects/branches.py | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/api-objects.rst b/docs/api-objects.rst index 78b9646..4b40ce1 100644 --- a/docs/api-objects.rst +++ b/docs/api-objects.rst @@ -7,6 +7,7 @@ API examples gl_objects/access_requests gl_objects/branches + gl_objects/protected_branches gl_objects/messages gl_objects/builds gl_objects/commits diff --git a/docs/gl_objects/branches.py b/docs/gl_objects/branches.py index b80dfc0..431e09d 100644 --- a/docs/gl_objects/branches.py +++ b/docs/gl_objects/branches.py @@ -26,3 +26,21 @@ branch.delete() branch.protect() branch.unprotect() # end protect + +# p_branch list +p_branches = project.protectedbranches.list() +# end p_branch list + +# p_branch get +p_branch = project.protectedbranches.get('master') +# end p_branch get + +# p_branch create +p_branch = project.protectedbranches.create({'name': '*-stable'}) +# end p_branch create + +# p_branch delete +project.protectedbranches.delete('*-stable') +# or +p_branch.delete() +# end p_branch delete |