Commit 3826965f authored by Sander van Harmelen's avatar Sander van Harmelen Committed by GitHub

Refactored the function signatures (#127)

parent 726289be
...@@ -126,9 +126,7 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string) (*Branch ...@@ -126,9 +126,7 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string) (*Branch
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/branches.html#unprotect-repository-branch // https://docs.gitlab.com/ce/api/branches.html#unprotect-repository-branch
func (s *BranchesService) UnprotectBranch( func (s *BranchesService) UnprotectBranch(pid interface{}, branch string) (*Branch, *Response, error) {
pid interface{},
branch string) (*Branch, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -162,9 +160,7 @@ type CreateBranchOptions struct { ...@@ -162,9 +160,7 @@ type CreateBranchOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/branches.html#create-repository-branch // https://docs.gitlab.com/ce/api/branches.html#create-repository-branch
func (s *BranchesService) CreateBranch( func (s *BranchesService) CreateBranch(pid interface{}, opt *CreateBranchOptions) (*Branch, *Response, error) {
pid interface{},
opt *CreateBranchOptions) (*Branch, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -63,9 +63,7 @@ type ListCommitsOptions struct { ...@@ -63,9 +63,7 @@ type ListCommitsOptions struct {
// ListCommits gets a list of repository commits in a project. // ListCommits gets a list of repository commits in a project.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#list-commits // GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#list-commits
func (s *CommitsService) ListCommits( func (s *CommitsService) ListCommits(pid interface{}, opt *ListCommitsOptions) ([]*Commit, *Response, error) {
pid interface{},
opt *ListCommitsOptions) ([]*Commit, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -90,9 +88,7 @@ func (s *CommitsService) ListCommits( ...@@ -90,9 +88,7 @@ func (s *CommitsService) ListCommits(
// branch or tag. // branch or tag.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#get-a-single-commit // GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#get-a-single-commit
func (s *CommitsService) GetCommit( func (s *CommitsService) GetCommit(pid interface{}, sha string) (*Commit, *Response, error) {
pid interface{},
sha string) (*Commit, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -135,9 +131,7 @@ func (d Diff) String() string { ...@@ -135,9 +131,7 @@ func (d Diff) String() string {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/commits.html#get-the-diff-of-a-commit // https://docs.gitlab.com/ce/api/commits.html#get-the-diff-of-a-commit
func (s *CommitsService) GetCommitDiff( func (s *CommitsService) GetCommitDiff(pid interface{}, sha string) ([]*Diff, *Response, error) {
pid interface{},
sha string) ([]*Diff, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -188,9 +182,7 @@ func (c CommitComment) String() string { ...@@ -188,9 +182,7 @@ func (c CommitComment) String() string {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/commits.html#get-the-comments-of-a-commit // https://docs.gitlab.com/ce/api/commits.html#get-the-comments-of-a-commit
func (s *CommitsService) GetCommitComments( func (s *CommitsService) GetCommitComments(pid interface{}, sha string) ([]*CommitComment, *Response, error) {
pid interface{},
sha string) ([]*CommitComment, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -229,10 +221,7 @@ type PostCommitCommentOptions struct { ...@@ -229,10 +221,7 @@ type PostCommitCommentOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/commits.html#post-comment-to-commit // https://docs.gitlab.com/ce/api/commits.html#post-comment-to-commit
func (s *CommitsService) PostCommitComment( func (s *CommitsService) PostCommitComment(pid interface{}, sha string, opt *PostCommitCommentOptions) (*CommitComment, *Response, error) {
pid interface{},
sha string,
opt *PostCommitCommentOptions) (*CommitComment, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -283,10 +272,7 @@ type CommitStatus struct { ...@@ -283,10 +272,7 @@ type CommitStatus struct {
// GetCommitStatuses gets the statuses of a commit in a project. // GetCommitStatuses gets the statuses of a commit in a project.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#get-the-status-of-a-commit // GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#get-the-status-of-a-commit
func (s *CommitsService) GetCommitStatuses( func (s *CommitsService) GetCommitStatuses(pid interface{}, sha string, opt *GetCommitStatusesOptions) ([]*CommitStatus, *Response, error) {
pid interface{},
sha string,
opt *GetCommitStatusesOptions) ([]*CommitStatus, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -334,10 +320,7 @@ const ( ...@@ -334,10 +320,7 @@ const (
// SetCommitStatus sets the status of a commit in a project. // SetCommitStatus sets the status of a commit in a project.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#post-the-status-to-commit // GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#post-the-status-to-commit
func (s *CommitsService) SetCommitStatus( func (s *CommitsService) SetCommitStatus(pid interface{}, sha string, opt *SetCommitStatusOptions) (*CommitStatus, *Response, error) {
pid interface{},
sha string,
opt *SetCommitStatusOptions) (*CommitStatus, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -71,9 +71,7 @@ func (s *DeployKeysService) ListDeployKeys(pid interface{}) ([]*DeployKey, *Resp ...@@ -71,9 +71,7 @@ func (s *DeployKeysService) ListDeployKeys(pid interface{}) ([]*DeployKey, *Resp
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/deploy_keys.html#single-deploy-key // https://docs.gitlab.com/ce/api/deploy_keys.html#single-deploy-key
func (s *DeployKeysService) GetDeployKey( func (s *DeployKeysService) GetDeployKey(pid interface{}, deployKey int) (*DeployKey, *Response, error) {
pid interface{},
deployKey int) (*DeployKey, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -109,9 +107,7 @@ type AddDeployKeyOptions struct { ...@@ -109,9 +107,7 @@ type AddDeployKeyOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/deploy_keys.html#add-deploy-key // https://docs.gitlab.com/ce/api/deploy_keys.html#add-deploy-key
func (s *DeployKeysService) AddDeployKey( func (s *DeployKeysService) AddDeployKey(pid interface{}, opt *AddDeployKeyOptions) (*DeployKey, *Response, error) {
pid interface{},
opt *AddDeployKeyOptions) (*DeployKey, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -272,9 +272,7 @@ type AddGroupMemberOptions struct { ...@@ -272,9 +272,7 @@ type AddGroupMemberOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/groups.html#list-group-members // https://docs.gitlab.com/ce/api/groups.html#list-group-members
func (s *GroupsService) AddGroupMember( func (s *GroupsService) AddGroupMember(gid interface{}, opt *AddGroupMemberOptions) (*GroupMember, *Response, error) {
gid interface{},
opt *AddGroupMemberOptions) (*GroupMember, *Response, error) {
group, err := parseID(gid) group, err := parseID(gid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -308,10 +306,7 @@ type UpdateGroupMemberOptions struct { ...@@ -308,10 +306,7 @@ type UpdateGroupMemberOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/groups.html#list-group-members // https://docs.gitlab.com/ce/api/groups.html#list-group-members
func (s *GroupsService) UpdateGroupMember( func (s *GroupsService) UpdateGroupMember(gid interface{}, user int, opt *UpdateGroupMemberOptions) (*GroupMember, *Response, error) {
gid interface{},
user int,
opt *UpdateGroupMemberOptions) (*GroupMember, *Response, error) {
group, err := parseID(gid) group, err := parseID(gid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -128,9 +128,7 @@ type ListProjectIssuesOptions struct { ...@@ -128,9 +128,7 @@ type ListProjectIssuesOptions struct {
// pagination parameters page and per_page to return the list of project issues. // pagination parameters page and per_page to return the list of project issues.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-project-issues // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-project-issues
func (s *IssuesService) ListProjectIssues( func (s *IssuesService) ListProjectIssues(pid interface{}, opt *ListProjectIssuesOptions) ([]*Issue, *Response, error) {
pid interface{},
opt *ListProjectIssuesOptions) ([]*Issue, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -189,9 +187,7 @@ type CreateIssueOptions struct { ...@@ -189,9 +187,7 @@ type CreateIssueOptions struct {
// CreateIssue creates a new project issue. // CreateIssue creates a new project issue.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#new-issues // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#new-issues
func (s *IssuesService) CreateIssue( func (s *IssuesService) CreateIssue(pid interface{}, opt *CreateIssueOptions) (*Issue, *Response, error) {
pid interface{},
opt *CreateIssueOptions) (*Issue, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -228,10 +224,7 @@ type UpdateIssueOptions struct { ...@@ -228,10 +224,7 @@ type UpdateIssueOptions struct {
// to mark an issue as closed. // to mark an issue as closed.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#edit-issues // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#edit-issues
func (s *IssuesService) UpdateIssue( func (s *IssuesService) UpdateIssue(pid interface{}, issue int, opt *UpdateIssueOptions) (*Issue, *Response, error) {
pid interface{},
issue int,
opt *UpdateIssueOptions) (*Issue, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -82,9 +82,7 @@ type CreateLabelOptions struct { ...@@ -82,9 +82,7 @@ type CreateLabelOptions struct {
// color. // color.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/labels.html#create-a-new-label // GitLab API docs: https://docs.gitlab.com/ce/api/labels.html#create-a-new-label
func (s *LabelsService) CreateLabel( func (s *LabelsService) CreateLabel(pid interface{}, opt *CreateLabelOptions) (*Label, *Response, error) {
pid interface{},
opt *CreateLabelOptions) (*Label, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -144,9 +142,7 @@ type UpdateLabelOptions struct { ...@@ -144,9 +142,7 @@ type UpdateLabelOptions struct {
// one parameter is required, to update the label. // one parameter is required, to update the label.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/labels.html#edit-an-existing-label // GitLab API docs: https://docs.gitlab.com/ce/api/labels.html#edit-an-existing-label
func (s *LabelsService) UpdateLabel( func (s *LabelsService) UpdateLabel(pid interface{}, opt *UpdateLabelOptions) (*Label, *Response, error) {
pid interface{},
opt *UpdateLabelOptions) (*Label, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -118,9 +118,7 @@ type ListMergeRequestsOptions struct { ...@@ -118,9 +118,7 @@ type ListMergeRequestsOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#list-merge-requests // https://docs.gitlab.com/ce/api/merge_requests.html#list-merge-requests
func (s *MergeRequestsService) ListMergeRequests( func (s *MergeRequestsService) ListMergeRequests(pid interface{}, opt *ListMergeRequestsOptions) ([]*MergeRequest, *Response, error) {
pid interface{},
opt *ListMergeRequestsOptions) ([]*MergeRequest, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -145,9 +143,7 @@ func (s *MergeRequestsService) ListMergeRequests( ...@@ -145,9 +143,7 @@ func (s *MergeRequestsService) ListMergeRequests(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#get-single-mr // https://docs.gitlab.com/ce/api/merge_requests.html#get-single-mr
func (s *MergeRequestsService) GetMergeRequest( func (s *MergeRequestsService) GetMergeRequest(pid interface{}, mergeRequest int) (*MergeRequest, *Response, error) {
pid interface{},
mergeRequest int) (*MergeRequest, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -173,9 +169,7 @@ func (s *MergeRequestsService) GetMergeRequest( ...@@ -173,9 +169,7 @@ func (s *MergeRequestsService) GetMergeRequest(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#get-single-mr-changes // https://docs.gitlab.com/ce/api/merge_requests.html#get-single-mr-changes
func (s *MergeRequestsService) GetMergeRequestChanges( func (s *MergeRequestsService) GetMergeRequestChanges(pid interface{}, mergeRequest int) (*MergeRequest, *Response, error) {
pid interface{},
mergeRequest int) (*MergeRequest, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -214,9 +208,7 @@ type CreateMergeRequestOptions struct { ...@@ -214,9 +208,7 @@ type CreateMergeRequestOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#create-mr // https://docs.gitlab.com/ce/api/merge_requests.html#create-mr
func (s *MergeRequestsService) CreateMergeRequest( func (s *MergeRequestsService) CreateMergeRequest(pid interface{}, opt *CreateMergeRequestOptions) (*MergeRequest, *Response, error) {
pid interface{},
opt *CreateMergeRequestOptions) (*MergeRequest, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -254,10 +246,7 @@ type UpdateMergeRequestOptions struct { ...@@ -254,10 +246,7 @@ type UpdateMergeRequestOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#update-mr // https://docs.gitlab.com/ce/api/merge_requests.html#update-mr
func (s *MergeRequestsService) UpdateMergeRequest( func (s *MergeRequestsService) UpdateMergeRequest(pid interface{}, mergeRequest int, opt *UpdateMergeRequestOptions) (*MergeRequest, *Response, error) {
pid interface{},
mergeRequest int,
opt *UpdateMergeRequestOptions) (*MergeRequest, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -297,10 +286,7 @@ type AcceptMergeRequestOptions struct { ...@@ -297,10 +286,7 @@ type AcceptMergeRequestOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#accept-mr // https://docs.gitlab.com/ce/api/merge_requests.html#accept-mr
func (s *MergeRequestsService) AcceptMergeRequest( func (s *MergeRequestsService) AcceptMergeRequest(pid interface{}, mergeRequest int, opt *AcceptMergeRequestOptions) (*MergeRequest, *Response, error) {
pid interface{},
mergeRequest int,
opt *AcceptMergeRequestOptions) (*MergeRequest, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -354,10 +340,7 @@ type GetMergeRequestCommentsOptions struct { ...@@ -354,10 +340,7 @@ type GetMergeRequestCommentsOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#get-the-comments-on-a-mr // https://docs.gitlab.com/ce/api/merge_requests.html#get-the-comments-on-a-mr
func (s *MergeRequestsService) GetMergeRequestComments( func (s *MergeRequestsService) GetMergeRequestComments(pid interface{}, mergeRequest int, opt *GetMergeRequestCommentsOptions) ([]*MergeRequestComment, *Response, error) {
pid interface{},
mergeRequest int,
opt *GetMergeRequestCommentsOptions) ([]*MergeRequestComment, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -391,10 +374,7 @@ type PostMergeRequestCommentOptions struct { ...@@ -391,10 +374,7 @@ type PostMergeRequestCommentOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/commits.html#post-comment-to-mr // https://docs.gitlab.com/ce/api/commits.html#post-comment-to-mr
func (s *MergeRequestsService) PostMergeRequestComment( func (s *MergeRequestsService) PostMergeRequestComment(pid interface{}, mergeRequest int, opt *PostMergeRequestCommentOptions) (*MergeRequestComment, *Response, error) {
pid interface{},
mergeRequest int,
opt *PostMergeRequestCommentOptions) (*MergeRequestComment, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -63,9 +63,7 @@ type ListMilestonesOptions struct { ...@@ -63,9 +63,7 @@ type ListMilestonesOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#list-project-milestones // https://docs.gitlab.com/ce/api/milestones.html#list-project-milestones
func (s *MilestonesService) ListMilestones( func (s *MilestonesService) ListMilestones(pid interface{}, opt *ListMilestonesOptions) ([]*Milestone, *Response, error) {
pid interface{},
opt *ListMilestonesOptions) ([]*Milestone, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -90,9 +88,7 @@ func (s *MilestonesService) ListMilestones( ...@@ -90,9 +88,7 @@ func (s *MilestonesService) ListMilestones(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#get-single-milestone // https://docs.gitlab.com/ce/api/milestones.html#get-single-milestone
func (s *MilestonesService) GetMilestone( func (s *MilestonesService) GetMilestone(pid interface{}, milestone int) (*Milestone, *Response, error) {
pid interface{},
milestone int) (*Milestone, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -128,9 +124,7 @@ type CreateMilestoneOptions struct { ...@@ -128,9 +124,7 @@ type CreateMilestoneOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#create-new-milestone // https://docs.gitlab.com/ce/api/milestones.html#create-new-milestone
func (s *MilestonesService) CreateMilestone( func (s *MilestonesService) CreateMilestone(pid interface{}, opt *CreateMilestoneOptions) (*Milestone, *Response, error) {
pid interface{},
opt *CreateMilestoneOptions) (*Milestone, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -167,10 +161,7 @@ type UpdateMilestoneOptions struct { ...@@ -167,10 +161,7 @@ type UpdateMilestoneOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#edit-milestone // https://docs.gitlab.com/ce/api/milestones.html#edit-milestone
func (s *MilestonesService) UpdateMilestone( func (s *MilestonesService) UpdateMilestone(pid interface{}, milestone int, opt *UpdateMilestoneOptions) (*Milestone, *Response, error) {
pid interface{},
milestone int,
opt *UpdateMilestoneOptions) (*Milestone, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -203,10 +194,7 @@ type GetMilestoneIssuesOptions struct { ...@@ -203,10 +194,7 @@ type GetMilestoneIssuesOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#get-all-issues-assigned-to-a-single-milestone // https://docs.gitlab.com/ce/api/milestones.html#get-all-issues-assigned-to-a-single-milestone
func (s *MilestonesService) GetMilestoneIssues( func (s *MilestonesService) GetMilestoneIssues(pid interface{}, milestone int, opt *GetMilestoneIssuesOptions) ([]*Issue, *Response, error) {
pid interface{},
milestone int,
opt *GetMilestoneIssuesOptions) ([]*Issue, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -68,10 +68,7 @@ type ListIssueNotesOptions struct { ...@@ -68,10 +68,7 @@ type ListIssueNotesOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#list-project-issue-notes // https://docs.gitlab.com/ce/api/notes.html#list-project-issue-notes
func (s *NotesService) ListIssueNotes( func (s *NotesService) ListIssueNotes(pid interface{}, issue int, opt *ListIssueNotesOptions) ([]*Note, *Response, error) {
pid interface{},
issue int,
opt *ListIssueNotesOptions) ([]*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -96,10 +93,7 @@ func (s *NotesService) ListIssueNotes( ...@@ -96,10 +93,7 @@ func (s *NotesService) ListIssueNotes(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#get-single-issue-note // https://docs.gitlab.com/ce/api/notes.html#get-single-issue-note
func (s *NotesService) GetIssueNote( func (s *NotesService) GetIssueNote(pid interface{}, issue int, note int) (*Note, *Response, error) {
pid interface{},
issue int,
note int) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -133,10 +127,7 @@ type CreateIssueNoteOptions struct { ...@@ -133,10 +127,7 @@ type CreateIssueNoteOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#create-new-issue-note // https://docs.gitlab.com/ce/api/notes.html#create-new-issue-note
func (s *NotesService) CreateIssueNote( func (s *NotesService) CreateIssueNote(pid interface{}, issue int, opt *CreateIssueNoteOptions) (*Note, *Response, error) {
pid interface{},
issue int,
opt *CreateIssueNoteOptions) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -169,11 +160,7 @@ type UpdateIssueNoteOptions struct { ...@@ -169,11 +160,7 @@ type UpdateIssueNoteOptions struct {
// UpdateIssueNote modifies existing note of an issue. // UpdateIssueNote modifies existing note of an issue.
// //
// https://docs.gitlab.com/ce/api/notes.html#modify-existing-issue-note // https://docs.gitlab.com/ce/api/notes.html#modify-existing-issue-note
func (s *NotesService) UpdateIssueNote( func (s *NotesService) UpdateIssueNote(pid interface{}, issue int, note int, opt *UpdateIssueNoteOptions) (*Note, *Response, error) {
pid interface{},
issue int,
note int,
opt *UpdateIssueNoteOptions) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -224,10 +211,7 @@ func (s *NotesService) ListSnippetNotes(pid interface{}, snippet int) ([]*Note, ...@@ -224,10 +211,7 @@ func (s *NotesService) ListSnippetNotes(pid interface{}, snippet int) ([]*Note,
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#get-single-snippet-note // https://docs.gitlab.com/ce/api/notes.html#get-single-snippet-note
func (s *NotesService) GetSnippetNote( func (s *NotesService) GetSnippetNote(pid interface{}, snippet int, note int) (*Note, *Response, error) {
pid interface{},
snippet int,
note int) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -262,10 +246,7 @@ type CreateSnippetNoteOptions struct { ...@@ -262,10 +246,7 @@ type CreateSnippetNoteOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#create-new-snippet-note // https://docs.gitlab.com/ce/api/notes.html#create-new-snippet-note
func (s *NotesService) CreateSnippetNote( func (s *NotesService) CreateSnippetNote(pid interface{}, snippet int, opt *CreateSnippetNoteOptions) (*Note, *Response, error) {
pid interface{},
snippet int,
opt *CreateSnippetNoteOptions) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -298,11 +279,7 @@ type UpdateSnippetNoteOptions struct { ...@@ -298,11 +279,7 @@ type UpdateSnippetNoteOptions struct {
// UpdateSnippetNote modifies existing note of a snippet. // UpdateSnippetNote modifies existing note of a snippet.
// //
// https://docs.gitlab.com/ce/api/notes.html#modify-existing-snippet-note // https://docs.gitlab.com/ce/api/notes.html#modify-existing-snippet-note
func (s *NotesService) UpdateSnippetNote( func (s *NotesService) UpdateSnippetNote(pid interface{}, snippet int, note int, opt *UpdateSnippetNoteOptions) (*Note, *Response, error) {
pid interface{},
snippet int,
note int,
opt *UpdateSnippetNoteOptions) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -327,9 +304,7 @@ func (s *NotesService) UpdateSnippetNote( ...@@ -327,9 +304,7 @@ func (s *NotesService) UpdateSnippetNote(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#list-all-merge-request-notes // https://docs.gitlab.com/ce/api/notes.html#list-all-merge-request-notes
func (s *NotesService) ListMergeRequestNotes( func (s *NotesService) ListMergeRequestNotes(pid interface{}, mergeRequest int) ([]*Note, *Response, error) {
pid interface{},
mergeRequest int) ([]*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -354,10 +329,7 @@ func (s *NotesService) ListMergeRequestNotes( ...@@ -354,10 +329,7 @@ func (s *NotesService) ListMergeRequestNotes(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#get-single-merge-request-note // https://docs.gitlab.com/ce/api/notes.html#get-single-merge-request-note
func (s *NotesService) GetMergeRequestNote( func (s *NotesService) GetMergeRequestNote(pid interface{}, mergeRequest int, note int) (*Note, *Response, error) {
pid interface{},
mergeRequest int,
note int) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -391,10 +363,7 @@ type CreateMergeRequestNoteOptions struct { ...@@ -391,10 +363,7 @@ type CreateMergeRequestNoteOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#create-new-merge-request-note // https://docs.gitlab.com/ce/api/notes.html#create-new-merge-request-note
func (s *NotesService) CreateMergeRequestNote( func (s *NotesService) CreateMergeRequestNote(pid interface{}, mergeRequest int, opt *CreateMergeRequestNoteOptions) (*Note, *Response, error) {
pid interface{},
mergeRequest int,
opt *CreateMergeRequestNoteOptions) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -427,11 +396,7 @@ type UpdateMergeRequestNoteOptions struct { ...@@ -427,11 +396,7 @@ type UpdateMergeRequestNoteOptions struct {
// UpdateMergeRequestNote modifies existing note of a merge request. // UpdateMergeRequestNote modifies existing note of a merge request.
// //
// https://docs.gitlab.com/ce/api/notes.html#modify-existing-merge-request-note // https://docs.gitlab.com/ce/api/notes.html#modify-existing-merge-request-note
func (s *NotesService) UpdateMergeRequestNote( func (s *NotesService) UpdateMergeRequestNote(pid interface{}, mergeRequest int, note int, opt *UpdateMergeRequestNoteOptions) (*Note, *Response, error) {
pid interface{},
mergeRequest int,
note int,
opt *UpdateMergeRequestNoteOptions) (*Note, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -65,9 +65,7 @@ type ListSnippetsOptions struct { ...@@ -65,9 +65,7 @@ type ListSnippetsOptions struct {
// ListSnippets gets a list of project snippets. // ListSnippets gets a list of project snippets.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/project_snippets.html#list-snippets // GitLab API docs: https://docs.gitlab.com/ce/api/project_snippets.html#list-snippets
func (s *ProjectSnippetsService) ListSnippets( func (s *ProjectSnippetsService) ListSnippets(pid interface{}, opt *ListSnippetsOptions) ([]*Snippet, *Response, error) {
pid interface{},
opt *ListSnippetsOptions) ([]*Snippet, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -92,9 +90,7 @@ func (s *ProjectSnippetsService) ListSnippets( ...@@ -92,9 +90,7 @@ func (s *ProjectSnippetsService) ListSnippets(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/project_snippets.html#single-snippet // https://docs.gitlab.com/ce/api/project_snippets.html#single-snippet
func (s *ProjectSnippetsService) GetSnippet( func (s *ProjectSnippetsService) GetSnippet(pid interface{}, snippet int) (*Snippet, *Response, error) {
pid interface{},
snippet int) (*Snippet, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -131,9 +127,7 @@ type CreateSnippetOptions struct { ...@@ -131,9 +127,7 @@ type CreateSnippetOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/project_snippets.html#create-new-snippet // https://docs.gitlab.com/ce/api/project_snippets.html#create-new-snippet
func (s *ProjectSnippetsService) CreateSnippet( func (s *ProjectSnippetsService) CreateSnippet(pid interface{}, opt *CreateSnippetOptions) (*Snippet, *Response, error) {
pid interface{},
opt *CreateSnippetOptions) (*Snippet, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -170,10 +164,7 @@ type UpdateSnippetOptions struct { ...@@ -170,10 +164,7 @@ type UpdateSnippetOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/project_snippets.html#update-snippet // https://docs.gitlab.com/ce/api/project_snippets.html#update-snippet
func (s *ProjectSnippetsService) UpdateSnippet( func (s *ProjectSnippetsService) UpdateSnippet(pid interface{}, snippet int, opt *UpdateSnippetOptions) (*Snippet, *Response, error) {
pid interface{},
snippet int,
opt *UpdateSnippetOptions) (*Snippet, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -219,9 +210,7 @@ func (s *ProjectSnippetsService) DeleteSnippet(pid interface{}, snippet int) (*R ...@@ -219,9 +210,7 @@ func (s *ProjectSnippetsService) DeleteSnippet(pid interface{}, snippet int) (*R
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/project_snippets.html#snippet-content // https://docs.gitlab.com/ce/api/project_snippets.html#snippet-content
func (s *ProjectSnippetsService) SnippetContent( func (s *ProjectSnippetsService) SnippetContent(pid interface{}, snippet int) ([]byte, *Response, error) {
pid interface{},
snippet int) ([]byte, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -166,8 +166,7 @@ func (s *ProjectsService) ListProjects(opt *ListProjectsOptions) ([]*Project, *R ...@@ -166,8 +166,7 @@ func (s *ProjectsService) ListProjects(opt *ListProjectsOptions) ([]*Project, *R
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#list-owned-projects // https://docs.gitlab.com/ce/api/projects.html#list-owned-projects
func (s *ProjectsService) ListOwnedProjects( func (s *ProjectsService) ListOwnedProjects(opt *ListProjectsOptions) ([]*Project, *Response, error) {
opt *ListProjectsOptions) ([]*Project, *Response, error) {
req, err := s.client.NewRequest("GET", "projects/owned", opt) req, err := s.client.NewRequest("GET", "projects/owned", opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -187,8 +186,7 @@ func (s *ProjectsService) ListOwnedProjects( ...@@ -187,8 +186,7 @@ func (s *ProjectsService) ListOwnedProjects(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#list-starred-projects // https://docs.gitlab.com/ce/api/projects.html#list-starred-projects
func (s *ProjectsService) ListStarredProjects( func (s *ProjectsService) ListStarredProjects(opt *ListProjectsOptions) ([]*Project, *Response, error) {
opt *ListProjectsOptions) ([]*Project, *Response, error) {
req, err := s.client.NewRequest("GET", "projects/starred", opt) req, err := s.client.NewRequest("GET", "projects/starred", opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -263,9 +261,7 @@ type SearchProjectsOptions struct { ...@@ -263,9 +261,7 @@ type SearchProjectsOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#search-for-projects-by-name // https://docs.gitlab.com/ce/api/projects.html#search-for-projects-by-name
func (s *ProjectsService) SearchProjects( func (s *ProjectsService) SearchProjects(query string, opt *SearchProjectsOptions) ([]*Project, *Response, error) {
query string,
opt *SearchProjectsOptions) ([]*Project, *Response, error) {
u := fmt.Sprintf("projects/search/%s", query) u := fmt.Sprintf("projects/search/%s", query)
req, err := s.client.NewRequest("GET", u, opt) req, err := s.client.NewRequest("GET", u, opt)
...@@ -324,9 +320,7 @@ type GetProjectEventsOptions struct { ...@@ -324,9 +320,7 @@ type GetProjectEventsOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#get-project-events // https://docs.gitlab.com/ce/api/projects.html#get-project-events
func (s *ProjectsService) GetProjectEvents( func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEventsOptions) ([]*ProjectEvent, *Response, error) {
pid interface{},
opt *GetProjectEventsOptions) ([]*ProjectEvent, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -374,8 +368,7 @@ type CreateProjectOptions struct { ...@@ -374,8 +368,7 @@ type CreateProjectOptions struct {
// CreateProject creates a new project owned by the authenticated user. // CreateProject creates a new project owned by the authenticated user.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#create-project // GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#create-project
func (s *ProjectsService) CreateProject( func (s *ProjectsService) CreateProject(opt *CreateProjectOptions) (*Project, *Response, error) {
opt *CreateProjectOptions) (*Project, *Response, error) {
req, err := s.client.NewRequest("POST", "projects", opt) req, err := s.client.NewRequest("POST", "projects", opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -413,9 +406,7 @@ type CreateProjectForUserOptions struct { ...@@ -413,9 +406,7 @@ type CreateProjectForUserOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#create-project-for-user // https://docs.gitlab.com/ce/api/projects.html#create-project-for-user
func (s *ProjectsService) CreateProjectForUser( func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUserOptions) (*Project, *Response, error) {
user int,
opt *CreateProjectForUserOptions) (*Project, *Response, error) {
u := fmt.Sprintf("projects/user/%d", user) u := fmt.Sprintf("projects/user/%d", user)
req, err := s.client.NewRequest("POST", u, opt) req, err := s.client.NewRequest("POST", u, opt)
...@@ -461,9 +452,7 @@ type EditProjectOptions struct { ...@@ -461,9 +452,7 @@ type EditProjectOptions struct {
// EditProject updates an existing project. // EditProject updates an existing project.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#edit-project // GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#edit-project
func (s *ProjectsService) EditProject( func (s *ProjectsService) EditProject(pid interface{}, opt *EditProjectOptions) (*Project, *Response, error) {
pid interface{},
opt *EditProjectOptions) (*Project, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -556,9 +545,7 @@ type ListProjectMembersOptions struct { ...@@ -556,9 +545,7 @@ type ListProjectMembersOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#list-project-team-members // https://docs.gitlab.com/ce/api/projects.html#list-project-team-members
func (s *ProjectsService) ListProjectMembers( func (s *ProjectsService) ListProjectMembers(pid interface{}, opt *ListProjectMembersOptions) ([]*ProjectMember, *Response, error) {
pid interface{},
opt *ListProjectMembersOptions) ([]*ProjectMember, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -583,9 +570,7 @@ func (s *ProjectsService) ListProjectMembers( ...@@ -583,9 +570,7 @@ func (s *ProjectsService) ListProjectMembers(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#get-project-team-member // https://docs.gitlab.com/ce/api/projects.html#get-project-team-member
func (s *ProjectsService) GetProjectMember( func (s *ProjectsService) GetProjectMember(pid interface{}, user int) (*ProjectMember, *Response, error) {
pid interface{},
user int) (*ProjectMember, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -622,9 +607,7 @@ type AddProjectMemberOptions struct { ...@@ -622,9 +607,7 @@ type AddProjectMemberOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#add-project-team-member // https://docs.gitlab.com/ce/api/projects.html#add-project-team-member
func (s *ProjectsService) AddProjectMember( func (s *ProjectsService) AddProjectMember(pid interface{}, opt *AddProjectMemberOptions) (*ProjectMember, *Response, error) {
pid interface{},
opt *AddProjectMemberOptions) (*ProjectMember, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -657,10 +640,7 @@ type EditProjectMemberOptions struct { ...@@ -657,10 +640,7 @@ type EditProjectMemberOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#edit-project-team-member // https://docs.gitlab.com/ce/api/projects.html#edit-project-team-member
func (s *ProjectsService) EditProjectMember( func (s *ProjectsService) EditProjectMember(pid interface{}, user int, opt *EditProjectMemberOptions) (*ProjectMember, *Response, error) {
pid interface{},
user int,
opt *EditProjectMemberOptions) (*ProjectMember, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -731,9 +711,7 @@ type ListProjectHooksOptions struct { ...@@ -731,9 +711,7 @@ type ListProjectHooksOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#list-project-hooks // https://docs.gitlab.com/ce/api/projects.html#list-project-hooks
func (s *ProjectsService) ListProjectHooks( func (s *ProjectsService) ListProjectHooks(pid interface{}, opt *ListProjectHooksOptions) ([]*ProjectHook, *Response, error) {
pid interface{},
opt *ListProjectHooksOptions) ([]*ProjectHook, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -758,9 +736,7 @@ func (s *ProjectsService) ListProjectHooks( ...@@ -758,9 +736,7 @@ func (s *ProjectsService) ListProjectHooks(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#get-project-hook // https://docs.gitlab.com/ce/api/projects.html#get-project-hook
func (s *ProjectsService) GetProjectHook( func (s *ProjectsService) GetProjectHook(pid interface{}, hook int) (*ProjectHook, *Response, error) {
pid interface{},
hook int) (*ProjectHook, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -803,9 +779,7 @@ type AddProjectHookOptions struct { ...@@ -803,9 +779,7 @@ type AddProjectHookOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#add-project-hook // https://docs.gitlab.com/ce/api/projects.html#add-project-hook
func (s *ProjectsService) AddProjectHook( func (s *ProjectsService) AddProjectHook(pid interface{}, opt *AddProjectHookOptions) (*ProjectHook, *Response, error) {
pid interface{},
opt *AddProjectHookOptions) (*ProjectHook, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -848,10 +822,7 @@ type EditProjectHookOptions struct { ...@@ -848,10 +822,7 @@ type EditProjectHookOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#edit-project-hook // https://docs.gitlab.com/ce/api/projects.html#edit-project-hook
func (s *ProjectsService) EditProjectHook( func (s *ProjectsService) EditProjectHook(pid interface{}, hook int, opt *EditProjectHookOptions) (*ProjectHook, *Response, error) {
pid interface{},
hook int,
opt *EditProjectHookOptions) (*ProjectHook, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -909,9 +880,7 @@ type ProjectForkRelation struct { ...@@ -909,9 +880,7 @@ type ProjectForkRelation struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/projects.html#create-a-forked-fromto-relation-between-existing-projects. // https://docs.gitlab.com/ce/api/projects.html#create-a-forked-fromto-relation-between-existing-projects.
func (s *ProjectsService) CreateProjectForkRelation( func (s *ProjectsService) CreateProjectForkRelation(pid int, fork int) (*ProjectForkRelation, *Response, error) {
pid int,
fork int) (*ProjectForkRelation, *Response, error) {
u := fmt.Sprintf("projects/%d/fork/%d", pid, fork) u := fmt.Sprintf("projects/%d/fork/%d", pid, fork)
req, err := s.client.NewRequest("POST", u, nil) req, err := s.client.NewRequest("POST", u, nil)
......
...@@ -57,9 +57,7 @@ type ListTreeOptions struct { ...@@ -57,9 +57,7 @@ type ListTreeOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repositories.html#list-repository-tree // https://docs.gitlab.com/ce/api/repositories.html#list-repository-tree
func (s *RepositoriesService) ListTree( func (s *RepositoriesService) ListTree(pid interface{}, opt *ListTreeOptions) ([]*TreeNode, *Response, error) {
pid interface{},
opt *ListTreeOptions) ([]*TreeNode, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -92,10 +90,7 @@ type RawFileContentOptions struct { ...@@ -92,10 +90,7 @@ type RawFileContentOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repositories.html#raw-file-content // https://docs.gitlab.com/ce/api/repositories.html#raw-file-content
func (s *RepositoriesService) RawFileContent( func (s *RepositoriesService) RawFileContent(pid interface{}, sha string, opt *RawFileContentOptions) ([]byte, *Response, error) {
pid interface{},
sha string,
opt *RawFileContentOptions) ([]byte, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -120,9 +115,7 @@ func (s *RepositoriesService) RawFileContent( ...@@ -120,9 +115,7 @@ func (s *RepositoriesService) RawFileContent(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repositories.html#raw-blob-content // https://docs.gitlab.com/ce/api/repositories.html#raw-blob-content
func (s *RepositoriesService) RawBlobContent( func (s *RepositoriesService) RawBlobContent(pid interface{}, sha string) ([]byte, *Response, error) {
pid interface{},
sha string) ([]byte, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -155,9 +148,7 @@ type ArchiveOptions struct { ...@@ -155,9 +148,7 @@ type ArchiveOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repositories.html#get-file-archive // https://docs.gitlab.com/ce/api/repositories.html#get-file-archive
func (s *RepositoriesService) Archive( func (s *RepositoriesService) Archive(pid interface{}, opt *ArchiveOptions) ([]byte, *Response, error) {
pid interface{},
opt *ArchiveOptions) ([]byte, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -207,9 +198,7 @@ type CompareOptions struct { ...@@ -207,9 +198,7 @@ type CompareOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repositories.html#compare-branches-tags-or-commits // https://docs.gitlab.com/ce/api/repositories.html#compare-branches-tags-or-commits
func (s *RepositoriesService) Compare( func (s *RepositoriesService) Compare(pid interface{}, opt *CompareOptions) (*Compare, *Response, error) {
pid interface{},
opt *CompareOptions) (*Compare, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -61,9 +61,7 @@ type GetFileOptions struct { ...@@ -61,9 +61,7 @@ type GetFileOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repository_files.html#get-file-from-respository // https://docs.gitlab.com/ce/api/repository_files.html#get-file-from-respository
func (s *RepositoryFilesService) GetFile( func (s *RepositoryFilesService) GetFile(pid interface{}, opt *GetFileOptions) (*File, *Response, error) {
pid interface{},
opt *GetFileOptions) (*File, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -114,9 +112,7 @@ type CreateFileOptions struct { ...@@ -114,9 +112,7 @@ type CreateFileOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repository_files.html#create-new-file-in-repository // https://docs.gitlab.com/ce/api/repository_files.html#create-new-file-in-repository
func (s *RepositoryFilesService) CreateFile( func (s *RepositoryFilesService) CreateFile(pid interface{}, opt *CreateFileOptions) (*FileInfo, *Response, error) {
pid interface{},
opt *CreateFileOptions) (*FileInfo, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -155,9 +151,7 @@ type UpdateFileOptions struct { ...@@ -155,9 +151,7 @@ type UpdateFileOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repository_files.html#update-existing-file-in-repository // https://docs.gitlab.com/ce/api/repository_files.html#update-existing-file-in-repository
func (s *RepositoryFilesService) UpdateFile( func (s *RepositoryFilesService) UpdateFile(pid interface{}, opt *UpdateFileOptions) (*FileInfo, *Response, error) {
pid interface{},
opt *UpdateFileOptions) (*FileInfo, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -194,9 +188,7 @@ type DeleteFileOptions struct { ...@@ -194,9 +188,7 @@ type DeleteFileOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/repository_files.html#delete-existing-file-in-repository // https://docs.gitlab.com/ce/api/repository_files.html#delete-existing-file-in-repository
func (s *RepositoryFilesService) DeleteFile( func (s *RepositoryFilesService) DeleteFile(pid interface{}, opt *DeleteFileOptions) (*FileInfo, *Response, error) {
pid interface{},
opt *DeleteFileOptions) (*FileInfo, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -60,9 +60,7 @@ type SetGitLabCIServiceOptions struct { ...@@ -60,9 +60,7 @@ type SetGitLabCIServiceOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#edit-gitlab-ci-service // https://docs.gitlab.com/ce/api/services.html#edit-gitlab-ci-service
func (s *ServicesService) SetGitLabCIService( func (s *ServicesService) SetGitLabCIService(pid interface{}, opt *SetGitLabCIServiceOptions) (*Response, error) {
pid interface{},
opt *SetGitLabCIServiceOptions) (*Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -110,9 +108,7 @@ type SetHipChatServiceOptions struct { ...@@ -110,9 +108,7 @@ type SetHipChatServiceOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#edit-hipchat-service // https://docs.gitlab.com/ce/api/services.html#edit-hipchat-service
func (s *ServicesService) SetHipChatService( func (s *ServicesService) SetHipChatService(pid interface{}, opt *SetHipChatServiceOptions) (*Response, error) {
pid interface{},
opt *SetHipChatServiceOptions) (*Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -161,9 +157,7 @@ type SetDroneCIServiceOptions struct { ...@@ -161,9 +157,7 @@ type SetDroneCIServiceOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#createedit-drone-ci-service // https://docs.gitlab.com/ce/api/services.html#createedit-drone-ci-service
func (s *ServicesService) SetDroneCIService( func (s *ServicesService) SetDroneCIService(pid interface{}, opt *SetDroneCIServiceOptions) (*Response, error) {
pid interface{},
opt *SetDroneCIServiceOptions) (*Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -250,9 +244,7 @@ type SetSlackServiceOptions struct { ...@@ -250,9 +244,7 @@ type SetSlackServiceOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#edit-slack-service // https://docs.gitlab.com/ce/api/services.html#edit-slack-service
func (s *ServicesService) SetSlackService( func (s *ServicesService) SetSlackService(pid interface{}, opt *SetSlackServiceOptions) (*Response, error) {
pid interface{},
opt *SetSlackServiceOptions) (*Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, err return nil, err
......
...@@ -41,10 +41,7 @@ type SetTimeEstimateOptions struct { ...@@ -41,10 +41,7 @@ type SetTimeEstimateOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#set-a-time-estimate-for-an-issue // https://docs.gitlab.com/ce/api/issues.html#set-a-time-estimate-for-an-issue
func (s *TimeStatsService) SetTimeEstimate( func (s *TimeStatsService) SetTimeEstimate(pid interface{}, issue int, opt *SetTimeEstimateOptions) (*TimeStats, *Response, error) {
pid interface{},
issue int,
opt *SetTimeEstimateOptions) (*TimeStats, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -69,9 +66,7 @@ func (s *TimeStatsService) SetTimeEstimate( ...@@ -69,9 +66,7 @@ func (s *TimeStatsService) SetTimeEstimate(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#reset-the-time-estimate-for-an-issue // https://docs.gitlab.com/ce/api/issues.html#reset-the-time-estimate-for-an-issue
func (s *TimeStatsService) ResetTimeEstimate( func (s *TimeStatsService) ResetTimeEstimate(pid interface{}, issue int) (*TimeStats, *Response, error) {
pid interface{},
issue int) (*TimeStats, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -104,10 +99,7 @@ type AddSpentTimeOptions struct { ...@@ -104,10 +99,7 @@ type AddSpentTimeOptions struct {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#add-spent-time-for-an-issue // https://docs.gitlab.com/ce/api/issues.html#add-spent-time-for-an-issue
func (s *TimeStatsService) AddSpentTime( func (s *TimeStatsService) AddSpentTime(pid interface{}, issue int, opt *AddSpentTimeOptions) (*TimeStats, *Response, error) {
pid interface{},
issue int,
opt *AddSpentTimeOptions) (*TimeStats, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -132,9 +124,7 @@ func (s *TimeStatsService) AddSpentTime( ...@@ -132,9 +124,7 @@ func (s *TimeStatsService) AddSpentTime(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#reset-spent-time-for-an-issue // https://docs.gitlab.com/ce/api/issues.html#reset-spent-time-for-an-issue
func (s *TimeStatsService) ResetSpentTime( func (s *TimeStatsService) ResetSpentTime(pid interface{}, issue int) (*TimeStats, *Response, error) {
pid interface{},
issue int) (*TimeStats, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -159,9 +149,7 @@ func (s *TimeStatsService) ResetSpentTime( ...@@ -159,9 +149,7 @@ func (s *TimeStatsService) ResetSpentTime(
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#get-time-tracking-stats // https://docs.gitlab.com/ce/api/issues.html#get-time-tracking-stats
func (s *TimeStatsService) GetTimeSpent( func (s *TimeStatsService) GetTimeSpent(pid interface{}, issue int) (*TimeStats, *Response, error) {
pid interface{},
issue int) (*TimeStats, *Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -330,9 +330,7 @@ func (s *UsersService) AddSSHKey(opt *AddSSHKeyOptions) (*SSHKey, *Response, err ...@@ -330,9 +330,7 @@ func (s *UsersService) AddSSHKey(opt *AddSSHKeyOptions) (*SSHKey, *Response, err
// admin. // admin.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/users.html#add-ssh-key-for-user // GitLab API docs: https://docs.gitlab.com/ce/api/users.html#add-ssh-key-for-user
func (s *UsersService) AddSSHKeyForUser( func (s *UsersService) AddSSHKeyForUser(user int, opt *AddSSHKeyOptions) (*SSHKey, *Response, error) {
user int,
opt *AddSSHKeyOptions) (*SSHKey, *Response, error) {
u := fmt.Sprintf("users/%d/keys", user) u := fmt.Sprintf("users/%d/keys", user)
req, err := s.client.NewRequest("POST", u, opt) req, err := s.client.NewRequest("POST", u, opt)
...@@ -535,9 +533,7 @@ func (s *UsersService) AddEmail(opt *AddEmailOptions) (*Email, *Response, error) ...@@ -535,9 +533,7 @@ func (s *UsersService) AddEmail(opt *AddEmailOptions) (*Email, *Response, error)
// admin. // admin.
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/users.html#add-email-for-user // GitLab API docs: https://docs.gitlab.com/ce/api/users.html#add-email-for-user
func (s *UsersService) AddEmailForUser( func (s *UsersService) AddEmailForUser(uid int, opt *AddEmailOptions) (*Email, *Response, error) {
uid int,
opt *AddEmailOptions) (*Email, *Response, error) {
u := fmt.Sprintf("users/%d/emails", uid) u := fmt.Sprintf("users/%d/emails", uid)
req, err := s.client.NewRequest("POST", u, opt) req, err := s.client.NewRequest("POST", u, opt)
......
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