mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
3
vendor/github.com/google/go-github/v26/AUTHORS
generated
vendored
3
vendor/github.com/google/go-github/v26/AUTHORS
generated
vendored
@@ -27,6 +27,7 @@ Andrew Ryabchun <aryabchun@mail.ua>
|
||||
Andy Grunwald <andygrunwald@gmail.com>
|
||||
Andy Hume <andyhume@gmail.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
anjanashenoy <anjanashenoy1@gmail.com>
|
||||
Anshuman Bhartiya <anshuman.bhartiya@gmail.com>
|
||||
Antoine <antoine.tu@mail.mcgill.ca>
|
||||
Antoine Pelisse <apelisse@gmail.com>
|
||||
@@ -69,6 +70,7 @@ Dave Du Cros <davidducros@gmail.com>
|
||||
Dave Henderson <dhenderson@gmail.com>
|
||||
David Deng <daviddengcn@gmail.com>
|
||||
David Jannotta <djannotta@gmail.com>
|
||||
David Ji <github.com/davidji99>
|
||||
Davide Zipeto <dawez1@gmail.com>
|
||||
Dennis Webb <dennis@bluesentryit.com>
|
||||
Dhi Aurrahman <diorahman@rockybars.com>
|
||||
@@ -152,6 +154,7 @@ Luke Kysow <lkysow@gmail.com>
|
||||
Luke Roberts <email@luke-roberts.co.uk>
|
||||
Luke Young <luke@hydrantlabs.org>
|
||||
Maksim Zhylinski <uzzable@gmail.com>
|
||||
Mark Tareshawty <tarebyte@github.com>
|
||||
Martin-Louis Bright <mlbright@gmail.com>
|
||||
Marwan Sulaiman <marwan.sameer@gmail.com>
|
||||
Mat Geist <matgeist@gmail.com>
|
||||
|
||||
43
vendor/github.com/google/go-github/v26/github/admin_orgs.go
generated
vendored
Normal file
43
vendor/github.com/google/go-github/v26/github/admin_orgs.go
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright 2019 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 github
|
||||
|
||||
import "context"
|
||||
|
||||
// createOrgRequest is a subset of Organization and is used internally
|
||||
// by CreateOrg to pass only the known fields for the endpoint.
|
||||
type createOrgRequest struct {
|
||||
Login *string `json:"login,omitempty"`
|
||||
Admin *string `json:"admin,omitempty"`
|
||||
}
|
||||
|
||||
// CreateOrg creates a new organization in GitHub Enterprise.
|
||||
//
|
||||
// Note that only a subset of the org fields are used and org must
|
||||
// not be nil.
|
||||
//
|
||||
// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization
|
||||
func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) {
|
||||
u := "admin/organizations"
|
||||
|
||||
orgReq := &createOrgRequest{
|
||||
Login: org.Login,
|
||||
Admin: &admin,
|
||||
}
|
||||
|
||||
req, err := s.client.NewRequest("POST", u, orgReq)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
o := new(Organization)
|
||||
resp, err := s.client.Do(ctx, req, o)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return o, resp, nil
|
||||
}
|
||||
4
vendor/github.com/google/go-github/v26/github/admin_stats.go
generated
vendored
4
vendor/github.com/google/go-github/v26/github/admin_stats.go
generated
vendored
@@ -10,7 +10,7 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// AdminStats represents a variety of stats of a Github Enterprise
|
||||
// AdminStats represents a variety of stats of a GitHub Enterprise
|
||||
// installation.
|
||||
type AdminStats struct {
|
||||
Issues *IssueStats `json:"issues,omitempty"`
|
||||
@@ -147,7 +147,7 @@ func (s RepoStats) String() string {
|
||||
return Stringify(s)
|
||||
}
|
||||
|
||||
// GetAdminStats returns a variety of metrics about a Github Enterprise
|
||||
// GetAdminStats returns a variety of metrics about a GitHub Enterprise
|
||||
// installation.
|
||||
//
|
||||
// Please note that this is only available to site administrators,
|
||||
|
||||
61
vendor/github.com/google/go-github/v26/github/admin_users.go
generated
vendored
Normal file
61
vendor/github.com/google/go-github/v26/github/admin_users.go
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
// Copyright 2019 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 github
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// createUserRequest is a subset of User and is used internally
|
||||
// by CreateUser to pass only the known fields for the endpoint.
|
||||
type createUserRequest struct {
|
||||
Login *string `json:"login,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
}
|
||||
|
||||
// CreateUser creates a new user in GitHub Enterprise.
|
||||
//
|
||||
// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-a-new-user
|
||||
func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) {
|
||||
u := "admin/users"
|
||||
|
||||
userReq := &createUserRequest{
|
||||
Login: &login,
|
||||
Email: &email,
|
||||
}
|
||||
|
||||
req, err := s.client.NewRequest("POST", u, userReq)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var user User
|
||||
resp, err := s.client.Do(ctx, req, &user)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return &user, resp, nil
|
||||
}
|
||||
|
||||
// DeleteUser deletes a user in GitHub Enterprise.
|
||||
//
|
||||
// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user
|
||||
func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) {
|
||||
u := "admin/users/" + username
|
||||
|
||||
req, err := s.client.NewRequest("DELETE", u, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp, err := s.client.Do(ctx, req, nil)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
5
vendor/github.com/google/go-github/v26/github/git_refs.go
generated
vendored
5
vendor/github.com/google/go-github/v26/github/git_refs.go
generated
vendored
@@ -68,7 +68,10 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref
|
||||
resp, err := s.client.Do(ctx, req, r)
|
||||
if _, ok := err.(*json.UnmarshalTypeError); ok {
|
||||
// Multiple refs, means there wasn't an exact match.
|
||||
return nil, resp, errors.New("no exact match found for this ref")
|
||||
return nil, resp, errors.New("multiple matches found for this ref")
|
||||
} else if resp.StatusCode == 404 {
|
||||
// No ref, there was no match for the ref
|
||||
return nil, resp, errors.New("no match found for this ref")
|
||||
} else if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
40
vendor/github.com/google/go-github/v26/github/github-accessors.go
generated
vendored
40
vendor/github.com/google/go-github/v26/github/github-accessors.go
generated
vendored
@@ -3324,6 +3324,30 @@ func (h *HookStats) GetTotalHooks() int {
|
||||
return *h.TotalHooks
|
||||
}
|
||||
|
||||
// GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise.
|
||||
func (i *IDPGroup) GetGroupDescription() string {
|
||||
if i == nil || i.GroupDescription == nil {
|
||||
return ""
|
||||
}
|
||||
return *i.GroupDescription
|
||||
}
|
||||
|
||||
// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise.
|
||||
func (i *IDPGroup) GetGroupID() string {
|
||||
if i == nil || i.GroupID == nil {
|
||||
return ""
|
||||
}
|
||||
return *i.GroupID
|
||||
}
|
||||
|
||||
// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise.
|
||||
func (i *IDPGroup) GetGroupName() string {
|
||||
if i == nil || i.GroupName == nil {
|
||||
return ""
|
||||
}
|
||||
return *i.GroupName
|
||||
}
|
||||
|
||||
// GetAuthorsCount returns the AuthorsCount field if it's non-nil, zero value otherwise.
|
||||
func (i *Import) GetAuthorsCount() int {
|
||||
if i == nil || i.AuthorsCount == nil {
|
||||
@@ -6132,6 +6156,14 @@ func (o *Organization) GetLogin() string {
|
||||
return *o.Login
|
||||
}
|
||||
|
||||
// GetMembersAllowedRepositoryCreationType returns the MembersAllowedRepositoryCreationType field if it's non-nil, zero value otherwise.
|
||||
func (o *Organization) GetMembersAllowedRepositoryCreationType() string {
|
||||
if o == nil || o.MembersAllowedRepositoryCreationType == nil {
|
||||
return ""
|
||||
}
|
||||
return *o.MembersAllowedRepositoryCreationType
|
||||
}
|
||||
|
||||
// GetMembersCanCreateRepos returns the MembersCanCreateRepos field if it's non-nil, zero value otherwise.
|
||||
func (o *Organization) GetMembersCanCreateRepos() bool {
|
||||
if o == nil || o.MembersCanCreateRepos == nil {
|
||||
@@ -12388,6 +12420,14 @@ func (u *UserEmail) GetVerified() bool {
|
||||
return *u.Verified
|
||||
}
|
||||
|
||||
// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.
|
||||
func (u *UserEmail) GetVisibility() string {
|
||||
if u == nil || u.Visibility == nil {
|
||||
return ""
|
||||
}
|
||||
return *u.Visibility
|
||||
}
|
||||
|
||||
// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.
|
||||
func (u *UserLDAPMapping) GetAvatarURL() string {
|
||||
if u == nil || u.AvatarURL == nil {
|
||||
|
||||
6
vendor/github.com/google/go-github/v26/github/github.go
generated
vendored
6
vendor/github.com/google/go-github/v26/github/github.go
generated
vendored
@@ -147,6 +147,12 @@ const (
|
||||
|
||||
// https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/
|
||||
mediaTypeListPullsOrBranchesForCommitPreview = "application/vnd.github.groot-preview+json"
|
||||
|
||||
// https://developer.github.com/changes/2019-06-12-team-sync/
|
||||
mediaTypeTeamSyncPreview = "application/vnd.github.team-sync-preview+json"
|
||||
|
||||
// https://developer.github.com/v3/previews/#repository-creation-permissions
|
||||
mediaTypeMemberAllowedRepoCreationTypePreview = "application/vnd.github.surtur-preview+json"
|
||||
)
|
||||
|
||||
// A Client manages communication with the GitHub API.
|
||||
|
||||
7
vendor/github.com/google/go-github/v26/github/orgs.go
generated
vendored
7
vendor/github.com/google/go-github/v26/github/orgs.go
generated
vendored
@@ -56,6 +56,10 @@ type Organization struct {
|
||||
// MembersCanCreateRepos default value is true and is only used in Organizations.Edit.
|
||||
MembersCanCreateRepos *bool `json:"members_can_create_repositories,omitempty"`
|
||||
|
||||
// MembersAllowedRepositoryCreationType denotes if organization members can create repositories
|
||||
// and the type of repositories they can create. Possible values are: "all", "private", or "none".
|
||||
MembersAllowedRepositoryCreationType *string `json:"members_allowed_repository_creation_type,omitempty"`
|
||||
|
||||
// API URLs
|
||||
URL *string `json:"url,omitempty"`
|
||||
EventsURL *string `json:"events_url,omitempty"`
|
||||
@@ -160,6 +164,9 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
req.Header.Set("Accept", mediaTypeMemberAllowedRepoCreationTypePreview)
|
||||
|
||||
organization := new(Organization)
|
||||
resp, err := s.client.Do(ctx, req, organization)
|
||||
if err != nil {
|
||||
|
||||
84
vendor/github.com/google/go-github/v26/github/teams.go
generated
vendored
84
vendor/github.com/google/go-github/v26/github/teams.go
generated
vendored
@@ -476,3 +476,87 @@ func (s *TeamsService) RemoveTeamProject(ctx context.Context, teamID int64, proj
|
||||
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
// IDPGroupList represents a list of external identity provider (IDP) groups.
|
||||
type IDPGroupList struct {
|
||||
Groups []*IDPGroup `json:"groups,omitempty"`
|
||||
}
|
||||
|
||||
// IDPGroup represents an external identity provider (IDP) group.
|
||||
type IDPGroup struct {
|
||||
GroupID *string `json:"group_id,omitempty"`
|
||||
GroupName *string `json:"group_name,omitempty"`
|
||||
GroupDescription *string `json:"group_description,omitempty"`
|
||||
}
|
||||
|
||||
// ListIDPGroupsInOrganization lists IDP groups available in an organization.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/teams/team_sync/#list-idp-groups-in-an-organization
|
||||
func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opt *ListOptions) (*IDPGroupList, *Response, error) {
|
||||
u := fmt.Sprintf("orgs/%v/team-sync/groups", org)
|
||||
u, err := addOptions(u, opt)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
req.Header.Set("Accept", mediaTypeTeamSyncPreview)
|
||||
|
||||
groups := new(IDPGroupList)
|
||||
resp, err := s.client.Do(ctx, req, groups)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
return groups, resp, nil
|
||||
}
|
||||
|
||||
// ListIDPGroupsForTeam lists IDP groups connected to a team on GitHub.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-a-team
|
||||
func (s *TeamsService) ListIDPGroupsForTeam(ctx context.Context, teamID string) (*IDPGroupList, *Response, error) {
|
||||
u := fmt.Sprintf("teams/%v/team-sync/group-mappings", teamID)
|
||||
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
req.Header.Set("Accept", mediaTypeTeamSyncPreview)
|
||||
|
||||
groups := new(IDPGroupList)
|
||||
resp, err := s.client.Do(ctx, req, groups)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
return groups, resp, err
|
||||
}
|
||||
|
||||
// CreateOrUpdateIDPGroupConnections creates, updates, or removes a connection between a team
|
||||
// and an IDP group.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/teams/team_sync/#create-or-update-idp-group-connections
|
||||
func (s *TeamsService) CreateOrUpdateIDPGroupConnections(ctx context.Context, teamID string, opt IDPGroupList) (*IDPGroupList, *Response, error) {
|
||||
u := fmt.Sprintf("teams/%v/team-sync/group-mappings", teamID)
|
||||
|
||||
req, err := s.client.NewRequest("PATCH", u, opt)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
req.Header.Set("Accept", mediaTypeTeamSyncPreview)
|
||||
|
||||
groups := new(IDPGroupList)
|
||||
resp, err := s.client.Do(ctx, req, groups)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return groups, resp, nil
|
||||
}
|
||||
|
||||
7
vendor/github.com/google/go-github/v26/github/users_emails.go
generated
vendored
7
vendor/github.com/google/go-github/v26/github/users_emails.go
generated
vendored
@@ -9,9 +9,10 @@ import "context"
|
||||
|
||||
// UserEmail represents user's email address
|
||||
type UserEmail struct {
|
||||
Email *string `json:"email,omitempty"`
|
||||
Primary *bool `json:"primary,omitempty"`
|
||||
Verified *bool `json:"verified,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
Primary *bool `json:"primary,omitempty"`
|
||||
Verified *bool `json:"verified,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
}
|
||||
|
||||
// ListEmails lists all email addresses for the authenticated user.
|
||||
|
||||
Reference in New Issue
Block a user