Commit b6b10eeb authored by Sander van Harmelen's avatar Sander van Harmelen

Tweak comments…

parent 3f9374bd
...@@ -21,8 +21,8 @@ import ( ...@@ -21,8 +21,8 @@ import (
"net/url" "net/url"
) )
// LabelsService handles communication with the label related methods // LabelsService handles communication with the label related methods of the
// of the GitLab API. // GitLab API.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/labels.html // GitLab API docs: https://docs.gitlab.com/ce/api/labels.html
type LabelsService struct { type LabelsService struct {
...@@ -164,8 +164,8 @@ func (s *LabelsService) UpdateLabel(pid interface{}, opt *UpdateLabelOptions, op ...@@ -164,8 +164,8 @@ func (s *LabelsService) UpdateLabel(pid interface{}, opt *UpdateLabelOptions, op
} }
// SubscribeToLabel subscribes the authenticated user to a label to receive // SubscribeToLabel subscribes the authenticated user to a label to receive
// notifications. If the user is already subscribed to the label, // notifications. If the user is already subscribed to the label, the status
// the status code 304 is returned. // code 304 is returned.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/labels.html#subscribe-to-a-label // https://docs.gitlab.com/ce/api/labels.html#subscribe-to-a-label
...@@ -188,15 +188,15 @@ func (s *LabelsService) SubscribeToLabel(pid interface{}, labelID interface{}, o ...@@ -188,15 +188,15 @@ func (s *LabelsService) SubscribeToLabel(pid interface{}, labelID interface{}, o
l := new(Label) l := new(Label)
resp, err := s.client.Do(req, l) resp, err := s.client.Do(req, l)
if err != nil { if err != nil {
return nil, resp, err return nil, resp, err
} }
return l, resp, err return l, resp, err
} }
// UnsubscribeFromLabel unsubscribes the authenticated user from a label // UnsubscribeFromLabel unsubscribes the authenticated user from a label to not
// to not receive notifications from it. If the user is not subscribed // receive notifications from it. If the user is not subscribed to the label, the
// to the label, the status code 304 is returned. // status code 304 is returned.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/labels.html#unsubscribe-from-a-label // https://docs.gitlab.com/ce/api/labels.html#unsubscribe-from-a-label
......
...@@ -21,8 +21,8 @@ import ( ...@@ -21,8 +21,8 @@ import (
"net/url" "net/url"
) )
// ProtectedBranchesService handles communication with the // ProtectedBranchesService handles communication with the protected branch
// protected branch related methods of the GitLab API. // related methods of the GitLab API.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api // https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api
...@@ -30,8 +30,8 @@ type ProtectedBranchesService struct { ...@@ -30,8 +30,8 @@ type ProtectedBranchesService struct {
client *Client client *Client
} }
// BranchAccessDescription represents the access description for a // BranchAccessDescription represents the access description for a protected
// protected branch // branch.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api // https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api
...@@ -40,7 +40,7 @@ type BranchAccessDescription struct { ...@@ -40,7 +40,7 @@ type BranchAccessDescription struct {
AccessLevelDescription string `json:"access_level_description"` AccessLevelDescription string `json:"access_level_description"`
} }
// ProtectedBranch represents a protected branch // ProtectedBranch represents a protected branch.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches // https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches
...@@ -50,7 +50,7 @@ type ProtectedBranch struct { ...@@ -50,7 +50,7 @@ type ProtectedBranch struct {
MergeAccessLevels []*BranchAccessDescription `json:"merge_access_levels"` MergeAccessLevels []*BranchAccessDescription `json:"merge_access_levels"`
} }
// ListProtectedBranches gets a list of protected branches from a project // ListProtectedBranches gets a list of protected branches from a project.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches // https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches
...@@ -75,17 +75,16 @@ func (s *ProtectedBranchesService) ListProtectedBranches(pid interface{}, option ...@@ -75,17 +75,16 @@ func (s *ProtectedBranchesService) ListProtectedBranches(pid interface{}, option
return p, resp, err return p, resp, err
} }
// GetProtectedBranch gets a single protected branch // GetProtectedBranch gets a single protected branch or wildcard protected branch.
// or wildcard protected branch
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#get-a-single-protected-branch-or-wildcard-protected-branch // https://docs.gitlab.com/ce/api/protected_branches.html#get-a-single-protected-branch-or-wildcard-protected-branch
func (s *ProtectedBranchesService) GetProtectedBranch(pid interface{}, name string, options ...OptionFunc) (*ProtectedBranch, *Response, error) { func (s *ProtectedBranchesService) GetProtectedBranch(pid interface{}, branch string, options ...OptionFunc) (*ProtectedBranch, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
u := fmt.Sprintf("projects/%s/protected_branches/%s", url.QueryEscape(project), name) u := fmt.Sprintf("projects/%s/protected_branches/%s", url.QueryEscape(project), branch)
req, err := s.client.NewRequest("GET", u, nil, options) req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil { if err != nil {
...@@ -138,17 +137,17 @@ func (s *ProtectedBranchesService) ProtectRepositoryBranches(pid interface{}, op ...@@ -138,17 +137,17 @@ func (s *ProtectedBranchesService) ProtectRepositoryBranches(pid interface{}, op
return p, resp, err return p, resp, err
} }
// UnprotectRepositoryBranches unprotects the given protected branch // UnprotectRepositoryBranches unprotects the given protected branch or wildcard
// or wildcard protected branch // protected branch.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/protected_branches.html#unprotect-repository-branches // https://docs.gitlab.com/ce/api/protected_branches.html#unprotect-repository-branches
func (s *ProtectedBranchesService) UnprotectRepositoryBranches(pid interface{}, name string, options ...OptionFunc) (*Response, error) { func (s *ProtectedBranchesService) UnprotectRepositoryBranches(pid interface{}, branch string, options ...OptionFunc) (*Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, err return nil, err
} }
u := fmt.Sprintf("projects/%s/protected_branches/%s", url.QueryEscape(project), name) u := fmt.Sprintf("projects/%s/protected_branches/%s", url.QueryEscape(project), branch)
req, err := s.client.NewRequest("DELETE", u, nil, options) req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment