From f6280a22c76ee42545efc31a6e3a35ff65954f3b Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Sat, 17 Aug 2019 00:28:45 +0200 Subject: [PATCH] vendor: upgrade github/xanzy/go-gitlab version to 0.20.0 --- vendor/github.com/xanzy/go-gitlab/.travis.yml | 1 - vendor/github.com/xanzy/go-gitlab/README.md | 8 +- .../xanzy/go-gitlab/build_variables.go | 172 ------------------ vendor/github.com/xanzy/go-gitlab/commits.go | 23 +-- vendor/github.com/xanzy/go-gitlab/gitlab.go | 17 +- .../xanzy/go-gitlab/group_variables.go | 34 +++- vendor/github.com/xanzy/go-gitlab/issues.go | 66 +++---- .../xanzy/go-gitlab/project_variables.go | 49 ++--- vendor/github.com/xanzy/go-gitlab/projects.go | 24 +++ .../xanzy/go-gitlab/protected_branches.go | 5 +- .../xanzy/go-gitlab/repositories.go | 5 +- vendor/github.com/xanzy/go-gitlab/runners.go | 1 + 12 files changed, 151 insertions(+), 254 deletions(-) delete mode 100644 vendor/github.com/xanzy/go-gitlab/build_variables.go diff --git a/vendor/github.com/xanzy/go-gitlab/.travis.yml b/vendor/github.com/xanzy/go-gitlab/.travis.yml index 556aec780a564b5e2ef5d7a173d4295d386a8ac4..0c9e885780056a6564cafa74f41e5c3790d12d1e 100644 --- a/vendor/github.com/xanzy/go-gitlab/.travis.yml +++ b/vendor/github.com/xanzy/go-gitlab/.travis.yml @@ -1,7 +1,6 @@ language: go go: - - 1.9.x - 1.10.x - 1.11.x - 1.12.x diff --git a/vendor/github.com/xanzy/go-gitlab/README.md b/vendor/github.com/xanzy/go-gitlab/README.md index 976673866dc6fd28471157adb4c54c25db8c5ca5..5f6321f5098e6d894f03a20b5c663dccd13dc86f 100644 --- a/vendor/github.com/xanzy/go-gitlab/README.md +++ b/vendor/github.com/xanzy/go-gitlab/README.md @@ -20,10 +20,6 @@ incompatible changes that were needed to fully support the V4 Gitlab API. This API client package covers most of the existing Gitlab API calls and is updated regularly to add new and/or missing endpoints. Currently the following services are supported: -- [ ] Discussions (threaded comments) -- [ ] Epic Issues -- [ ] Epics -- [ ] Geo Nodes - [x] Award Emojis - [x] Branches - [x] Broadcast Messages @@ -32,9 +28,13 @@ to add new and/or missing endpoints. Currently the following services are suppor - [x] Custom Attributes - [x] Deploy Keys - [x] Deployments +- [ ] Discussions (threaded comments) - [x] Environments +- [ ] Epic Issues +- [ ] Epics - [x] Events - [x] Feature Flags +- [ ] Geo Nodes - [x] GitLab CI Config Templates - [x] Gitignores Templates - [x] Group Access Requests diff --git a/vendor/github.com/xanzy/go-gitlab/build_variables.go b/vendor/github.com/xanzy/go-gitlab/build_variables.go deleted file mode 100644 index a34bc40ca618cae9000d854f866af91379b40d4c..0000000000000000000000000000000000000000 --- a/vendor/github.com/xanzy/go-gitlab/build_variables.go +++ /dev/null @@ -1,172 +0,0 @@ -package gitlab - -import ( - "fmt" -) - -// BuildVariablesService handles communication with the project variables related methods -// of the Gitlab API -// -// Gitlab API Docs : https://docs.gitlab.com/ce/api/build_variables.html -type BuildVariablesService struct { - client *Client -} - -// BuildVariable represents a variable available for each build of the given project -// -// Gitlab API Docs : https://docs.gitlab.com/ce/api/build_variables.html -type BuildVariable struct { - Key string `json:"key"` - Value string `json:"value"` - Protected bool `json:"protected"` -} - -func (v BuildVariable) String() string { - return Stringify(v) -} - -// ListBuildVariablesOptions are the parameters to ListBuildVariables() -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#list-project-variables -type ListBuildVariablesOptions ListOptions - -// ListBuildVariables gets the a list of project variables in a project -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#list-project-variables -func (s *BuildVariablesService) ListBuildVariables(pid interface{}, opts *ListBuildVariablesOptions, options ...OptionFunc) ([]*BuildVariable, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/variables", pathEscape(project)) - - req, err := s.client.NewRequest("GET", u, opts, options) - if err != nil { - return nil, nil, err - } - - var v []*BuildVariable - resp, err := s.client.Do(req, &v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetBuildVariable gets a single project variable of a project -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#show-variable-details -func (s *BuildVariablesService) GetBuildVariable(pid interface{}, key string, options ...OptionFunc) (*BuildVariable, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/variables/%s", pathEscape(project), key) - - req, err := s.client.NewRequest("GET", u, nil, options) - if err != nil { - return nil, nil, err - } - - v := new(BuildVariable) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateBuildVariableOptions are the parameters to CreateBuildVariable() -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#create-variable -type CreateBuildVariableOptions struct { - Key *string `url:"key" json:"key"` - Value *string `url:"value" json:"value"` - Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` -} - -// CreateBuildVariable creates a variable for a given project -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#create-variable -func (s *BuildVariablesService) CreateBuildVariable(pid interface{}, opt *CreateBuildVariableOptions, options ...OptionFunc) (*BuildVariable, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/variables", pathEscape(project)) - - req, err := s.client.NewRequest("POST", u, opt, options) - if err != nil { - return nil, nil, err - } - - v := new(BuildVariable) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// UpdateBuildVariableOptions are the parameters to UpdateBuildVariable() -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#update-variable -type UpdateBuildVariableOptions struct { - Key *string `url:"key" json:"key"` - Value *string `url:"value" json:"value"` - Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` -} - -// UpdateBuildVariable updates an existing project variable -// The variable key must exist -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#update-variable -func (s *BuildVariablesService) UpdateBuildVariable(pid interface{}, key string, opt *UpdateBuildVariableOptions, options ...OptionFunc) (*BuildVariable, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/variables/%s", pathEscape(project), key) - - req, err := s.client.NewRequest("PUT", u, opt, options) - if err != nil { - return nil, nil, err - } - - v := new(BuildVariable) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// RemoveBuildVariable removes a project variable of a given project identified by its key -// -// Gitlab API Docs: -// https://docs.gitlab.com/ce/api/build_variables.html#remove-variable -func (s *BuildVariablesService) RemoveBuildVariable(pid interface{}, key string, options ...OptionFunc) (*Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("projects/%s/variables/%s", pathEscape(project), key) - - req, err := s.client.NewRequest("DELETE", u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} diff --git a/vendor/github.com/xanzy/go-gitlab/commits.go b/vendor/github.com/xanzy/go-gitlab/commits.go index 4bf067e82a8bfc1e4e644cfcfa6bd889809f1734..cb03c3a09b417468b3e76ff7a33177f9a17f1488 100644 --- a/vendor/github.com/xanzy/go-gitlab/commits.go +++ b/vendor/github.com/xanzy/go-gitlab/commits.go @@ -18,6 +18,7 @@ package gitlab import ( "fmt" + "net/url" "time" ) @@ -150,7 +151,7 @@ func (s *CommitsService) GetCommitRefs(pid interface{}, sha string, opt *GetComm if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/refs", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/refs", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -175,7 +176,7 @@ func (s *CommitsService) GetCommit(pid interface{}, sha string, options ...Optio if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { @@ -260,7 +261,7 @@ func (s *CommitsService) GetCommitDiff(pid interface{}, sha string, opt *GetComm if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/diff", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/diff", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -317,7 +318,7 @@ func (s *CommitsService) GetCommitComments(pid interface{}, sha string, opt *Get if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -356,7 +357,7 @@ func (s *CommitsService) PostCommitComment(pid interface{}, sha string, opt *Pos if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -408,7 +409,7 @@ func (s *CommitsService) GetCommitStatuses(pid interface{}, sha string, opt *Get if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/statuses", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/statuses", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -444,7 +445,7 @@ func (s *CommitsService) SetCommitStatus(pid interface{}, sha string, opt *SetCo if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/statuses/%s", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/statuses/%s", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -469,7 +470,7 @@ func (s *CommitsService) GetMergeRequestsByCommit(pid interface{}, sha string, o if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/merge_requests", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/merge_requests", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { @@ -500,7 +501,7 @@ func (s *CommitsService) CherryPickCommit(pid interface{}, sha string, opt *Cher if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/cherry_pick", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/cherry_pick", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -531,7 +532,7 @@ func (s *CommitsService) RevertCommit(pid interface{}, sha string, opt *RevertCo if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/revert", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/revert", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -568,7 +569,7 @@ func (s *CommitsService) GetGPGSiganature(pid interface{}, sha string, options . if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/signature", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/signature", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { diff --git a/vendor/github.com/xanzy/go-gitlab/gitlab.go b/vendor/github.com/xanzy/go-gitlab/gitlab.go index c8ac26f7a78afa54e7fdc6db133090089589a3a1..dd015b4a98a1306f216394eb5e0949ec7d0a4d8f 100644 --- a/vendor/github.com/xanzy/go-gitlab/gitlab.go +++ b/vendor/github.com/xanzy/go-gitlab/gitlab.go @@ -204,7 +204,7 @@ var notificationLevelTypes = map[string]NotificationLevelValue{ // GitLab API docs: https://docs.gitlab.com/ce/api/ type VisibilityValue string -// List of available visibility levels +// List of available visibility levels. // // GitLab API docs: https://docs.gitlab.com/ce/api/ const ( @@ -213,6 +213,19 @@ const ( PublicVisibility VisibilityValue = "public" ) +// VariableTypeValue represents a variable type within GitLab. +// +// GitLab API docs: https://docs.gitlab.com/ce/api/ +type VariableTypeValue string + +// List of available variable types. +// +// GitLab API docs: https://docs.gitlab.com/ce/api/ +const ( + EnvVariableType VariableTypeValue = "env_var" + FileVariableType VariableTypeValue = "file" +) + // MergeMethodValue represents a project merge type within GitLab. // // GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#project-merge-method @@ -291,7 +304,6 @@ type Client struct { Boards *IssueBoardsService Branches *BranchesService BroadcastMessage *BroadcastMessagesService - BuildVariables *BuildVariablesService CIYMLTemplate *CIYMLTemplatesService Commits *CommitsService ContainerRegistry *ContainerRegistryService @@ -441,7 +453,6 @@ func newClient(httpClient *http.Client) *Client { c.Boards = &IssueBoardsService{client: c} c.Branches = &BranchesService{client: c} c.BroadcastMessage = &BroadcastMessagesService{client: c} - c.BuildVariables = &BuildVariablesService{client: c} c.CIYMLTemplate = &CIYMLTemplatesService{client: c} c.Commits = &CommitsService{client: c} c.ContainerRegistry = &ContainerRegistryService{client: c} diff --git a/vendor/github.com/xanzy/go-gitlab/group_variables.go b/vendor/github.com/xanzy/go-gitlab/group_variables.go index c91629aebd23e35416a082a277d18718638fe064..942618b2516d49f054b12d32442af5927d5d92f6 100644 --- a/vendor/github.com/xanzy/go-gitlab/group_variables.go +++ b/vendor/github.com/xanzy/go-gitlab/group_variables.go @@ -35,9 +35,10 @@ type GroupVariablesService struct { // GitLab API docs: // https://docs.gitlab.com/ee/api/group_level_variables.html type GroupVariable struct { - Key string `json:"key"` - Value string `json:"value"` - Protected bool `json:"protected"` + Key string `json:"key"` + Value string `json:"value"` + VariableType VariableTypeValue `json:"variable_type"` + Protected bool `json:"protected"` } func (v GroupVariable) String() string { @@ -94,11 +95,23 @@ func (s *GroupVariablesService) GetVariable(gid interface{}, key string, options return v, resp, err } +// CreateGroupVariableOptions represents the available CreateVariable() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/group_level_variables.html#create-variable +type CreateGroupVariableOptions struct { + Key *string `url:"key,omitempty" json:"key,omitempty"` + Value *string `url:"value,omitempty" json:"value,omitempty"` + VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` + Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` +} + // CreateVariable creates a new group variable. // // GitLab API docs: // https://docs.gitlab.com/ee/api/group_level_variables.html#create-variable -func (s *GroupVariablesService) CreateVariable(gid interface{}, opt *CreateVariableOptions, options ...OptionFunc) (*GroupVariable, *Response, error) { +func (s *GroupVariablesService) CreateVariable(gid interface{}, opt *CreateGroupVariableOptions, options ...OptionFunc) (*GroupVariable, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -119,12 +132,23 @@ func (s *GroupVariablesService) CreateVariable(gid interface{}, opt *CreateVaria return v, resp, err } +// UpdateGroupVariableOptions represents the available UpdateVariable() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/group_level_variables.html#update-variable +type UpdateGroupVariableOptions struct { + Value *string `url:"value,omitempty" json:"value,omitempty"` + VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` + Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` +} + // UpdateVariable updates the position of an existing // group issue board list. // // GitLab API docs: // https://docs.gitlab.com/ee/api/group_level_variables.html#update-variable -func (s *GroupVariablesService) UpdateVariable(gid interface{}, key string, opt *UpdateVariableOptions, options ...OptionFunc) (*GroupVariable, *Response, error) { +func (s *GroupVariablesService) UpdateVariable(gid interface{}, key string, opt *UpdateGroupVariableOptions, options ...OptionFunc) (*GroupVariable, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err diff --git a/vendor/github.com/xanzy/go-gitlab/issues.go b/vendor/github.com/xanzy/go-gitlab/issues.go index 9a3c5b515f5ba1ea4eec8748ff6c6a572cf0cfdd..ed9c2bf08228d8b39bd4f04bff55fc6ff81879d9 100644 --- a/vendor/github.com/xanzy/go-gitlab/issues.go +++ b/vendor/github.com/xanzy/go-gitlab/issues.go @@ -110,21 +110,23 @@ func (l *Labels) MarshalJSON() ([]byte, error) { // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-issues type ListIssuesOptions struct { ListOptions - State *string `url:"state,omitempty" json:"state,omitempty"` - Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"` - Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` - Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` - IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"` - 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"` - 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"` - UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` + State *string `url:"state,omitempty" json:"state,omitempty"` + Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"` + WithLabelDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"` + Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` + Scope *string `url:"scope,omitempty" json:"scope,omitempty"` + AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` + IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"` + 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"` + 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"` + UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` + Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` } // ListIssues gets all issues created by authenticated user. This function @@ -199,22 +201,24 @@ func (s *IssuesService) ListGroupIssues(pid interface{}, opt *ListGroupIssuesOpt // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-project-issues type ListProjectIssuesOptions struct { ListOptions - IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"` - State *string `url:"state,omitempty" json:"state,omitempty"` - Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"` - Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` - Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` - 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"` - UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` + IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"` + State *string `url:"state,omitempty" json:"state,omitempty"` + Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"` + WithLabelDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"` + Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` + Scope *string `url:"scope,omitempty" json:"scope,omitempty"` + AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` + 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"` + UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` + Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` } // ListProjectIssues gets a list of project issues. This function accepts diff --git a/vendor/github.com/xanzy/go-gitlab/project_variables.go b/vendor/github.com/xanzy/go-gitlab/project_variables.go index 7469d660dfa228f9e7dac14fd0382dc00463f015..2068f9ebb7c81689ab35e26dce58d380eb4b505f 100644 --- a/vendor/github.com/xanzy/go-gitlab/project_variables.go +++ b/vendor/github.com/xanzy/go-gitlab/project_variables.go @@ -35,11 +35,12 @@ type ProjectVariablesService struct { // GitLab API docs: // https://docs.gitlab.com/ee/api/project_level_variables.html type ProjectVariable struct { - Key string `json:"key"` - Value string `json:"value"` - Protected bool `json:"protected"` - Masked bool `json:"masked"` - EnvironmentScope string `json:"environment_scope"` + Key string `json:"key"` + Value string `json:"value"` + VariableType VariableTypeValue `json:"variable_type"` + Protected bool `json:"protected"` + Masked bool `json:"masked"` + EnvironmentScope string `json:"environment_scope"` } func (v ProjectVariable) String() string { @@ -96,24 +97,25 @@ func (s *ProjectVariablesService) GetVariable(pid interface{}, key string, optio return v, resp, err } -// CreateVariableOptions represents the available -// CreateVariable() options. +// CreateProjectVariableOptions represents the available CreateVariable() +// options. // // GitLab API docs: // https://docs.gitlab.com/ee/api/project_level_variables.html#create-variable -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"` +type CreateProjectVariableOptions struct { + Key *string `url:"key,omitempty" json:"key,omitempty"` + Value *string `url:"value,omitempty" json:"value,omitempty"` + VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,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"` } // CreateVariable creates a new project variable. // // GitLab API docs: // https://docs.gitlab.com/ee/api/project_level_variables.html#create-variable -func (s *ProjectVariablesService) CreateVariable(pid interface{}, opt *CreateVariableOptions, options ...OptionFunc) (*ProjectVariable, *Response, error) { +func (s *ProjectVariablesService) CreateVariable(pid interface{}, opt *CreateProjectVariableOptions, options ...OptionFunc) (*ProjectVariable, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -134,23 +136,24 @@ func (s *ProjectVariablesService) CreateVariable(pid interface{}, opt *CreateVar return v, resp, err } -// UpdateVariableOptions represents the available -// UpdateVariable() options. +// UpdateProjectVariableOptions represents the available UpdateVariable() +// options. // // GitLab API docs: // https://docs.gitlab.com/ee/api/project_level_variables.html#update-variable -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"` +type UpdateProjectVariableOptions struct { + Value *string `url:"value,omitempty" json:"value,omitempty"` + VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,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"` } -// UpdateVariable updates a project's variable +// UpdateVariable updates a project's variable. // // GitLab API docs: // https://docs.gitlab.com/ee/api/project_level_variables.html#update-variable -func (s *ProjectVariablesService) UpdateVariable(pid interface{}, key string, opt *UpdateVariableOptions, options ...OptionFunc) (*ProjectVariable, *Response, error) { +func (s *ProjectVariablesService) UpdateVariable(pid interface{}, key string, opt *UpdateProjectVariableOptions, options ...OptionFunc) (*ProjectVariable, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/github.com/xanzy/go-gitlab/projects.go b/vendor/github.com/xanzy/go-gitlab/projects.go index 93855cf4e334123a3e08553186c0b47106101f13..b6c513fac0e4a58462ed690c3ff3102c336dc9c2 100644 --- a/vendor/github.com/xanzy/go-gitlab/projects.go +++ b/vendor/github.com/xanzy/go-gitlab/projects.go @@ -1342,3 +1342,27 @@ func (s *ProjectsService) ChangeAllowedApprovers(pid interface{}, opt *ChangeAll return pa, resp, err } + +// StartMirroringProject start the pull mirroring process for a project. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/projects.html#start-the-pull-mirroring-process-for-a-project-starter +func (s *ProjectsService) StartMirroringProject(pid interface{}, options ...OptionFunc) (*Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, err + } + u := fmt.Sprintf("projects/%s/mirror/pull", pathEscape(project)) + + req, err := s.client.NewRequest("POST", u, nil, options) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req, nil) + if err != nil { + return resp, err + } + + return resp, err +} diff --git a/vendor/github.com/xanzy/go-gitlab/protected_branches.go b/vendor/github.com/xanzy/go-gitlab/protected_branches.go index 4950ecc2c28f41c8e2c0e6cf1ccd1f07c3536da1..3567f6ebd6320b565af8deb76796ddd853438de3 100644 --- a/vendor/github.com/xanzy/go-gitlab/protected_branches.go +++ b/vendor/github.com/xanzy/go-gitlab/protected_branches.go @@ -18,6 +18,7 @@ package gitlab import ( "fmt" + "net/url" ) // ProtectedBranchesService handles communication with the protected branch @@ -90,7 +91,7 @@ func (s *ProtectedBranchesService) GetProtectedBranch(pid interface{}, branch st if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), branch) + u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { @@ -153,7 +154,7 @@ func (s *ProtectedBranchesService) UnprotectRepositoryBranches(pid interface{}, if err != nil { return nil, err } - u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), branch) + u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil, options) if err != nil { diff --git a/vendor/github.com/xanzy/go-gitlab/repositories.go b/vendor/github.com/xanzy/go-gitlab/repositories.go index 75f1b854a7b5142fe91baaa3cda3c99298753a08..96766aea77f9d452c335bc4d8b337e68fff0ad0f 100644 --- a/vendor/github.com/xanzy/go-gitlab/repositories.go +++ b/vendor/github.com/xanzy/go-gitlab/repositories.go @@ -20,6 +20,7 @@ import ( "bytes" "fmt" "io" + "net/url" ) // RepositoriesService handles communication with the repositories related @@ -91,7 +92,7 @@ func (s *RepositoriesService) Blob(pid interface{}, sha string, options ...Optio if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/blobs/%s", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/blobs/%s", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { @@ -116,7 +117,7 @@ func (s *RepositoriesService) RawBlobContent(pid interface{}, sha string, option if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/blobs/%s/raw", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/blobs/%s/raw", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { diff --git a/vendor/github.com/xanzy/go-gitlab/runners.go b/vendor/github.com/xanzy/go-gitlab/runners.go index 6b1b65842b8b4b7e20edc9b4d3d2e0802268a6c9..365b6124ae07fcd74ca313f29516831f2a3d49b3 100644 --- a/vendor/github.com/xanzy/go-gitlab/runners.go +++ b/vendor/github.com/xanzy/go-gitlab/runners.go @@ -52,6 +52,7 @@ type RunnerDetails struct { Architecture string `json:"architecture"` Description string `json:"description"` ID int `json:"id"` + IPAddress string `json:"ip_address"` IsShared bool `json:"is_shared"` ContactedAt *time.Time `json:"contacted_at"` Name string `json:"name"`