diff options
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/project_snippets.go')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/project_snippets.go | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/project_snippets.go b/vendor/github.com/xanzy/go-gitlab/project_snippets.go index 6716b5c..65dab67 100644 --- a/vendor/github.com/xanzy/go-gitlab/project_snippets.go +++ b/vendor/github.com/xanzy/go-gitlab/project_snippets.go @@ -65,16 +65,14 @@ type ListSnippetsOptions struct { // ListSnippets gets a list of project snippets. // // GitLab API docs: https://docs.gitlab.com/ce/api/project_snippets.html#list-snippets -func (s *ProjectSnippetsService) ListSnippets( - pid interface{}, - opt *ListSnippetsOptions) ([]*Snippet, *Response, error) { +func (s *ProjectSnippetsService) ListSnippets(pid interface{}, opt *ListSnippetsOptions, options ...OptionFunc) ([]*Snippet, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err } u := fmt.Sprintf("projects/%s/snippets", url.QueryEscape(project)) - req, err := s.client.NewRequest("GET", u, opt) + req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { return nil, nil, err } @@ -92,16 +90,14 @@ func (s *ProjectSnippetsService) ListSnippets( // // GitLab API docs: // https://docs.gitlab.com/ce/api/project_snippets.html#single-snippet -func (s *ProjectSnippetsService) GetSnippet( - pid interface{}, - snippet int) (*Snippet, *Response, error) { +func (s *ProjectSnippetsService) GetSnippet(pid interface{}, snippet int, options ...OptionFunc) (*Snippet, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err } u := fmt.Sprintf("projects/%s/snippets/%d", url.QueryEscape(project), snippet) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { return nil, nil, err } @@ -131,16 +127,14 @@ type CreateSnippetOptions struct { // // GitLab API docs: // https://docs.gitlab.com/ce/api/project_snippets.html#create-new-snippet -func (s *ProjectSnippetsService) CreateSnippet( - pid interface{}, - opt *CreateSnippetOptions) (*Snippet, *Response, error) { +func (s *ProjectSnippetsService) CreateSnippet(pid interface{}, opt *CreateSnippetOptions, options ...OptionFunc) (*Snippet, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err } u := fmt.Sprintf("projects/%s/snippets", url.QueryEscape(project)) - req, err := s.client.NewRequest("POST", u, opt) + req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { return nil, nil, err } @@ -170,17 +164,14 @@ type UpdateSnippetOptions struct { // // GitLab API docs: // https://docs.gitlab.com/ce/api/project_snippets.html#update-snippet -func (s *ProjectSnippetsService) UpdateSnippet( - pid interface{}, - snippet int, - opt *UpdateSnippetOptions) (*Snippet, *Response, error) { +func (s *ProjectSnippetsService) UpdateSnippet(pid interface{}, snippet int, opt *UpdateSnippetOptions, options ...OptionFunc) (*Snippet, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err } u := fmt.Sprintf("projects/%s/snippets/%d", url.QueryEscape(project), snippet) - req, err := s.client.NewRequest("PUT", u, opt) + req, err := s.client.NewRequest("PUT", u, opt, options) if err != nil { return nil, nil, err } @@ -200,14 +191,14 @@ func (s *ProjectSnippetsService) UpdateSnippet( // // GitLab API docs: // https://docs.gitlab.com/ce/api/project_snippets.html#delete-snippet -func (s *ProjectSnippetsService) DeleteSnippet(pid interface{}, snippet int) (*Response, error) { +func (s *ProjectSnippetsService) DeleteSnippet(pid interface{}, snippet int, options ...OptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err } u := fmt.Sprintf("projects/%s/snippets/%d", url.QueryEscape(project), snippet) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest("DELETE", u, nil, options) if err != nil { return nil, err } @@ -219,16 +210,14 @@ func (s *ProjectSnippetsService) DeleteSnippet(pid interface{}, snippet int) (*R // // GitLab API docs: // https://docs.gitlab.com/ce/api/project_snippets.html#snippet-content -func (s *ProjectSnippetsService) SnippetContent( - pid interface{}, - snippet int) ([]byte, *Response, error) { +func (s *ProjectSnippetsService) SnippetContent(pid interface{}, snippet int, options ...OptionFunc) ([]byte, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err } u := fmt.Sprintf("projects/%s/snippets/%d/raw", url.QueryEscape(project), snippet) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { return nil, nil, err } |