Merge v1.2.1-master
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
a590155b0b
commit
aeb17182b4
396 changed files with 27271 additions and 9969 deletions
21
vendor/github.com/google/go-github/github/users_administration.go
generated
vendored
21
vendor/github.com/google/go-github/github/users_administration.go
generated
vendored
|
@ -5,12 +5,15 @@
|
|||
|
||||
package github
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/users/administration/#promote-an-ordinary-user-to-a-site-administrator
|
||||
func (s *UsersService) PromoteSiteAdmin(user string) (*Response, error) {
|
||||
func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) {
|
||||
u := fmt.Sprintf("users/%v/site_admin", user)
|
||||
|
||||
req, err := s.client.NewRequest("PUT", u, nil)
|
||||
|
@ -18,13 +21,13 @@ func (s *UsersService) PromoteSiteAdmin(user string) (*Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(req, nil)
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
// DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/users/administration/#demote-a-site-administrator-to-an-ordinary-user
|
||||
func (s *UsersService) DemoteSiteAdmin(user string) (*Response, error) {
|
||||
func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) {
|
||||
u := fmt.Sprintf("users/%v/site_admin", user)
|
||||
|
||||
req, err := s.client.NewRequest("DELETE", u, nil)
|
||||
|
@ -32,13 +35,13 @@ func (s *UsersService) DemoteSiteAdmin(user string) (*Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(req, nil)
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
// Suspend a user on a GitHub Enterprise instance.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/users/administration/#suspend-a-user
|
||||
func (s *UsersService) Suspend(user string) (*Response, error) {
|
||||
func (s *UsersService) Suspend(ctx context.Context, user string) (*Response, error) {
|
||||
u := fmt.Sprintf("users/%v/suspended", user)
|
||||
|
||||
req, err := s.client.NewRequest("PUT", u, nil)
|
||||
|
@ -46,13 +49,13 @@ func (s *UsersService) Suspend(user string) (*Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(req, nil)
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
// Unsuspend a user on a GitHub Enterprise instance.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/users/administration/#unsuspend-a-user
|
||||
func (s *UsersService) Unsuspend(user string) (*Response, error) {
|
||||
func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) {
|
||||
u := fmt.Sprintf("users/%v/suspended", user)
|
||||
|
||||
req, err := s.client.NewRequest("DELETE", u, nil)
|
||||
|
@ -60,5 +63,5 @@ func (s *UsersService) Unsuspend(user string) (*Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(req, nil)
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue