diff options
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/projects.go')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/projects.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/projects.go b/vendor/github.com/xanzy/go-gitlab/projects.go index 93855cf4..b6c513fa 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 +} |