aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-07-14 15:53:31 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-07-23 17:18:04 +0200
commit1c23c736e9b2ad85fb69330f62dd9da9ceeba823 (patch)
treed56171b38bb760d86ab3bc06799f78dbe1a09758
parent612264a00f352a12620bab3c72cd0b11b304f5e2 (diff)
downloadgit-bug-1c23c736e9b2ad85fb69330f62dd9da9ceeba823.tar.gz
vendor: update github.com/xanzy/go-gitlab to version 0.19.0
-rw-r--r--Gopkg.lock6
-rw-r--r--Gopkg.toml2
-rw-r--r--vendor/github.com/xanzy/go-gitlab/commits.go84
-rw-r--r--vendor/github.com/xanzy/go-gitlab/environments.go34
-rw-r--r--vendor/github.com/xanzy/go-gitlab/gitlab.go2
-rw-r--r--vendor/github.com/xanzy/go-gitlab/issues.go3
-rw-r--r--vendor/github.com/xanzy/go-gitlab/jobs.go45
-rw-r--r--vendor/github.com/xanzy/go-gitlab/merge_requests.go9
-rw-r--r--vendor/github.com/xanzy/go-gitlab/notes.go3
-rw-r--r--vendor/github.com/xanzy/go-gitlab/project_import_export.go6
-rw-r--r--vendor/github.com/xanzy/go-gitlab/project_variables.go3
-rw-r--r--vendor/github.com/xanzy/go-gitlab/projects.go4
-rw-r--r--vendor/github.com/xanzy/go-gitlab/resource_label_events.go219
-rw-r--r--vendor/github.com/xanzy/go-gitlab/settings.go4
-rw-r--r--vendor/github.com/xanzy/go-gitlab/todos.go1
15 files changed, 385 insertions, 40 deletions
diff --git a/Gopkg.lock b/Gopkg.lock
index b818baa7..1d80b862 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -345,12 +345,12 @@
version = "v1.0.0"
[[projects]]
- digest = "1:bdea1effaf77c89ea6a098c7343bea21963db1920f83271e98b2517d3e4ea05d"
+ digest = "1:33f31f1c13617634ff0da960c79293c604b6c22b32c9a95bcea5f6007666042d"
name = "github.com/xanzy/go-gitlab"
packages = ["."]
pruneopts = "UT"
- revision = "9d665abb0c204f579765d16d24d7ec85257e6624"
- version = "v0.18.0"
+ revision = "ee3313ca5478c4786248d63dd75e4cd8e1fad2db"
+ version = "v0.19.0"
[[projects]]
branch = "master"
diff --git a/Gopkg.toml b/Gopkg.toml
index cd6022db..b22319fb 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -74,4 +74,4 @@
[[constraint]]
name = "github.com/xanzy/go-gitlab"
- version = "0.18.0"
+ version = "0.19.0"
diff --git a/vendor/github.com/xanzy/go-gitlab/commits.go b/vendor/github.com/xanzy/go-gitlab/commits.go
index 7556394b..4bf067e8 100644
--- a/vendor/github.com/xanzy/go-gitlab/commits.go
+++ b/vendor/github.com/xanzy/go-gitlab/commits.go
@@ -145,7 +145,7 @@ type GetCommitRefsOptions struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/commits.html#get-references-a-commit-is-pushed-to
-func (s *CommitsService) GetCommitRefs(pid interface{}, sha string, opt *GetCommitRefsOptions, options ...OptionFunc) ([]CommitRef, *Response, error) {
+func (s *CommitsService) GetCommitRefs(pid interface{}, sha string, opt *GetCommitRefsOptions, options ...OptionFunc) ([]*CommitRef, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@@ -157,7 +157,7 @@ func (s *CommitsService) GetCommitRefs(pid interface{}, sha string, opt *GetComm
return nil, nil, err
}
- var cs []CommitRef
+ var cs []*CommitRef
resp, err := s.client.Do(req, &cs)
if err != nil {
return nil, resp, err
@@ -218,7 +218,7 @@ func (s *CommitsService) CreateCommit(pid interface{}, opt *CreateCommitOptions,
return nil, nil, err
}
- var c *Commit
+ c := new(Commit)
resp, err := s.client.Do(req, &c)
if err != nil {
return nil, resp, err
@@ -451,7 +451,7 @@ func (s *CommitsService) SetCommitStatus(pid interface{}, sha string, opt *SetCo
return nil, nil, err
}
- var cs *CommitStatus
+ cs := new(CommitStatus)
resp, err := s.client.Do(req, &cs)
if err != nil {
return nil, resp, err
@@ -485,14 +485,14 @@ func (s *CommitsService) GetMergeRequestsByCommit(pid interface{}, sha string, o
return mrs, resp, err
}
-// CherryPickCommitOptions represents the available options for cherry-picking a commit.
+// CherryPickCommitOptions represents the available CherryPickCommit() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#cherry-pick-a-commit
type CherryPickCommitOptions struct {
- TargetBranch *string `url:"branch" json:"branch,omitempty"`
+ Branch *string `url:"branch,omitempty" json:"branch,omitempty"`
}
-// CherryPickCommit sherry picks a commit to a given branch.
+// CherryPickCommit cherry picks a commit to a given branch.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#cherry-pick-a-commit
func (s *CommitsService) CherryPickCommit(pid interface{}, sha string, opt *CherryPickCommitOptions, options ...OptionFunc) (*Commit, *Response, error) {
@@ -507,7 +507,38 @@ func (s *CommitsService) CherryPickCommit(pid interface{}, sha string, opt *Cher
return nil, nil, err
}
- var c *Commit
+ c := new(Commit)
+ resp, err := s.client.Do(req, &c)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return c, resp, err
+}
+
+// RevertCommitOptions represents the available RevertCommit() options.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/commits.html#revert-a-commit
+type RevertCommitOptions struct {
+ Branch *string `url:"branch,omitempty" json:"branch,omitempty"`
+}
+
+// RevertCommit reverts a commit in a given branch.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/commits.html#revert-a-commit
+func (s *CommitsService) RevertCommit(pid interface{}, sha string, opt *RevertCommitOptions, options ...OptionFunc) (*Commit, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/repository/commits/%s/revert", pathEscape(project), sha)
+
+ req, err := s.client.NewRequest("POST", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ c := new(Commit)
resp, err := s.client.Do(req, &c)
if err != nil {
return nil, resp, err
@@ -515,3 +546,40 @@ func (s *CommitsService) CherryPickCommit(pid interface{}, sha string, opt *Cher
return c, resp, err
}
+
+// GPGSignature represents a Gitlab commit's GPG Signature.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/commits.html#get-gpg-signature-of-a-commit
+type GPGSignature struct {
+ KeyID int `json:"gpg_key_id"`
+ KeyPrimaryKeyID string `json:"gpg_key_primary_keyid"`
+ KeyUserName string `json:"gpg_key_user_name"`
+ KeyUserEmail string `json:"gpg_key_user_email"`
+ VerificationStatus string `json:"verification_status"`
+ KeySubkeyID int `json:"gpg_key_subkey_id"`
+}
+
+// GetGPGSiganature gets a GPG signature of a commit.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/commits.html#get-gpg-signature-of-a-commit
+func (s *CommitsService) GetGPGSiganature(pid interface{}, sha string, options ...OptionFunc) (*GPGSignature, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/repository/commits/%s/signature", pathEscape(project), sha)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ sig := new(GPGSignature)
+ resp, err := s.client.Do(req, &sig)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return sig, resp, err
+}
diff --git a/vendor/github.com/xanzy/go-gitlab/environments.go b/vendor/github.com/xanzy/go-gitlab/environments.go
index f7c81f09..ee773074 100644
--- a/vendor/github.com/xanzy/go-gitlab/environments.go
+++ b/vendor/github.com/xanzy/go-gitlab/environments.go
@@ -32,10 +32,11 @@ type EnvironmentsService struct {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/environments.html
type Environment struct {
- ID int `json:"id"`
- Name string `json:"name"`
- Slug string `json:"slug"`
- ExternalURL string `json:"external_url"`
+ ID int `json:"id"`
+ Name string `json:"name"`
+ Slug string `json:"slug"`
+ ExternalURL string `json:"external_url"`
+ LastDeployment *Deployment `json:"last_deployment"`
}
func (env Environment) String() string {
@@ -74,6 +75,31 @@ func (s *EnvironmentsService) ListEnvironments(pid interface{}, opts *ListEnviro
return envs, resp, err
}
+// GetEnvironment gets a specific environment from a project.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/environments.html#get-a-specific-environment
+func (s *EnvironmentsService) GetEnvironment(pid interface{}, environment int, options ...OptionFunc) (*Environment, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/environments/%d", pathEscape(project), environment)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ env := new(Environment)
+ resp, err := s.client.Do(req, env)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return env, resp, err
+}
+
// CreateEnvironmentOptions represents the available CreateEnvironment() options.
//
// GitLab API docs:
diff --git a/vendor/github.com/xanzy/go-gitlab/gitlab.go b/vendor/github.com/xanzy/go-gitlab/gitlab.go
index 8734af09..c8ac26f7 100644
--- a/vendor/github.com/xanzy/go-gitlab/gitlab.go
+++ b/vendor/github.com/xanzy/go-gitlab/gitlab.go
@@ -341,6 +341,7 @@ type Client struct {
Releases *ReleasesService
Repositories *RepositoriesService
RepositoryFiles *RepositoryFilesService
+ ResourceLabelEvents *ResourceLabelEventsService
Runners *RunnersService
Search *SearchService
Services *ServicesService
@@ -490,6 +491,7 @@ func newClient(httpClient *http.Client) *Client {
c.Releases = &ReleasesService{client: c}
c.Repositories = &RepositoriesService{client: c}
c.RepositoryFiles = &RepositoryFilesService{client: c}
+ c.ResourceLabelEvents = &ResourceLabelEventsService{client: c}
c.Runners = &RunnersService{client: c}
c.Search = &SearchService{client: c}
c.Services = &ServicesService{client: c}
diff --git a/vendor/github.com/xanzy/go-gitlab/issues.go b/vendor/github.com/xanzy/go-gitlab/issues.go
index 2f031a75..9a3c5b51 100644
--- a/vendor/github.com/xanzy/go-gitlab/issues.go
+++ b/vendor/github.com/xanzy/go-gitlab/issues.go
@@ -162,6 +162,7 @@ type ListGroupIssuesOptions struct {
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
+ In *string `url:"in,omitempty" json:"in,omitempty"`
CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
@@ -209,6 +210,7 @@ type ListProjectIssuesOptions struct {
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
+ In *string `url:"in,omitempty" json:"in,omitempty"`
CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
@@ -268,6 +270,7 @@ func (s *IssuesService) GetIssue(pid interface{}, issue int, options ...OptionFu
//
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#new-issues
type CreateIssueOptions struct {
+ IID *int `url:"iid,omitempty" json:"iid,omitempty"`
Title *string `url:"title,omitempty" json:"title,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"`
Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"`
diff --git a/vendor/github.com/xanzy/go-gitlab/jobs.go b/vendor/github.com/xanzy/go-gitlab/jobs.go
index daced463..f0c1e2c4 100644
--- a/vendor/github.com/xanzy/go-gitlab/jobs.go
+++ b/vendor/github.com/xanzy/go-gitlab/jobs.go
@@ -35,23 +35,33 @@ type JobsService struct {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/jobs.html
type Job struct {
- Commit *Commit `json:"commit"`
- CreatedAt *time.Time `json:"created_at"`
- Coverage float64 `json:"coverage"`
- ArtifactsFile struct {
- Filename string `json:"filename"`
- Size int `json:"size"`
- } `json:"artifacts_file"`
- FinishedAt *time.Time `json:"finished_at"`
- ID int `json:"id"`
- Name string `json:"name"`
- Pipeline struct {
+ Commit *Commit `json:"commit"`
+ Coverage float64 `json:"coverage"`
+ AllowFailure bool `json:"allow_failure"`
+ CreatedAt *time.Time `json:"created_at"`
+ StartedAt *time.Time `json:"started_at"`
+ FinishedAt *time.Time `json:"finished_at"`
+ Duration float64 `json:"duration"`
+ ArtifactsExpireAt *time.Time `json:"artifacts_expire_at"`
+ ID int `json:"id"`
+ Name string `json:"name"`
+ Pipeline struct {
ID int `json:"id"`
Ref string `json:"ref"`
Sha string `json:"sha"`
Status string `json:"status"`
} `json:"pipeline"`
- Ref string `json:"ref"`
+ Ref string `json:"ref"`
+ Artifacts []struct {
+ FileType string `json:"file_type"`
+ Filename string `json:"filename"`
+ Size int `json:"size"`
+ FileFormat string `json:"file_format"`
+ } `json:"artifacts"`
+ ArtifactsFile struct {
+ Filename string `json:"filename"`
+ Size int `json:"size"`
+ } `json:"artifacts_file"`
Runner struct {
ID int `json:"id"`
Description string `json:"description"`
@@ -59,12 +69,11 @@ type Job struct {
IsShared bool `json:"is_shared"`
Name string `json:"name"`
} `json:"runner"`
- Stage string `json:"stage"`
- StartedAt *time.Time `json:"started_at"`
- Status string `json:"status"`
- Tag bool `json:"tag"`
- User *User `json:"user"`
- WebURL string `json:"web_url"`
+ Stage string `json:"stage"`
+ Status string `json:"status"`
+ Tag bool `json:"tag"`
+ WebURL string `json:"web_url"`
+ User *User `json:"user"`
}
// ListJobsOptions are options for two list apis
diff --git a/vendor/github.com/xanzy/go-gitlab/merge_requests.go b/vendor/github.com/xanzy/go-gitlab/merge_requests.go
index c1f4268a..0626db1f 100644
--- a/vendor/github.com/xanzy/go-gitlab/merge_requests.go
+++ b/vendor/github.com/xanzy/go-gitlab/merge_requests.go
@@ -51,6 +51,8 @@ type MergeRequest struct {
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
} `json:"author"`
Assignee struct {
ID int `json:"id"`
@@ -58,6 +60,8 @@ type MergeRequest struct {
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
} `json:"assignee"`
SourceProjectID int `json:"source_project_id"`
TargetProjectID int `json:"target_project_id"`
@@ -67,12 +71,15 @@ type MergeRequest struct {
Milestone *Milestone `json:"milestone"`
MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
MergeStatus string `json:"merge_status"`
+ MergeError string `json:"merge_error"`
MergedBy struct {
ID int `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
} `json:"merged_by"`
MergedAt *time.Time `json:"merged_at"`
ClosedBy struct {
@@ -81,6 +88,8 @@ type MergeRequest struct {
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
} `json:"closed_by"`
ClosedAt *time.Time `json:"closed_at"`
Subscribed bool `json:"subscribed"`
diff --git a/vendor/github.com/xanzy/go-gitlab/notes.go b/vendor/github.com/xanzy/go-gitlab/notes.go
index 27264602..91ecf450 100644
--- a/vendor/github.com/xanzy/go-gitlab/notes.go
+++ b/vendor/github.com/xanzy/go-gitlab/notes.go
@@ -154,7 +154,8 @@ func (s *NotesService) GetIssueNote(pid interface{}, issue, note int, options ..
// GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#create-new-issue-note
type CreateIssueNoteOptions struct {
- Body *string `url:"body,omitempty" json:"body,omitempty"`
+ Body *string `url:"body,omitempty" json:"body,omitempty"`
+ CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
}
// CreateIssueNote creates a new note to a single project issue.
diff --git a/vendor/github.com/xanzy/go-gitlab/project_import_export.go b/vendor/github.com/xanzy/go-gitlab/project_import_export.go
index a71d620b..839b187b 100644
--- a/vendor/github.com/xanzy/go-gitlab/project_import_export.go
+++ b/vendor/github.com/xanzy/go-gitlab/project_import_export.go
@@ -151,12 +151,12 @@ type ImportFileOptions struct {
OverrideParams *CreateProjectOptions `url:"override_params,omitempty" json:"override_params,omitempty"`
}
-// ImportProject import the project.
+// ImportFile import a file.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/project_import_export.html#import-a-file
-func (s *ProjectImportExportService) ImportProject(opt *ImportFileOptions, options ...OptionFunc) (*ImportStatus, *Response, error) {
- req, err := s.client.NewRequest("POST", "/projects/import", opt, options)
+func (s *ProjectImportExportService) ImportFile(opt *ImportFileOptions, options ...OptionFunc) (*ImportStatus, *Response, error) {
+ req, err := s.client.NewRequest("POST", "projects/import", opt, options)
if err != nil {
return nil, nil, err
}
diff --git a/vendor/github.com/xanzy/go-gitlab/project_variables.go b/vendor/github.com/xanzy/go-gitlab/project_variables.go
index 9be68e66..7469d660 100644
--- a/vendor/github.com/xanzy/go-gitlab/project_variables.go
+++ b/vendor/github.com/xanzy/go-gitlab/project_variables.go
@@ -38,6 +38,7 @@ type ProjectVariable struct {
Key string `json:"key"`
Value string `json:"value"`
Protected bool `json:"protected"`
+ Masked bool `json:"masked"`
EnvironmentScope string `json:"environment_scope"`
}
@@ -104,6 +105,7 @@ type CreateVariableOptions struct {
Key *string `url:"key,omitempty" json:"key,omitempty"`
Value *string `url:"value,omitempty" json:"value,omitempty"`
Protected *bool `url:"protected,omitempty" json:"protected,omitempty"`
+ Masked *bool `url:"masked,omitempty" json:"masked,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
}
@@ -140,6 +142,7 @@ func (s *ProjectVariablesService) CreateVariable(pid interface{}, opt *CreateVar
type UpdateVariableOptions struct {
Value *string `url:"value,omitempty" json:"value,omitempty"`
Protected *bool `url:"protected,omitempty" json:"protected,omitempty"`
+ Masked *bool `url:"masked,omitempty" json:"masked,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
}
diff --git a/vendor/github.com/xanzy/go-gitlab/projects.go b/vendor/github.com/xanzy/go-gitlab/projects.go
index 8bd4f3fc..93855cf4 100644
--- a/vendor/github.com/xanzy/go-gitlab/projects.go
+++ b/vendor/github.com/xanzy/go-gitlab/projects.go
@@ -416,7 +416,7 @@ func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEvent
return p, resp, err
}
-// CreateProjectOptions represents the available CreateProjects() options.
+// CreateProjectOptions represents the available CreateProject() options.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#create-project
type CreateProjectOptions struct {
@@ -1243,6 +1243,7 @@ type ProjectApprovals struct {
ApprovalsBeforeMerge int `json:"approvals_before_merge"`
ResetApprovalsOnPush bool `json:"reset_approvals_on_push"`
DisableOverridingApproversPerMergeRequest bool `json:"disable_overriding_approvers_per_merge_request"`
+ MergeRequestsAuthorApproval bool `json:"merge_requests_author_approval"`
}
// GetApprovalConfiguration get the approval configuration for a project.
@@ -1279,6 +1280,7 @@ type ChangeApprovalConfigurationOptions struct {
ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"`
ResetApprovalsOnPush *bool `url:"reset_approvals_on_push,omitempty" json:"reset_approvals_on_push,omitempty"`
DisableOverridingApproversPerMergeRequest *bool `url:"disable_overriding_approvers_per_merge_request,omitempty" json:"disable_overriding_approvers_per_merge_request,omitempty"`
+ MergeRequestsAuthorApproval *bool `url:"merge_requests_author_approval,omitempty" json:"merge_requests_author_approval,omitempty"`
}
// ChangeApprovalConfiguration updates the approval configuration for a project.
diff --git a/vendor/github.com/xanzy/go-gitlab/resource_label_events.go b/vendor/github.com/xanzy/go-gitlab/resource_label_events.go
new file mode 100644
index 00000000..e9ff66a3
--- /dev/null
+++ b/vendor/github.com/xanzy/go-gitlab/resource_label_events.go
@@ -0,0 +1,219 @@
+//
+// Copyright 2017, Sander van Harmelen
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package gitlab
+
+import (
+ "fmt"
+ "time"
+)
+
+// ResourceLabelEventsService handles communication with the event related
+// methods of the GitLab API.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html
+type ResourceLabelEventsService struct {
+ client *Client
+}
+
+// LabelEvent represents a resource label event.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-issue-label-event
+type LabelEvent struct {
+ ID int `json:"id"`
+ Action string `json:"action"`
+ CreatedAt *time.Time `json:"created_at"`
+ ResourceType string `json:"resource_type"`
+ ResourceID int `json:"resource_id"`
+ User struct {
+ ID int `json:"id"`
+ Name string `json:"name"`
+ Username string `json:"username"`
+ State string `json:"state"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
+ } `json:"user"`
+ Label struct {
+ ID int `json:"id"`
+ Name string `json:"name"`
+ Color string `json:"color"`
+ TextColor string `json:"text_color"`
+ Description string `json:"description"`
+ } `json:"label"`
+}
+
+// ListLabelEventsOptions represents the options for all resource label events
+// list methods.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-issue-label-events
+type ListLabelEventsOptions struct {
+ ListOptions
+}
+
+// ListIssueLabelEvents retrieves resource label events for the
+// specified project and issue.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-issue-label-events
+func (s *ResourceLabelEventsService) ListIssueLabelEvents(pid interface{}, issue int, opt *ListLabelEventsOptions, options ...OptionFunc) ([]*LabelEvent, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/resource_label_events", pathEscape(project), issue)
+
+ req, err := s.client.NewRequest("GET", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var ls []*LabelEvent
+ resp, err := s.client.Do(req, &ls)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return ls, resp, err
+}
+
+// GetIssueLabelEvent gets a single issue-label-event.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-issue-label-event
+func (s *ResourceLabelEventsService) GetIssueLabelEvent(pid interface{}, issue int, event int, options ...OptionFunc) (*LabelEvent, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/resource_label_events/%d", pathEscape(project), issue, event)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ l := new(LabelEvent)
+ resp, err := s.client.Do(req, l)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return l, resp, err
+}
+
+// ListGroupEpicLabelEvents retrieves resource label events for the specified
+// group and epic.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#list-group-epic-label-events
+func (s *ResourceLabelEventsService) ListGroupEpicLabelEvents(gid interface{}, epic int, opt *ListLabelEventsOptions, options ...OptionFunc) ([]*LabelEvent, *Response, error) {
+ group, err := parseID(gid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("groups/%s/epics/%d/resource_label_events", pathEscape(group), epic)
+
+ req, err := s.client.NewRequest("GET", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var ls []*LabelEvent
+ resp, err := s.client.Do(req, &ls)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return ls, resp, err
+}
+
+// GetGroupEpicLabelEvent gets a single group epic label event.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-epic-label-event
+func (s *ResourceLabelEventsService) GetGroupEpicLabelEvent(gid interface{}, epic int, event int, options ...OptionFunc) (*LabelEvent, *Response, error) {
+ group, err := parseID(gid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("groups/%s/epics/%d/resource_label_events/%d", pathEscape(group), epic, event)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ l := new(LabelEvent)
+ resp, err := s.client.Do(req, l)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return l, resp, err
+}
+
+// ListMergeLabelEvents retrieves resource label events for the specified
+// project and merge request.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-merge-request-label-events
+func (s *ResourceLabelEventsService) ListMergeLabelEvents(pid interface{}, request int, opt *ListLabelEventsOptions, options ...OptionFunc) ([]*LabelEvent, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/merge_requests/%d/resource_label_events", pathEscape(project), request)
+
+ req, err := s.client.NewRequest("GET", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var ls []*LabelEvent
+ resp, err := s.client.Do(req, &ls)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return ls, resp, err
+}
+
+// GetMergeRequestLabelEvent gets a single merge request label event.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-merge-request-label-event
+func (s *ResourceLabelEventsService) GetMergeRequestLabelEvent(pid interface{}, request int, event int, options ...OptionFunc) (*LabelEvent, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/merge_requests/%d/resource_label_events/%d", pathEscape(project), request, event)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ l := new(LabelEvent)
+ resp, err := s.client.Do(req, l)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return l, resp, err
+}
diff --git a/vendor/github.com/xanzy/go-gitlab/settings.go b/vendor/github.com/xanzy/go-gitlab/settings.go
index fde9910f..2bbc0874 100644
--- a/vendor/github.com/xanzy/go-gitlab/settings.go
+++ b/vendor/github.com/xanzy/go-gitlab/settings.go
@@ -75,6 +75,7 @@ type Settings struct {
ImportSources []string `json:"import_sources"`
KodingEnabled bool `json:"koding_enabled"`
KodingURL string `json:"koding_url"`
+ LocalMarkdownVersion int `json:"local_markdown_version"`
MaxArtifactsSize int `json:"max_artifacts_size"`
MaxAttachmentSize int `json:"max_attachment_size"`
MaxPagesSize int `json:"max_pages_size"`
@@ -92,7 +93,7 @@ type Settings struct {
PerformanceBarEnabled bool `json:"performance_bar_enabled"`
PlantumlEnabled bool `json:"plantuml_enabled"`
PlantumlURL string `json:"plantuml_url"`
- PollingIntervalMultiplier float64 `json:"polling_interval_multiplier"`
+ PollingIntervalMultiplier float64 `json:"polling_interval_multiplier,string"`
ProjectExportEnabled bool `json:"project_export_enabled"`
PrometheusMetricsEnabled bool `json:"prometheus_metrics_enabled"`
RecaptchaEnabled bool `json:"recaptcha_enabled"`
@@ -195,6 +196,7 @@ type UpdateSettingsOptions struct {
ImportSources []string `url:"import_sources,omitempty" json:"import_sources,omitempty"`
KodingEnabled *bool `url:"koding_enabled,omitempty" json:"koding_enabled,omitempty"`
KodingURL *string `url:"koding_url,omitempty" json:"koding_url,omitempty"`
+ LocalMarkdownVersion *int `url:"local_markdown_version,omitempty" json:"local_markdown_version,omitempty"`
MaxArtifactsSize *int `url:"max_artifacts_size,omitempty" json:"max_artifacts_size,omitempty"`
MaxAttachmentSize *int `url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"`
MaxPagesSize *int `url:"max_pages_size,omitempty" json:"max_pages_size,omitempty"`
diff --git a/vendor/github.com/xanzy/go-gitlab/todos.go b/vendor/github.com/xanzy/go-gitlab/todos.go
index 812181d4..4c32d085 100644
--- a/vendor/github.com/xanzy/go-gitlab/todos.go
+++ b/vendor/github.com/xanzy/go-gitlab/todos.go
@@ -121,6 +121,7 @@ func (t Todo) String() string {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/todos.html#get-a-list-of-todos
type ListTodosOptions struct {
+ ListOptions
Action *TodoAction `url:"action,omitempty" json:"action,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
ProjectID *int `url:"project_id,omitempty" json:"project_id,omitempty"`