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