Commit 9ab25f93 authored by Gabor Pipicz's avatar Gabor Pipicz

Add json tags for fields of request option structs

parent 6df79e29
......@@ -154,8 +154,8 @@ func (s *BranchesService) UnprotectBranch(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/branches.html#create-repository-branch
type CreateBranchOptions struct {
BranchName string `url:"branch_name,omitempty"`
Ref string `url:"ref,omitempty"`
BranchName string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
Ref string `url:"ref,omitempty" json:"ref,omitempty"`
}
// CreateBranch creates branch from commit SHA or existing branch.
......
......@@ -55,7 +55,7 @@ func (c Commit) String() string {
// GitLab API docs: http://doc.gitlab.com/ce/api/commits.html#list-commits
type ListCommitsOptions struct {
ListOptions
RefName string `url:"ref_name,omitempty"`
RefName string `url:"ref_name,omitempty" json:"ref_name,omitempty"`
}
// ListCommits gets a list of repository commits in a project.
......@@ -212,10 +212,10 @@ func (s *CommitsService) GetCommitComments(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/commits.html#post-comment-to-commit
type PostCommitCommentOptions struct {
Note string `url:"note,omitempty"`
Path string `url:"path"`
Line int `url:"line"`
LineType string `url:"line_type"`
Note string `url:"note,omitempty" json:"note,omitempty"`
Path string `url:"path" json:"path"`
Line int `url:"line" json:"line"`
LineType string `url:"line_type" json:"line_type"`
}
// PostCommitComment adds a comment to a commit. Optionally you can post
......
......@@ -99,8 +99,8 @@ func (s *DeployKeysService) GetDeployKey(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/deploy_keys.html#add-deploy-key
type AddDeployKeyOptions struct {
Title string `url:"title,omitempty"`
Key string `url:"key,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Key string `url:"key,omitempty" json:"key,omitempty"`
}
// AddDeployKey creates a new deploy key for a project. If deploy key already
......
......@@ -45,7 +45,7 @@ type Group struct {
// GitLab API docs: http://doc.gitlab.com/ce/api/groups.html#list-project-groups
type ListGroupsOptions struct {
ListOptions
Search string `url:"search,omitempty"`
Search string `url:"search,omitempty" json:"search,omitempty"`
}
// ListGroups gets a list of groups. (As user: my groups, as admin: all groups)
......@@ -95,9 +95,9 @@ func (s *GroupsService) GetGroup(gid interface{}) (*Group, *Response, error) {
//
// GitLab API docs: http://doc.gitlab.com/ce/api/groups.html#new-group
type CreateGroupOptions struct {
Name string `url:"name,omitempty"`
Path string `url:"path,omitempty"`
Description string `url:"description,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
Path string `url:"path,omitempty" json:"path,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
}
// CreateGroup creates a new project group. Available only for users who can
......@@ -173,7 +173,7 @@ func (s *GroupsService) DeleteGroup(gid interface{}) (*Response, error) {
// GitLab API docs: http://doc.gitlab.com/ce/api/groups.html#search-for-group
func (s *GroupsService) SearchGroup(query string) ([]*Group, *Response, error) {
var q struct {
Search string `url:"search,omitempty"`
Search string `url:"search,omitempty" json:"search,omitempty"`
}
q.Search = query
......@@ -234,8 +234,8 @@ func (s *GroupsService) ListGroupMembers(gid interface{}) ([]*GroupMember, *Resp
//
// GitLab API docs: http://doc.gitlab.com/ce/api/groups.html#add-group-member
type AddGroupMemberOptions struct {
UserID int `url:"user_id,omitempty"`
AccessLevel AccessLevel `url:"access_level,omitempty"`
UserID int `url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel AccessLevel `url:"access_level,omitempty" json:"access_level,omitempty"`
}
// AddGroupMember adds a user to the list of group members.
......@@ -271,7 +271,7 @@ func (s *GroupsService) AddGroupMember(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/groups.html#edit-group-team-member
type UpdateGroupMemberOptions struct {
AccessLevel AccessLevel `url:"access_level,omitempty"`
AccessLevel AccessLevel `url:"access_level,omitempty" json:"access_level,omitempty"`
}
// UpdateGroupMember updates a group team member to a specified access level.
......
......@@ -81,10 +81,10 @@ func (i Issue) String() string {
// GitLab API docs: http://doc.gitlab.com/ce/api/issues.html#list-issues
type ListIssuesOptions struct {
ListOptions
State string `url:"state,omitempty"`
Labels []string `url:"labels,omitempty"`
OrderBy string `url:"order_by,omitempty"`
Sort string `url:"sort,omitempty"`
State string `url:"state,omitempty" json:"state,omitempty"`
Labels []string `url:"labels,omitempty" json:"labels,omitempty"`
OrderBy string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort string `url:"sort,omitempty" json:"sort,omitempty"`
}
// ListIssues gets all issues created by authenticated user. This function
......@@ -111,12 +111,12 @@ func (s *IssuesService) ListIssues(opt *ListIssuesOptions) ([]*Issue, *Response,
// GitLab API docs: http://doc.gitlab.com/ce/api/issues.html#list-issues
type ListProjectIssuesOptions struct {
ListOptions
IID int `url:"iid,omitempty"`
State string `url:"state,omitempty"`
Labels []string `url:"labels,omitempty"`
Milestone string `url:"milestone,omitempty"`
OrderBy string `url:"order_by,omitempty"`
Sort string `url:"sort,omitempty"`
IID int `url:"iid,omitempty" json:"iid,omitempty"`
State string `url:"state,omitempty" json:"state,omitempty"`
Labels []string `url:"labels,omitempty" json:"labels,omitempty"`
Milestone string `url:"milestone,omitempty" json:"milestone,omitempty"`
OrderBy string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort string `url:"sort,omitempty" json:"sort,omitempty"`
}
// ListProjectIssues gets a list of project issues. This function accepts
......@@ -174,11 +174,11 @@ func (s *IssuesService) GetIssue(pid interface{}, issue int) (*Issue, *Response,
//
// GitLab API docs: http://doc.gitlab.com/ce/api/issues.html#new-issues
type CreateIssueOptions struct {
Title string `url:"title,omitempty"`
Description string `url:"description,omitempty"`
AssigneeID int `url:"assignee_id,omitempty"`
MilestoneID int `url:"milestone_id,omitempty"`
Labels []string `url:"labels,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
AssigneeID int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MilestoneID int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
Labels []string `url:"labels,omitempty" json:"labels,omitempty"`
}
// CreateIssue creates a new project issue.
......@@ -216,12 +216,12 @@ func (s *IssuesService) CreateIssue(
//
// GitLab API docs: http://doc.gitlab.com/ce/api/issues.html#edit-issues
type UpdateIssueOptions struct {
Title string `url:"title,omitempty"`
Description string `url:"description,omitempty"`
AssigneeID int `url:"assignee_id,omitempty"`
MilestoneID int `url:"milestone_id,omitempty"`
Labels []string `url:"labels,omitempty"`
StateEvent string `url:"state_event,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
AssigneeID int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MilestoneID int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
Labels []string `url:"labels,omitempty" json:"labels,omitempty"`
StateEvent string `url:"state_event,omitempty" json:"state_event,omitempty"`
}
// UpdateIssue updates an existing project issue. This function is also used
......
......@@ -69,8 +69,8 @@ func (s *LabelsService) ListLabels(pid interface{}) ([]*Label, *Response, error)
//
// GitLab API docs: http://doc.gitlab.com/ce/api/labels.html#create-a-new-label
type CreateLabelOptions struct {
Name string `url:"name,omitempty"`
Color string `url:"color,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
Color string `url:"color,omitempty" json:"color,omitempty"`
}
// CreateLabel creates a new label for given repository with given name and
......@@ -104,7 +104,7 @@ func (s *LabelsService) CreateLabel(
//
// GitLab API docs: http://doc.gitlab.com/ce/api/labels.html#delete-a-label
type DeleteLabelOptions struct {
Name string `url:"name,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
}
// DeleteLabel deletes a label given by its name.
......@@ -134,9 +134,9 @@ func (s *LabelsService) DeleteLabel(pid interface{}, opt *DeleteLabelOptions) (*
//
// GitLab API docs: http://doc.gitlab.com/ce/api/labels.html#delete-a-label
type UpdateLabelOptions struct {
Name string `url:"name,omitempty"`
NewName string `url:"new_name,omitempty"`
Color string `url:"color,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
NewName string `url:"new_name,omitempty" json:"new_name,omitempty"`
Color string `url:"color,omitempty" json:"color,omitempty"`
}
// UpdateLabel updates an existing label with new name or now color. At least
......
......@@ -98,10 +98,10 @@ func (m MergeRequest) String() string {
// http://doc.gitlab.com/ce/api/merge_requests.html#list-merge-requests
type ListMergeRequestsOptions struct {
ListOptions
IID int `url:"iid,omitempty"`
State string `url:"state,omitempty"`
OrderBy string `url:"order_by,omitempty"`
Sort string `url:"sort,omitempty"`
IID int `url:"iid,omitempty" json:"iid,omitempty"`
State string `url:"state,omitempty" json:"state,omitempty"`
OrderBy string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort string `url:"sort,omitempty" json:"sort,omitempty"`
}
// ListMergeRequests gets all merge requests for this project. The state
......@@ -195,12 +195,12 @@ func (s *MergeRequestsService) GetMergeRequestChanges(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/merge_requests.html#create-mr
type CreateMergeRequestOptions struct {
Title string `url:"title,omitempty"`
Description string `url:"description,omitempty"`
SourceBranch string `url:"source_branch,omitemtpy"`
TargetBranch string `url:"target_branch,omitemtpy"`
AssigneeID int `url:"assignee_id,omitempty"`
TargetProjectID int `url:"target_project_id,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
SourceBranch string `url:"source_branch,omitemtpy" json:"source_branch,omitemtpy"`
TargetBranch string `url:"target_branch,omitemtpy" json:"target_branch,omitemtpy"`
AssigneeID int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
TargetProjectID int `url:"target_project_id,omitempty" json:"target_project_id,omitempty"`
}
// CreateMergeRequest creates a new merge request.
......@@ -236,11 +236,11 @@ func (s *MergeRequestsService) CreateMergeRequest(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/merge_requests.html#update-mr
type UpdateMergeRequestOptions struct {
Title string `url:"title,omitempty"`
Description string `url:"description,omitempty"`
TargetBranch string `url:"target_branch,omitemtpy"`
AssigneeID int `url:"assignee_id,omitempty"`
StateEvent string `url:"state_event,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
TargetBranch string `url:"target_branch,omitemtpy" json:"target_branch,omitemtpy"`
AssigneeID int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
StateEvent string `url:"state_event,omitempty" json:"state_event,omitempty"`
}
// UpdateMergeRequest updates an existing project milestone.
......@@ -364,7 +364,7 @@ func (s *MergeRequestsService) GetMergeRequestComments(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/commits.html#post-comment-to-mr
type PostMergeRequestCommentOptions struct {
Note string `url:"note,omitempty"`
Note string `url:"note,omitempty" json:"note,omitempty"`
}
// PostMergeRequestComment dds a comment to a merge request.
......
......@@ -55,7 +55,7 @@ func (m Milestone) String() string {
// http://doc.gitlab.com/ce/api/milestones.html#list-project-milestones
type ListMilestonesOptions struct {
ListOptions
IID int `url:"iid,omitempty"`
IID int `url:"iid,omitempty" json:"iid,omitempty"`
}
// ListMilestones returns a list of project milestones.
......@@ -117,9 +117,9 @@ func (s *MilestonesService) GetMilestone(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/milestones.html#create-new-milestone
type CreateMilestoneOptions struct {
Title string `url:"title,omitempty"`
Description string `url:"description,omitempty"`
DueDate string `url:"due_date,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
DueDate string `url:"due_date,omitempty" json:"due_date,omitempty"`
}
// CreateMilestone creates a new project milestone.
......@@ -154,10 +154,10 @@ func (s *MilestonesService) CreateMilestone(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/milestones.html#edit-milestone
type UpdateMilestoneOptions struct {
Title string `url:"title,omitempty"`
Description string `url:"description,omitempty"`
DueDate string `url:"due_date,omitempty"`
StateEvent string `url:"state_event,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
DueDate string `url:"due_date,omitempty" json:"due_date,omitempty"`
StateEvent string `url:"state_event,omitempty" json:"state_event,omitempty"`
}
// UpdateMilestone updates an existing project milestone.
......
......@@ -126,7 +126,7 @@ func (s *NotesService) GetIssueNote(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/notes.html#create-new-issue-note
type CreateIssueNoteOptions struct {
Body string `url:"body,omitempty"`
Body string `url:"body,omitempty" json:"body,omitempty"`
}
// CreateIssueNote creates a new note to a single project issue.
......@@ -163,7 +163,7 @@ func (s *NotesService) CreateIssueNote(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/notes.html#modify-existing-issue-note
type UpdateIssueNoteOptions struct {
Body string `url:"body,omitempty"`
Body string `url:"body,omitempty" json:"body,omitempty"`
}
// UpdateIssueNote modifies existing note of an issue.
......@@ -254,7 +254,7 @@ func (s *NotesService) GetSnippetNote(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/notes.html#create-new-snippet-note
type CreateSnippetNoteOptions struct {
Body string `url:"body,omitempty"`
Body string `url:"body,omitempty" json:"body,omitempty"`
}
// CreateSnippetNote creates a new note for a single snippet. Snippet notes are
......@@ -292,7 +292,7 @@ func (s *NotesService) CreateSnippetNote(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/notes.html#modify-existing-snippet-note
type UpdateSnippetNoteOptions struct {
Body string `url:"body,omitempty"`
Body string `url:"body,omitempty" json:"body,omitempty"`
}
// UpdateSnippetNote modifies existing note of a snippet.
......@@ -384,7 +384,7 @@ func (s *NotesService) GetMergeRequestNote(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/notes.html#create-new-merge-request-note
type CreateMergeRequestNoteOptions struct {
Body string `url:"body,omitempty"`
Body string `url:"body,omitempty" json:"body,omitempty"`
}
// CreateMergeRequestNote creates a new note for a single merge request.
......@@ -421,7 +421,7 @@ func (s *NotesService) CreateMergeRequestNote(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/notes.html#modify-existing-merge-request-note
type UpdateMergeRequestNoteOptions struct {
Body string `url:"body,omitempty"`
Body string `url:"body,omitempty" json:"body,omitempty"`
}
// UpdateMergeRequestNote modifies existing note of a merge request.
......
......@@ -120,10 +120,10 @@ func (s *ProjectSnippetsService) GetSnippet(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/project_snippets.html#create-new-snippet
type CreateSnippetOptions struct {
Title string `url:"title,omitempty"`
FileName string `url:"file_name,omitempty"`
Code string `url:"code,omitempty"`
VisibilityLevel VisibilityLevel `url:"visibility_level,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
FileName string `url:"file_name,omitempty" json:"file_name,omitempty"`
Code string `url:"code,omitempty" json:"code,omitempty"`
VisibilityLevel VisibilityLevel `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
}
// CreateSnippet creates a new project snippet. The user must have permission
......@@ -159,10 +159,10 @@ func (s *ProjectSnippetsService) CreateSnippet(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/project_snippets.html#update-snippet
type UpdateSnippetOptions struct {
Title string `url:"title,omitempty"`
FileName string `url:"file_name,omitempty"`
Code string `url:"code,omitempty"`
VisibilityLevel VisibilityLevel `url:"visibility_level,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
FileName string `url:"file_name,omitempty" json:"file_name,omitempty"`
Code string `url:"code,omitempty" json:"code,omitempty"`
VisibilityLevel VisibilityLevel `url:"visibility_level,omitempty" json:"visibility_level,omitempty"`
}
// UpdateSnippet updates an existing project snippet. The user must have
......
This diff is collapsed.
......@@ -75,9 +75,9 @@ func (s *RepositoriesService) ListTags(pid interface{}) ([]*Tag, *Response, erro
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repositories.html#create-a-new-tag
type CreateTagOptions struct {
TagName string `url:"tag_name,omitempty"`
Ref string `url:"ref,omitempty"`
Message string `url:"message,omitempty"`
TagName string `url:"tag_name,omitempty" json:"tag_name,omitempty"`
Ref string `url:"ref,omitempty" json:"ref,omitempty"`
Message string `url:"message,omitempty" json:"message,omitempty"`
}
// CreateTag creates a new tag in the repository that points to the supplied ref.
......@@ -127,8 +127,8 @@ func (t TreeNode) String() string {
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repositories.html#list-repository-tree
type ListTreeOptions struct {
Path string `url:"path,omitempty"`
RefName string `url:"ref_name,omitempty"`
Path string `url:"path,omitempty" json:"path,omitempty"`
RefName string `url:"ref_name,omitempty" json:"ref_name,omitempty"`
}
// ListTree gets a list of repository files and directories in a project.
......@@ -163,7 +163,7 @@ func (s *RepositoriesService) ListTree(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repositories.html#raw-file-content
type RawFileContentOptions struct {
FilePath string `url:"filepath,omitempty"`
FilePath string `url:"filepath,omitempty" json:"filepath,omitempty"`
}
// RawFileContent gets the raw file contents for a file by commit SHA and path
......@@ -226,7 +226,7 @@ func (s *RepositoriesService) RawBlobContent(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repositories.html#get-file-archive
type ArchiveOptions struct {
SHA string `url:"sha,omitempty"`
SHA string `url:"sha,omitempty" json:"sha,omitempty"`
}
// Archive gets an archive of the repository.
......@@ -277,8 +277,8 @@ func (c Compare) String() string {
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repositories.html#compare-branches-tags-or-commits
type CompareOptions struct {
From string `url:"from,omitempty"`
To string `url:"to,omitempty"`
From string `url:"from,omitempty" json:"from,omitempty"`
To string `url:"to,omitempty" json:"to,omitempty"`
}
// Compare compares branches, tags or commits.
......
......@@ -52,8 +52,8 @@ func (r File) String() string {
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repository_files.html#get-file-from-respository
type GetFileOptions struct {
FilePath string `url:"file_path,omitempty"`
Ref string `url:"ref,omitempty"`
FilePath string `url:"file_path,omitempty" json:"file_path,omitempty"`
Ref string `url:"ref,omitempty" json:"ref,omitempty"`
}
// GetFile allows you to receive information about a file in repository like
......@@ -101,11 +101,11 @@ func (r FileInfo) String() string {
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repository_files.html#create-new-file-in-repository
type CreateFileOptions struct {
FilePath string `url:"file_path,omitempty"`
BranchName string `url:"branch_name,omitempty"`
Encoding string `url:"encoding,omitempty"`
Content string `url:"content,omitempty"`
CommitMessage string `url:"commit_message,omitempty"`
FilePath string `url:"file_path,omitempty" json:"file_path,omitempty"`
BranchName string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
Encoding string `url:"encoding,omitempty" json:"encoding,omitempty"`
Content string `url:"content,omitempty" json:"content,omitempty"`
CommitMessage string `url:"commit_message,omitempty" json:"commit_message,omitempty"`
}
// CreateFile creates a new file in a repository.
......@@ -140,11 +140,11 @@ func (s *RepositoryFilesService) CreateFile(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repository_files.html#update-existing-file-in-repository
type UpdateFileOptions struct {
FilePath string `url:"file_path,omitempty"`
BranchName string `url:"branch_name,omitempty"`
Encoding string `url:"encoding,omitempty"`
Content string `url:"content,omitempty"`
CommitMessage string `url:"commit_message,omitempty"`
FilePath string `url:"file_path,omitempty" json:"file_path,omitempty"`
BranchName string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
Encoding string `url:"encoding,omitempty" json:"encoding,omitempty"`
Content string `url:"content,omitempty" json:"content,omitempty"`
CommitMessage string `url:"commit_message,omitempty" json:"commit_message,omitempty"`
}
// UpdateFile updates an existing file in a repository
......@@ -179,9 +179,9 @@ func (s *RepositoryFilesService) UpdateFile(
// GitLab API docs:
// http://doc.gitlab.com/ce/api/repository_files.html#delete-existing-file-in-repository
type DeleteFileOptions struct {
FilePath string `url:"file_path,omitempty"`
BranchName string `url:"branch_name,omitempty"`
CommitMessage string `url:"commit_message,omitempty"`
FilePath string `url:"file_path,omitempty" json:"file_path,omitempty"`
BranchName string `url:"branch_name,omitempty" json:"branch_name,omitempty"`
CommitMessage string `url:"commit_message,omitempty" json:"commit_message,omitempty"`
}
// DeleteFile deletes an existing file in a repository
......
......@@ -54,9 +54,9 @@ type Session struct {
//
// GitLab API docs: http://doc.gitlab.com/ce/api/session.html#session
type GetSessionOptions struct {
Login string `url:"login,omitempty"`
Email string `url:"email,omitempty"`
Password string `url:"password,omitempty"`
Login string `url:"login,omitempty" json:"login,omitempty"`
Email string `url:"email,omitempty" json:"email,omitempty"`
Password string `url:"password,omitempty" json:"password,omitempty"`
}
// GetSession logs in to get private token.
......
......@@ -66,7 +66,7 @@ func (s *SystemHooksService) ListHooks() ([]*Hook, *Response, error) {
// GitLab API docs:
// http://doc.gitlab.com/ce/api/system_hooks.html#add-new-system-hook-hook
type AddHookOptions struct {
URL string `url:"url,omitempty"`
URL string `url:"url,omitempty" json:"url,omitempty"`
}
// AddHook adds a new system hook hook.
......
......@@ -62,8 +62,8 @@ type User struct {
// GitLab API docs: http://doc.gitlab.com/ce/api/users.html#list-users
type ListUsersOptions struct {
ListOptions
Active bool `url:"active,omitempty"`
Search string `url:"search,omitempty"`
Active bool `url:"active,omitempty" json:"active,omitempty"`
Search string `url:"search,omitempty" json:"search,omitempty"`
}
// ListUsers gets a list of users.
......@@ -108,21 +108,21 @@ func (s *UsersService) GetUser(user int) (*User, *Response, error) {
//
// GitLab API docs: http://doc.gitlab.com/ce/api/users.html#user-creation
type CreateUserOptions struct {
Email string `url:"email,omitempty"`
Password string `url:"password,omitempty"`
Username string `url:"username,omitempty"`
Name string `url:"name,omitempty"`
Skype string `url:"skype,omitempty"`
Linkedin string `url:"linkedin,omitempty"`
Twitter string `url:"twitter,omitempty"`
WebsiteURL string `url:"website_url,omitempty"`
ProjectsLimit int `url:"projects_limit,omitempty"`
ExternUID string `url:"extern_uid,omitempty"`
Provider string `url:"provider,omitempty"`
Bio string `url:"bio,omitempty"`
Admin bool `url:"admin,omitempty"`
CanCreateGroup bool `url:"can_create_group,omitempty"`
Confirm bool `url:"confirm,omitempty"`
Email string `url:"email,omitempty" json:"email,omitempty"`
Password string `url:"password,omitempty" json:"password,omitempty"`
Username string `url:"username,omitempty" json:"username,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
Skype string `url:"skype,omitempty" json:"skype,omitempty"`
Linkedin string `url:"linkedin,omitempty" json:"linkedin,omitempty"`
Twitter string `url:"twitter,omitempty" json:"twitter,omitempty"`
WebsiteURL string `url:"website_url,omitempty" json:"website_url,omitempty"`
ProjectsLimit int `url:"projects_limit,omitempty" json:"projects_limit,omitempty"`
ExternUID string `url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
Provider string `url:"provider,omitempty" json:"provider,omitempty"`
Bio string `url:"bio,omitempty" json:"bio,omitempty"`
Admin bool `url:"admin,omitempty" json:"admin,omitempty"`
CanCreateGroup bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"`
Confirm bool `url:"confirm,omitempty" json:"confirm,omitempty"`
}
// CreateUser creates a new user. Note only administrators can create new users.
......@@ -147,25 +147,25 @@ func (s *UsersService) CreateUser(opt *CreateUserOptions) (*User, *Response, err
//
// GitLab API docs: http://doc.gitlab.com/ce/api/users.html#user-modification
type ModifyUserOptions struct {
Email string `url:"email,omitempty"`
Password string `url:"password,omitempty"`
Username string `url:"username,omitempty"`
Name string `url:"name,omitempty"`
Skype string `url:"skype,omitempty"`
Linkedin string `url:"linkedin,omitempty"`
Twitter string `url:"twitter,omitempty"`
WebsiteURL string `url:"website_url,omitempty"`
ProjectsLimit int `url:"projects_limit,omitempty"`
ExternUID string `url:"extern_uid,omitempty"`
Provider string `url:"provider,omitempty"`
Bio string `url:"bio,omitempty"`
Admin bool `url:"admin,omitempty"`
CanCreateGroup bool `url:"can_create_group,omitempty"`
Email string `url:"email,omitempty" json:"email,omitempty"`
Password string `url:"password,omitempty" json:"password,omitempty"`
Username string `url:"username,omitempty" json:"username,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
Skype string `url:"skype,omitempty" json:"skype,omitempty"`
Linkedin string `url:"linkedin,omitempty" json:"linkedin,omitempty"`
Twitter string `url:"twitter,omitempty" json:"twitter,omitempty"`
WebsiteURL string `url:"website_url,omitempty" json:"website_url,omitempty"`
ProjectsLimit int `url:"projects_limit,omitempty" json:"projects_limit,omitempty"`
ExternUID string `url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
Provider string `url:"provider,omitempty" json:"provider,omitempty"`
Bio string `url:"bio,omitempty" json:"bio,omitempty"`
Admin bool `url:"admin,omitempty" json:"admin,omitempty"`
CanCreateGroup bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"`
}
// ModifyUser modifies an existing user. Only administrators can change attributes
// of a user.
//
//gitla
// GitLab API docs: http://doc.gitlab.com/ce/api/users.html#user-modification
func (s *UsersService) ModifyUser(user int, opt *ModifyUserOptions) (*User, *Response, error) {
u := fmt.Sprintf("users/%d", user)
......@@ -299,8 +299,8 @@ func (s *UsersService) GetSSHKey(kid int) (*SSHKey, *Response, error) {
//
// GitLab API docs: http://doc.gitlab.com/ce/api/projects.html#add-ssh-key
type AddSSHKeyOptions struct {
Title string `url:"title,omitempty"`
Key string `url:"key,omitempty"`
Title string `url:"title,omitempty" json:"title,omitempty"`
Key string `url:"key,omitempty" json:"key,omitempty"`
}
// AddSSHKey creates a new key owned by the currently authenticated user.
......
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