// Copyright 2013 The go-github AUTHORS. All rights reserved.//// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package githubimport ()// ListAssignees fetches all available assignees (owners and collaborators) to// which issues may be assigned.//// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees////meta:operation GET /repos/{owner}/{repo}/assigneesfunc ( *IssuesService) ( context.Context, , string, *ListOptions) ([]*User, *Response, error) { := fmt.Sprintf("repos/%v/%v/assignees", , ) , := addOptions(, )if != nil {returnnil, nil, } , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, }var []*User , := .client.Do(, , &)if != nil {returnnil, , }return , , nil}// IsAssignee checks if a user is an assignee for the specified repository.//// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned////meta:operation GET /repos/{owner}/{repo}/assignees/{assignee}func ( *IssuesService) ( context.Context, , , string) (bool, *Response, error) { := fmt.Sprintf("repos/%v/%v/assignees/%v", , , ) , := .client.NewRequest("GET", , nil)if != nil {returnfalse, nil, } , := .client.Do(, , nil) , := parseBoolResponse()return , , }// AddAssignees adds the provided GitHub users as assignees to the issue.//// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue////meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/assigneesfunc ( *IssuesService) ( context.Context, , string, int, []string) (*Issue, *Response, error) { := &struct { []string`json:"assignees,omitempty"` }{: } := fmt.Sprintf("repos/%v/%v/issues/%v/assignees", , , ) , := .client.NewRequest("POST", , )if != nil {returnnil, nil, } := &Issue{} , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// RemoveAssignees removes the provided GitHub users as assignees from the issue.//// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue////meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/assigneesfunc ( *IssuesService) ( context.Context, , string, int, []string) (*Issue, *Response, error) { := &struct { []string`json:"assignees,omitempty"` }{: } := fmt.Sprintf("repos/%v/%v/issues/%v/assignees", , , ) , := .client.NewRequest("DELETE", , )if != nil {returnnil, nil, } := &Issue{} , := .client.Do(, , )if != nil {returnnil, , }return , , nil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.