aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github')
-rw-r--r--vendor/github.com/google/go-github/github/activity.go69
-rw-r--r--vendor/github.com/google/go-github/github/activity_events.go328
-rw-r--r--vendor/github.com/google/go-github/github/activity_notifications.go223
-rw-r--r--vendor/github.com/google/go-github/github/activity_star.go135
-rw-r--r--vendor/github.com/google/go-github/github/activity_watching.go146
-rw-r--r--vendor/github.com/google/go-github/github/admin.go101
-rw-r--r--vendor/github.com/google/go-github/github/admin_stats.go171
-rw-r--r--vendor/github.com/google/go-github/github/apps.go223
-rw-r--r--vendor/github.com/google/go-github/github/apps_installation.go101
-rw-r--r--vendor/github.com/google/go-github/github/apps_marketplace.go168
-rw-r--r--vendor/github.com/google/go-github/github/authorizations.go435
-rw-r--r--vendor/github.com/google/go-github/github/checks.go428
-rw-r--r--vendor/github.com/google/go-github/github/doc.go187
-rw-r--r--vendor/github.com/google/go-github/github/event_types.go786
-rw-r--r--vendor/github.com/google/go-github/github/gen-accessors.go332
-rw-r--r--vendor/github.com/google/go-github/github/gists.go358
-rw-r--r--vendor/github.com/google/go-github/github/gists_comments.go119
-rw-r--r--vendor/github.com/google/go-github/github/git.go12
-rw-r--r--vendor/github.com/google/go-github/github/git_blobs.go69
-rw-r--r--vendor/github.com/google/go-github/github/git_commits.go134
-rw-r--r--vendor/github.com/google/go-github/github/git_refs.go218
-rw-r--r--vendor/github.com/google/go-github/github/git_tags.go79
-rw-r--r--vendor/github.com/google/go-github/github/git_trees.go99
-rw-r--r--vendor/github.com/google/go-github/github/github-accessors.go11861
-rw-r--r--vendor/github.com/google/go-github/github/github.go994
-rw-r--r--vendor/github.com/google/go-github/github/gitignore.go64
-rw-r--r--vendor/github.com/google/go-github/github/issues.go347
-rw-r--r--vendor/github.com/google/go-github/github/issues_assignees.go85
-rw-r--r--vendor/github.com/google/go-github/github/issues_comments.go152
-rw-r--r--vendor/github.com/google/go-github/github/issues_events.go158
-rw-r--r--vendor/github.com/google/go-github/github/issues_labels.go261
-rw-r--r--vendor/github.com/google/go-github/github/issues_milestones.go148
-rw-r--r--vendor/github.com/google/go-github/github/issues_timeline.go149
-rw-r--r--vendor/github.com/google/go-github/github/licenses.go97
-rw-r--r--vendor/github.com/google/go-github/github/messages.go247
-rw-r--r--vendor/github.com/google/go-github/github/migrations.go224
-rw-r--r--vendor/github.com/google/go-github/github/migrations_source_import.go329
-rw-r--r--vendor/github.com/google/go-github/github/migrations_user.go214
-rw-r--r--vendor/github.com/google/go-github/github/misc.go257
-rw-r--r--vendor/github.com/google/go-github/github/orgs.go197
-rw-r--r--vendor/github.com/google/go-github/github/orgs_hooks.go107
-rw-r--r--vendor/github.com/google/go-github/github/orgs_members.go370
-rw-r--r--vendor/github.com/google/go-github/github/orgs_outside_collaborators.go81
-rw-r--r--vendor/github.com/google/go-github/github/orgs_projects.go60
-rw-r--r--vendor/github.com/google/go-github/github/orgs_users_blocking.go91
-rw-r--r--vendor/github.com/google/go-github/github/projects.go448
-rw-r--r--vendor/github.com/google/go-github/github/pulls.go383
-rw-r--r--vendor/github.com/google/go-github/github/pulls_comments.go188
-rw-r--r--vendor/github.com/google/go-github/github/pulls_reviewers.go79
-rw-r--r--vendor/github.com/google/go-github/github/pulls_reviews.go236
-rw-r--r--vendor/github.com/google/go-github/github/reactions.go274
-rw-r--r--vendor/github.com/google/go-github/github/repos.go1082
-rw-r--r--vendor/github.com/google/go-github/github/repos_collaborators.go140
-rw-r--r--vendor/github.com/google/go-github/github/repos_comments.go161
-rw-r--r--vendor/github.com/google/go-github/github/repos_commits.go237
-rw-r--r--vendor/github.com/google/go-github/github/repos_community_health.go59
-rw-r--r--vendor/github.com/google/go-github/github/repos_contents.go266
-rw-r--r--vendor/github.com/google/go-github/github/repos_deployments.go224
-rw-r--r--vendor/github.com/google/go-github/github/repos_forks.go89
-rw-r--r--vendor/github.com/google/go-github/github/repos_hooks.go200
-rw-r--r--vendor/github.com/google/go-github/github/repos_invitations.go98
-rw-r--r--vendor/github.com/google/go-github/github/repos_keys.go111
-rw-r--r--vendor/github.com/google/go-github/github/repos_merging.go38
-rw-r--r--vendor/github.com/google/go-github/github/repos_pages.go143
-rw-r--r--vendor/github.com/google/go-github/github/repos_prereceive_hooks.go110
-rw-r--r--vendor/github.com/google/go-github/github/repos_projects.go69
-rw-r--r--vendor/github.com/google/go-github/github/repos_releases.go329
-rw-r--r--vendor/github.com/google/go-github/github/repos_stats.go226
-rw-r--r--vendor/github.com/google/go-github/github/repos_statuses.go129
-rw-r--r--vendor/github.com/google/go-github/github/repos_traffic.go141
-rw-r--r--vendor/github.com/google/go-github/github/search.go261
-rw-r--r--vendor/github.com/google/go-github/github/strings.go93
-rw-r--r--vendor/github.com/google/go-github/github/teams.go357
-rw-r--r--vendor/github.com/google/go-github/github/teams_discussion_comments.go154
-rw-r--r--vendor/github.com/google/go-github/github/teams_discussions.go159
-rw-r--r--vendor/github.com/google/go-github/github/teams_members.go174
-rw-r--r--vendor/github.com/google/go-github/github/timestamp.go41
-rw-r--r--vendor/github.com/google/go-github/github/users.go284
-rw-r--r--vendor/github.com/google/go-github/github/users_administration.go67
-rw-r--r--vendor/github.com/google/go-github/github/users_blocking.go91
-rw-r--r--vendor/github.com/google/go-github/github/users_emails.go71
-rw-r--r--vendor/github.com/google/go-github/github/users_followers.go119
-rw-r--r--vendor/github.com/google/go-github/github/users_gpg_keys.go140
-rw-r--r--vendor/github.com/google/go-github/github/users_keys.go108
-rw-r--r--vendor/github.com/google/go-github/github/with_appengine.go20
-rw-r--r--vendor/github.com/google/go-github/github/without_appengine.go19
86 files changed, 29032 insertions, 0 deletions
diff --git a/vendor/github.com/google/go-github/github/activity.go b/vendor/github.com/google/go-github/github/activity.go
new file mode 100644
index 0000000..d6c992c
--- /dev/null
+++ b/vendor/github.com/google/go-github/github/activity.go
@@ -0,0 +1,69 @@
+// 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 github
+
+import "context"
+
+// ActivityService handles communication with the activity related
+// methods of the GitHub API.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/
+type ActivityService service
+
+// FeedLink represents a link to a related resource.
+type FeedLink struct {
+ HRef *string `json:"href,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// Feeds represents timeline resources in Atom format.
+type Feeds struct {
+ TimelineURL *string `json:"timeline_url,omitempty"`
+ UserURL *string `json:"user_url,omitempty"`
+ CurrentUserPublicURL *string `json:"current_user_public_url,omitempty"`
+ CurrentUserURL *string `json:"current_user_url,omitempty"`
+ CurrentUserActorURL *string `json:"current_user_actor_url,omitempty"`
+ CurrentUserOrganizationURL *string `json:"current_user_organization_url,omitempty"`
+ CurrentUserOrganizationURLs []string `json:"current_user_organization_urls,omitempty"`
+ Links *struct {
+ Timeline *FeedLink `json:"timeline,omitempty"`
+ User *FeedLink `json:"user,omitempty"`
+ CurrentUserPublic *FeedLink `json:"current_user_public,omitempty"`
+ CurrentUser *FeedLink `json:"current_user,omitempty"`
+ CurrentUserActor *FeedLink `json:"current_user_actor,omitempty"`
+ CurrentUserOrganization *FeedLink `json:"current_user_organization,omitempty"`
+ CurrentUserOrganizations []FeedLink `json:"current_user_organizations,omitempty"`
+ } `json:"_links,omitempty"`
+}
+
+// ListFeeds lists all the feeds available to the authenticated user.
+//
+// GitHub provides several timeline resources in Atom format:
+// Timeline: The GitHub global public timeline
+// User: The public timeline for any user, using URI template
+// Current user public: The public timeline for the authenticated user
+// Current user: The private timeline for the authenticated user
+// Current user actor: The private timeline for activity created by the
+// authenticated user
+// Current user organizations: The private timeline for the organizations
+// the authenticated user is a member of.
+//
+// Note: Private feeds are only returned when authenticating via Basic Auth
+// since current feed URIs use the older, non revocable auth tokens.
+func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) {
+ req, err := s.client.NewRequest("GET", "feeds", nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ f := &Feeds{}
+ resp, err := s.client.Do(ctx, req, f)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return f, resp, nil
+}
diff --git a/vendor/github.com/google/go-github/github/activity_events.go b/vendor/github.com/google/go-github/github/activity_events.go
new file mode 100644
index 0000000..a919b11
--- /dev/null
+++ b/vendor/github.com/google/go-github/github/activity_events.go
@@ -0,0 +1,328 @@
+// 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 github
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "time"
+)
+
+// Event represents a GitHub event.
+type Event struct {
+ Type *string `json:"type,omitempty"`
+ Public *bool `json:"public,omitempty"`
+ RawPayload *json.RawMessage `json:"payload,omitempty"`
+ Repo *Repository `json:"repo,omitempty"`
+ Actor *User `json:"actor,omitempty"`
+ Org *Organization `json:"org,omitempty"`
+ CreatedAt *time.Time `json:"created_at,omitempty"`
+ ID *string `json:"id,omitempty"`
+}
+
+func (e Event) String() string {
+ return Stringify(e)
+}
+
+// ParsePayload parses the event payload. For recognized event types,
+// a value of the corresponding struct type will be returned.
+func (e *Event) ParsePayload() (payload interface{}, err error) {
+ switch *e.Type {
+ case "CheckRunEvent":
+ payload = &CheckRunEvent{}
+ case "CheckSuiteEvent":
+ payload = &CheckSuiteEvent{}
+ case "CommitCommentEvent":
+ payload = &CommitCommentEvent{}
+ case "CreateEvent":
+ payload = &CreateEvent{}
+ case "DeleteEvent":
+ payload = &DeleteEvent{}
+ case "DeploymentEvent":
+ payload = &DeploymentEvent{}
+ case "DeploymentStatusEvent":
+ payload = &DeploymentStatusEvent{}
+ case "ForkEvent":
+ payload = &ForkEvent{}
+ case "GollumEvent":
+ payload = &GollumEvent{}
+ case "InstallationEvent":
+ payload = &InstallationEvent{}
+ case "InstallationRepositoriesEvent":
+ payload = &InstallationRepositoriesEvent{}
+ case "IssueCommentEvent":
+ payload = &IssueCommentEvent{}
+ case "IssuesEvent":
+ payload = &IssuesEvent{}
+ case "LabelEvent":
+ payload = &LabelEvent{}
+ case "MarketplacePurchaseEvent":
+ payload = &MarketplacePurchaseEvent{}
+ case "MemberEvent":
+ payload = &MemberEvent{}
+ case "MembershipEvent":
+ payload = &MembershipEvent{}
+ case "MilestoneEvent":
+ payload = &MilestoneEvent{}
+ case "OrganizationEvent":
+ payload = &OrganizationEvent{}
+ case "OrgBlockEvent":
+ payload = &OrgBlockEvent{}
+ case "PageBuildEvent":
+ payload = &PageBuildEvent{}
+ case "PingEvent":
+ payload = &PingEvent{}
+ case "ProjectEvent":
+ payload = &ProjectEvent{}
+ case "ProjectCardEvent":
+ payload = &ProjectCardEvent{}
+ case "ProjectColumnEvent":
+ payload = &ProjectColumnEvent{}
+ case "PublicEvent":
+ payload = &PublicEvent{}
+ case "PullRequestEvent":
+ payload = &PullRequestEvent{}
+ case "PullRequestReviewEvent":
+ payload = &PullRequestReviewEvent{}
+ case "PullRequestReviewCommentEvent":
+ payload = &PullRequestReviewCommentEvent{}
+ case "PushEvent":
+ payload = &PushEvent{}
+ case "ReleaseEvent":
+ payload = &ReleaseEvent{}
+ case "RepositoryEvent":
+ payload = &RepositoryEvent{}
+ case "StatusEvent":
+ payload = &StatusEvent{}
+ case "TeamEvent":
+ payload = &TeamEvent{}
+ case "TeamAddEvent":
+ payload = &TeamAddEvent{}
+ case "WatchEvent":
+ payload = &WatchEvent{}
+ }
+ err = json.Unmarshal(*e.RawPayload, &payload)
+ return payload, err
+}
+
+// Payload returns the parsed event payload. For recognized event types,
+// a value of the corresponding struct type will be returned.
+//
+// Deprecated: Use ParsePayload instead, which returns an error
+// rather than panics if JSON unmarshaling raw payload fails.
+func (e *Event) Payload() (payload interface{}) {
+ var err error
+ payload, err = e.ParsePayload()
+ if err != nil {
+ panic(err)
+ }
+ return payload
+}
+
+// ListEvents drinks from the firehose of all public events across GitHub.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events
+func (s *ActivityService) ListEvents(ctx context.Context, opt *ListOptions) ([]*Event, *Response, error) {
+ u, err := addOptions("events", opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var events []*Event
+ resp, err := s.client.Do(ctx, req, &events)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return events, resp, nil
+}
+
+// ListRepositoryEvents lists events for a repository.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/events/#list-repository-events
+func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Event, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/events", owner, repo)
+ 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
+ }
+
+ var events []*Event
+ resp, err := s.client.Do(ctx, req, &events)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return events, resp, nil
+}
+
+// ListIssueEventsForRepository lists issue events for a repository.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository
+func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo)
+ 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
+ }
+
+ var events []*IssueEvent
+ resp, err := s.client.Do(ctx, req, &events)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return events, resp, nil
+}
+
+// ListEventsForRepoNetwork lists public events for a network of repositories.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories
+func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Event, *Response, error) {
+ u := fmt.Sprintf("networks/%v/%v/events", owner, repo)
+ 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
+ }
+
+ var events []*Event
+ resp, err := s.client.Do(ctx, req, &events)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return events, resp, nil
+}
+
+// ListEventsForOrganization lists public events for an organization.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization
+func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opt *ListOptions) ([]*Event, *Response, error) {
+ u := fmt.Sprintf("orgs/%v/events", 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
+ }
+
+ var events []*Event
+ resp, err := s.client.Do(ctx, req, &events)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return events, resp, nil
+}
+
+// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is
+// true, only public events will be returned.
+//
+// GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user
+func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opt *ListOptions) ([]*Event, *Response, error) {
+ var u string
+ if publicOnly {
+ u = fmt.Sprintf("users/%v/events/public", user)
+ } else {
+ u = fmt.Sprintf("users/%v/events", user)
+ }
+ 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
+ }
+
+ var events []*Event
+ resp, err := s.client.Do(ctx, req, &events)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return events, resp, nil
+}
+
+// ListEventsReceivedByUser lists the events received by a user. If publicOnly is
+// true, only public