diff options
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/gitlab.go')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/gitlab.go | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/gitlab.go b/vendor/github.com/xanzy/go-gitlab/gitlab.go index 6019d87..2ff31be 100644 --- a/vendor/github.com/xanzy/go-gitlab/gitlab.go +++ b/vendor/github.com/xanzy/go-gitlab/gitlab.go @@ -186,19 +186,6 @@ var notificationLevelTypes = map[string]NotificationLevelValue{ "custom": CustomNotificationLevel, } -// OrderByValue represent in which order to sort the item -type OrderByValue string - -// These constants represent all valid order by values. -const ( - OrderByCreatedAt OrderByValue = "created_at" - OrderByID OrderByValue = "id" - OrderByIID OrderByValue = "iid" - OrderByRef OrderByValue = "ref" - OrderByStatus OrderByValue = "status" - OrderByUserID OrderByValue = "user_id" -) - // VisibilityValue represents a visibility level within GitLab. // // GitLab API docs: https://docs.gitlab.com/ce/api/ @@ -298,11 +285,14 @@ type Client struct { Features *FeaturesService GitIgnoreTemplates *GitIgnoreTemplatesService Groups *GroupsService + GroupIssueBoards *GroupIssueBoardsService GroupMembers *GroupMembersService GroupMilestones *GroupMilestonesService + GroupVariables *GroupVariablesService Issues *IssuesService IssueLinks *IssueLinksService Jobs *JobsService + Keys *KeysService Boards *IssueBoardsService Labels *LabelsService MergeRequests *MergeRequestsService @@ -318,6 +308,7 @@ type Client struct { Projects *ProjectsService ProjectMembers *ProjectMembersService ProjectSnippets *ProjectSnippetsService + ProjectVariables *ProjectVariablesService ProtectedBranches *ProtectedBranchesService Repositories *RepositoriesService RepositoryFiles *RepositoryFilesService @@ -428,11 +419,14 @@ func newClient(httpClient *http.Client) *Client { c.Features = &FeaturesService{client: c} c.GitIgnoreTemplates = &GitIgnoreTemplatesService{client: c} c.Groups = &GroupsService{client: c} + c.GroupIssueBoards = &GroupIssueBoardsService{client: c} c.GroupMembers = &GroupMembersService{client: c} c.GroupMilestones = &GroupMilestonesService{client: c} + c.GroupVariables = &GroupVariablesService{client: c} c.Issues = &IssuesService{client: c, timeStats: timeStats} c.IssueLinks = &IssueLinksService{client: c} c.Jobs = &JobsService{client: c} + c.Keys = &KeysService{client: c} c.Boards = &IssueBoardsService{client: c} c.Labels = &LabelsService{client: c} c.MergeRequests = &MergeRequestsService{client: c, timeStats: timeStats} @@ -448,6 +442,7 @@ func newClient(httpClient *http.Client) *Client { c.Projects = &ProjectsService{client: c} c.ProjectMembers = &ProjectMembersService{client: c} c.ProjectSnippets = &ProjectSnippetsService{client: c} + c.ProjectVariables = &ProjectVariablesService{client: c} c.ProtectedBranches = &ProtectedBranchesService{client: c} c.Repositories = &RepositoriesService{client: c} c.RepositoryFiles = &RepositoryFilesService{client: c} @@ -832,14 +827,6 @@ func NotificationLevel(v NotificationLevelValue) *NotificationLevelValue { return p } -// OrderBy is a helper routine that allocates a new OrderByValue -// to store v and returns a pointer to it. -func OrderBy(v OrderByValue) *OrderByValue { - p := new(OrderByValue) - *p = v - return p -} - // Visibility is a helper routine that allocates a new VisibilityValue // to store v and returns a pointer to it. func Visibility(v VisibilityValue) *VisibilityValue { @@ -855,3 +842,24 @@ func MergeMethod(v MergeMethodValue) *MergeMethodValue { *p = v return p } + +// BoolValue is a boolean value with advanced json unmarshaling features. +type BoolValue bool + +// UnmarshalJSON allows 1 and 0 to be considered as boolean values +// Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/50122 +func (t *BoolValue) UnmarshalJSON(b []byte) error { + switch string(b) { + case `"1"`: + *t = true + return nil + case `"0"`: + *t = false + return nil + default: + var v bool + err := json.Unmarshal(b, &v) + *t = BoolValue(v) + return err + } +} |