From 35bb28b90ea0690d30ad6b9d0b7c77bb2a1171f1 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Fri, 10 Apr 2020 13:11:27 -0400 Subject: [PATCH 1/2] update to go-github v31.0.0 --- github/config.go | 2 +- github/data_source_github_collaborators.go | 2 +- github/data_source_github_release.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_team.go | 5 +- github/resource_github_actions_secret.go | 2 +- github/resource_github_branch_protection.go | 2 +- .../resource_github_branch_protection_test.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_label_test.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 2 +- ...source_github_organization_webhook_test.go | 2 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 7 +- ...rce_github_repository_collaborator_test.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- github/resource_github_repository_file.go | 2 +- .../resource_github_repository_file_test.go | 2 +- github/resource_github_repository_project.go | 2 +- ...resource_github_repository_project_test.go | 2 +- github/resource_github_repository_test.go | 2 +- github/resource_github_repository_webhook.go | 2 +- ...resource_github_repository_webhook_test.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 15 +- .../resource_github_team_membership_test.go | 15 +- github/resource_github_team_repository.go | 2 +- .../resource_github_team_repository_test.go | 2 +- github/resource_github_team_test.go | 2 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_gpg_key_test.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_github_user_ssh_key_test.go | 2 +- github/resource_organization_block.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 2 +- go.sum | 4 +- .../google/go-github/v29/github/admin_orgs.go | 43 - .../go-github/v29/github/gen-accessors.go | 333 ------- .../v29/github/gen-stringify-test.go | 358 -------- .../v29/github/teams_discussion_comments.go | 140 --- .../go-github/v29/github/teams_discussions.go | 145 --- .../go-github/v29/github/teams_members.go | 170 ---- .../google/go-github/{v29 => v31}/AUTHORS | 16 +- .../google/go-github/{v29 => v31}/LICENSE | 0 .../go-github/{v29 => v31}/github/actions.go | 0 .../go-github/v31/github/actions_artifacts.go | 140 +++ .../go-github/v31/github/actions_runners.go | 161 ++++ .../{v29 => v31}/github/actions_secrets.go | 0 .../v31/github/actions_workflow_jobs.go | 149 ++++ .../v31/github/actions_workflow_runs.go | 181 ++++ .../{v29 => v31}/github/actions_workflows.go | 24 +- .../go-github/{v29 => v31}/github/activity.go | 14 +- .../{v29 => v31}/github/activity_events.go | 12 +- .../github/activity_notifications.go | 10 +- .../{v29 => v31}/github/activity_star.go | 9 +- .../{v29 => v31}/github/activity_watching.go | 3 +- .../go-github/{v29 => v31}/github/admin.go | 0 .../google/go-github/v31/github/admin_orgs.go | 89 ++ .../{v29 => v31}/github/admin_stats.go | 0 .../{v29 => v31}/github/admin_users.go | 0 .../go-github/{v29 => v31}/github/apps.go | 7 +- .../{v29 => v31}/github/apps_installation.go | 4 +- .../{v29 => v31}/github/apps_manifest.go | 2 +- .../{v29 => v31}/github/apps_marketplace.go | 3 +- .../{v29 => v31}/github/authorizations.go | 229 +---- .../go-github/{v29 => v31}/github/checks.go | 19 +- .../go-github/{v29 => v31}/github/doc.go | 2 +- .../go-github/{v29 => v31}/github/event.go | 0 .../{v29 => v31}/github/event_types.go | 22 +- .../go-github/{v29 => v31}/github/gists.go | 11 +- .../{v29 => v31}/github/gists_comments.go | 0 .../go-github/{v29 => v31}/github/git.go | 0 .../{v29 => v31}/github/git_blobs.go | 0 .../{v29 => v31}/github/git_commits.go | 2 +- .../go-github/{v29 => v31}/github/git_refs.go | 16 +- .../go-github/{v29 => v31}/github/git_tags.go | 0 .../{v29 => v31}/github/git_trees.go | 6 +- .../{v29 => v31}/github/github-accessors.go | 842 ++++++++++++++++-- .../go-github/{v29 => v31}/github/github.go | 62 +- .../{v29 => v31}/github/gitignore.go | 4 +- .../{v29 => v31}/github/interactions.go | 0 .../{v29 => v31}/github/interactions_orgs.go | 0 .../{v29 => v31}/github/interactions_repos.go | 0 .../go-github/{v29 => v31}/github/issues.go | 66 +- .../{v29 => v31}/github/issues_assignees.go | 0 .../{v29 => v31}/github/issues_comments.go | 1 + .../{v29 => v31}/github/issues_events.go | 0 .../{v29 => v31}/github/issues_labels.go | 0 .../{v29 => v31}/github/issues_milestones.go | 0 .../{v29 => v31}/github/issues_timeline.go | 0 .../go-github/{v29 => v31}/github/licenses.go | 0 .../go-github/{v29 => v31}/github/messages.go | 0 .../{v29 => v31}/github/migrations.go | 12 +- .../github/migrations_source_import.go | 18 +- .../{v29 => v31}/github/migrations_user.go | 2 +- .../go-github/{v29 => v31}/github/misc.go | 0 .../go-github/{v29 => v31}/github/orgs.go | 3 +- .../{v29 => v31}/github/orgs_hooks.go | 0 .../{v29 => v31}/github/orgs_members.go | 8 +- .../github/orgs_outside_collaborators.go | 0 .../{v29 => v31}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v29 => v31}/github/projects.go | 0 .../go-github/{v29 => v31}/github/pulls.go | 6 +- .../{v29 => v31}/github/pulls_comments.go | 3 +- .../{v29 => v31}/github/pulls_reviewers.go | 0 .../{v29 => v31}/github/pulls_reviews.go | 0 .../{v29 => v31}/github/reactions.go | 136 ++- .../go-github/{v29 => v31}/github/repos.go | 54 +- .../github/repos_collaborators.go | 4 +- .../{v29 => v31}/github/repos_comments.go | 0 .../{v29 => v31}/github/repos_commits.go | 33 +- .../github/repos_community_health.go | 2 +- .../{v29 => v31}/github/repos_contents.go | 4 +- .../{v29 => v31}/github/repos_deployments.go | 0 .../{v29 => v31}/github/repos_forks.go | 0 .../{v29 => v31}/github/repos_hooks.go | 26 +- .../{v29 => v31}/github/repos_invitations.go | 0 .../{v29 => v31}/github/repos_keys.go | 28 +- .../{v29 => v31}/github/repos_merging.go | 0 .../{v29 => v31}/github/repos_pages.go | 33 +- .../github/repos_prereceive_hooks.go | 0 .../{v29 => v31}/github/repos_projects.go | 0 .../{v29 => v31}/github/repos_releases.go | 24 +- .../{v29 => v31}/github/repos_stats.go | 16 +- .../{v29 => v31}/github/repos_statuses.go | 15 +- .../{v29 => v31}/github/repos_traffic.go | 2 +- .../go-github/{v29 => v31}/github/search.go | 48 +- .../go-github/{v29 => v31}/github/strings.go | 0 .../go-github/{v29 => v31}/github/teams.go | 64 +- .../v31/github/teams_discussion_comments.go | 242 +++++ .../go-github/v31/github/teams_discussions.go | 247 +++++ .../go-github/v31/github/teams_members.go | 243 +++++ .../{v29 => v31}/github/timestamp.go | 0 .../go-github/{v29 => v31}/github/users.go | 4 +- .../github/users_administration.go | 0 .../{v29 => v31}/github/users_blocking.go | 0 .../{v29 => v31}/github/users_emails.go | 0 .../{v29 => v31}/github/users_followers.go | 3 + .../{v29 => v31}/github/users_gpg_keys.go | 25 +- .../{v29 => v31}/github/users_keys.go | 1 + .../{v29 => v31}/github/users_projects.go | 2 +- .../{v29 => v31}/github/with_appengine.go | 0 .../{v29 => v31}/github/without_appengine.go | 0 vendor/modules.txt | 236 ++--- 154 files changed, 2969 insertions(+), 1996 deletions(-) delete mode 100644 vendor/github.com/google/go-github/v29/github/admin_orgs.go delete mode 100644 vendor/github.com/google/go-github/v29/github/gen-accessors.go delete mode 100644 vendor/github.com/google/go-github/v29/github/gen-stringify-test.go delete mode 100644 vendor/github.com/google/go-github/v29/github/teams_discussion_comments.go delete mode 100644 vendor/github.com/google/go-github/v29/github/teams_discussions.go delete mode 100644 vendor/github.com/google/go-github/v29/github/teams_members.go rename vendor/github.com/google/go-github/{v29 => v31}/AUTHORS (95%) rename vendor/github.com/google/go-github/{v29 => v31}/LICENSE (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/actions.go (100%) create mode 100644 vendor/github.com/google/go-github/v31/github/actions_artifacts.go create mode 100644 vendor/github.com/google/go-github/v31/github/actions_runners.go rename vendor/github.com/google/go-github/{v29 => v31}/github/actions_secrets.go (100%) create mode 100644 vendor/github.com/google/go-github/v31/github/actions_workflow_jobs.go create mode 100644 vendor/github.com/google/go-github/v31/github/actions_workflow_runs.go rename vendor/github.com/google/go-github/{v29 => v31}/github/actions_workflows.go (78%) rename vendor/github.com/google/go-github/{v29 => v31}/github/activity.go (82%) rename vendor/github.com/google/go-github/{v29 => v31}/github/activity_events.go (93%) rename vendor/github.com/google/go-github/{v29 => v31}/github/activity_notifications.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/activity_star.go (92%) rename vendor/github.com/google/go-github/{v29 => v31}/github/activity_watching.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/admin.go (100%) create mode 100644 vendor/github.com/google/go-github/v31/github/admin_orgs.go rename vendor/github.com/google/go-github/{v29 => v31}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/admin_users.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/apps.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/apps_installation.go (94%) rename vendor/github.com/google/go-github/{v29 => v31}/github/apps_manifest.go (90%) rename vendor/github.com/google/go-github/{v29 => v31}/github/apps_marketplace.go (97%) rename vendor/github.com/google/go-github/{v29 => v31}/github/authorizations.go (56%) rename vendor/github.com/google/go-github/{v29 => v31}/github/checks.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/doc.go (99%) rename vendor/github.com/google/go-github/{v29 => v31}/github/event.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/event_types.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/gists.go (97%) rename vendor/github.com/google/go-github/{v29 => v31}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/git.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/git_commits.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/git_refs.go (92%) rename vendor/github.com/google/go-github/{v29 => v31}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/git_trees.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/github-accessors.go (95%) rename vendor/github.com/google/go-github/{v29 => v31}/github/github.go (97%) rename vendor/github.com/google/go-github/{v29 => v31}/github/gitignore.go (88%) rename vendor/github.com/google/go-github/{v29 => v31}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues.go (82%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues_comments.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/messages.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/migrations.go (92%) rename vendor/github.com/google/go-github/{v29 => v31}/github/migrations_source_import.go (92%) rename vendor/github.com/google/go-github/{v29 => v31}/github/migrations_user.go (99%) rename vendor/github.com/google/go-github/{v29 => v31}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/orgs.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/orgs_members.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/projects.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/pulls.go (99%) rename vendor/github.com/google/go-github/{v29 => v31}/github/pulls_comments.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/reactions.go (62%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_collaborators.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_commits.go (90%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_community_health.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_contents.go (99%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_hooks.go (90%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_keys.go (81%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_pages.go (84%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_releases.go (95%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_stats.go (94%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_statuses.go (91%) rename vendor/github.com/google/go-github/{v29 => v31}/github/repos_traffic.go (99%) rename vendor/github.com/google/go-github/{v29 => v31}/github/search.go (89%) rename vendor/github.com/google/go-github/{v29 => v31}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/teams.go (92%) create mode 100644 vendor/github.com/google/go-github/v31/github/teams_discussion_comments.go create mode 100644 vendor/github.com/google/go-github/v31/github/teams_discussions.go create mode 100644 vendor/github.com/google/go-github/v31/github/teams_members.go rename vendor/github.com/google/go-github/{v29 => v31}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_followers.go (91%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_gpg_keys.go (80%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_keys.go (96%) rename vendor/github.com/google/go-github/{v29 => v31}/github/users_projects.go (98%) rename vendor/github.com/google/go-github/{v29 => v31}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v29 => v31}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index 7edb3eec33..45482482ce 100644 --- a/github/config.go +++ b/github/config.go @@ -7,7 +7,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" "golang.org/x/oauth2" ) diff --git a/github/data_source_github_collaborators.go b/github/data_source_github_collaborators.go index dd96347fcb..ee7c778608 100644 --- a/github/data_source_github_collaborators.go +++ b/github/data_source_github_collaborators.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_release.go b/github/data_source_github_release.go index 83d72de182..a5183183f7 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index c6605b6a18..e09014a1da 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 803e83bd5b..35efda2d0e 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -53,6 +53,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { log.Printf("[INFO] Refreshing GitHub Team: %s", slug) client := meta.(*Organization).client + orgId := meta.(*Organization).id ctx := context.Background() team, err := getGithubTeamBySlug(ctx, client, meta.(*Organization).name, slug) @@ -60,7 +61,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { return err } - member, _, err := client.Teams.ListTeamMembers(ctx, team.GetID(), nil) + member, _, err := client.Teams.ListTeamMembersByID(ctx, orgId, team.GetID(), nil) if err != nil { return err } diff --git a/github/resource_github_actions_secret.go b/github/resource_github_actions_secret.go index 94dcee3786..2c452cab67 100644 --- a/github/resource_github_actions_secret.go +++ b/github/resource_github_actions_secret.go @@ -4,7 +4,7 @@ import ( "context" "encoding/base64" "fmt" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "golang.org/x/crypto/nacl/box" "log" diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index 70bbff0de2..36fe75ab4c 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index e5f2b6051c..16edafbf91 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -7,7 +7,7 @@ import ( "sort" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index 5f4fc5cf57..ad305e1a5e 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_issue_label_test.go b/github/resource_github_issue_label_test.go index 557777cc16..863fc507f9 100644 --- a/github/resource_github_issue_label_test.go +++ b/github/resource_github_issue_label_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 6024fa2173..60b8439317 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 4ccda28296..592afa3294 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 53627386bc..8cdc05e876 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index efce23b7c1..0ca174163c 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 062d561b72..81630b2b0a 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_organization_webhook_test.go b/github/resource_github_organization_webhook_test.go index 0a3d2a1d4a..8f7fe688c4 100644 --- a/github/resource_github_organization_webhook_test.go +++ b/github/resource_github_organization_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index b69f01706c..765ed0d7ca 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index 800171e0ec..45914653c5 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index ae26797079..4c5fe281b5 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -8,7 +8,7 @@ import ( "net/http" "regexp" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index 49357a9987..c20a149ef3 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -63,7 +63,7 @@ func resourceGithubRepositoryCollaboratorCreate(d *schema.ResourceData, meta int log.Printf("[DEBUG] Creating repository collaborator: %s (%s/%s)", username, orgName, repoName) - _, _, err = client.Repositories.AddCollaborator(ctx, + _, resp, err := client.Repositories.AddCollaborator(ctx, orgName, repoName, username, @@ -74,6 +74,9 @@ func resourceGithubRepositoryCollaboratorCreate(d *schema.ResourceData, meta int if err != nil { return err } + if resp.StatusCode == http.StatusNoContent { + return fmt.Errorf("User %s is already a collaborator", username) + } d.SetId(buildTwoPartID(&repoName, &username)) diff --git a/github/resource_github_repository_collaborator_test.go b/github/resource_github_repository_collaborator_test.go index 93ed3bf0f6..ba79354ce1 100644 --- a/github/resource_github_repository_collaborator_test.go +++ b/github/resource_github_repository_collaborator_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index bc276968c3..c7385596af 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_file.go b/github/resource_github_repository_file.go index eb819e45fa..7608303c37 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -8,7 +8,7 @@ import ( "fmt" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_file_test.go b/github/resource_github_repository_file_test.go index c980a296a1..880ff30d50 100644 --- a/github/resource_github_repository_file_test.go +++ b/github/resource_github_repository_file_test.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index af468e63be..3a3c312963 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_project_test.go b/github/resource_github_repository_project_test.go index c26480f422..b443d6e0d8 100644 --- a/github/resource_github_repository_project_test.go +++ b/github/resource_github_repository_project_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index 960004df12..3b0617dda7 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index f54517dd67..17a9c56917 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_webhook_test.go b/github/resource_github_repository_webhook_test.go index 7fee841087..4b86bbf028 100644 --- a/github/resource_github_repository_webhook_test.go +++ b/github/resource_github_repository_webhook_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 59679e4da2..d16a9722b5 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 3335330ac1..14361ee3fa 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -50,6 +50,7 @@ func resourceGithubTeamMembership() *schema.Resource { func resourceGithubTeamMembershipCreateOrUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*Organization).client + orgId := meta.(*Organization).id teamIdString := d.Get("team_id").(string) teamId, err := strconv.ParseInt(teamIdString, 10, 64) @@ -62,7 +63,8 @@ func resourceGithubTeamMembershipCreateOrUpdate(d *schema.ResourceData, meta int role := d.Get("role").(string) log.Printf("[DEBUG] Creating team membership: %s/%s (%s)", teamIdString, username, role) - _, _, err = client.Teams.AddTeamMembership(ctx, + _, _, err = client.Teams.AddTeamMembershipByID(ctx, + orgId, teamId, username, &github.TeamAddTeamMembershipOptions{ @@ -80,6 +82,7 @@ func resourceGithubTeamMembershipCreateOrUpdate(d *schema.ResourceData, meta int func resourceGithubTeamMembershipRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*Organization).client + orgId := meta.(*Organization).id teamIdString, username, err := parseTwoPartID(d.Id(), "team_id", "username") if err != nil { return err @@ -102,8 +105,8 @@ func resourceGithubTeamMembershipRead(d *schema.ResourceData, meta interface{}) } log.Printf("[DEBUG] Reading team membership: %s/%s", teamIdString, username) - membership, resp, err := client.Teams.GetTeamMembership(ctx, - teamId, username) + membership, resp, err := client.Teams.GetTeamMembershipByID(ctx, + orgId, teamId, username) if err != nil { if ghErr, ok := err.(*github.ErrorResponse); ok { if ghErr.Response.StatusCode == http.StatusNotModified { @@ -127,7 +130,7 @@ func resourceGithubTeamMembershipRead(d *schema.ResourceData, meta interface{}) func resourceGithubTeamMembershipDelete(d *schema.ResourceData, meta interface{}) error { client := meta.(*Organization).client - + orgId := meta.(*Organization).id teamIdString := d.Get("team_id").(string) teamId, err := strconv.ParseInt(teamIdString, 10, 64) if err != nil { @@ -137,7 +140,7 @@ func resourceGithubTeamMembershipDelete(d *schema.ResourceData, meta interface{} ctx := context.WithValue(context.Background(), ctxId, d.Id()) log.Printf("[DEBUG] Deleting team membership: %s/%s", teamIdString, username) - _, err = client.Teams.RemoveTeamMembership(ctx, teamId, username) + _, err = client.Teams.RemoveTeamMembershipByID(ctx, orgId, teamId, username) return err } diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index 7a1db32a71..b462e73afd 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -97,6 +97,7 @@ func TestAccGithubTeamMembership_caseInsensitive(t *testing.T) { func testAccCheckGithubTeamMembershipDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*Organization).client + orgId := testAccProvider.Meta().(*Organization).id for _, rs := range s.RootModule().Resources { if rs.Type != "github_team_membership" { @@ -113,8 +114,8 @@ func testAccCheckGithubTeamMembershipDestroy(s *terraform.State) error { return unconvertibleIdErr(teamIdString, err) } - membership, resp, err := conn.Teams.GetTeamMembership(context.TODO(), - teamId, username) + membership, resp, err := conn.Teams.GetTeamMembershipByID(context.TODO(), + orgId, teamId, username) if err == nil { if membership != nil { return fmt.Errorf("Team membership still exists") @@ -140,6 +141,7 @@ func testAccCheckGithubTeamMembershipExists(n string, membership *github.Members } conn := testAccProvider.Meta().(*Organization).client + orgId := testAccProvider.Meta().(*Organization).id teamIdString, username, err := parseTwoPartID(rs.Primary.ID, "team_id", "username") if err != nil { return err @@ -150,7 +152,7 @@ func testAccCheckGithubTeamMembershipExists(n string, membership *github.Members return unconvertibleIdErr(teamIdString, err) } - teamMembership, _, err := conn.Teams.GetTeamMembership(context.TODO(), teamId, username) + teamMembership, _, err := conn.Teams.GetTeamMembershipByID(context.TODO(), orgId, teamId, username) if err != nil { return err @@ -172,6 +174,7 @@ func testAccCheckGithubTeamMembershipRoleState(n, expected string, membership *g } conn := testAccProvider.Meta().(*Organization).client + orgId := testAccProvider.Meta().(*Organization).id teamIdString, username, err := parseTwoPartID(rs.Primary.ID, "team_id", "username") if err != nil { return err @@ -181,8 +184,8 @@ func testAccCheckGithubTeamMembershipRoleState(n, expected string, membership *g return unconvertibleIdErr(teamIdString, err) } - teamMembership, _, err := conn.Teams.GetTeamMembership(context.TODO(), - teamId, username) + teamMembership, _, err := conn.Teams.GetTeamMembershipByID(context.TODO(), + orgId, teamId, username) if err != nil { return err } diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index 38234196a6..9bb52fba00 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_repository_test.go b/github/resource_github_team_repository_test.go index 3b15a251ee..f3a5c11407 100644 --- a/github/resource_github_team_repository_test.go +++ b/github/resource_github_team_repository_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_team_test.go b/github/resource_github_team_test.go index 93ba009c5c..fe07165414 100644 --- a/github/resource_github_team_test.go +++ b/github/resource_github_team_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index 750dec3e6a..4e4ac6ead1 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_user_gpg_key_test.go b/github/resource_github_user_gpg_key_test.go index 75ce8da49f..4f4b5d8652 100644 --- a/github/resource_github_user_gpg_key_test.go +++ b/github/resource_github_user_gpg_key_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index f61a85e908..6e3b1e6033 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_user_ssh_key_test.go b/github/resource_github_user_ssh_key_test.go index 59f974e877..d1147274e8 100644 --- a/github/resource_github_user_ssh_key_test.go +++ b/github/resource_github_user_ssh_key_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index 9195126d90..60feb9331f 100644 --- a/github/resource_organization_block.go +++ b/github/resource_organization_block.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 3397f9fee8..6a4fc2749d 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index b4291b84e9..9485eebeb5 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index 46ff71ae20..b6b7f7cfd6 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" ) const ( diff --git a/go.mod b/go.mod index 4f8d691ce0..9a42bc6896 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-github go 1.13 require ( - github.com/google/go-github/v29 v29.0.3 + github.com/google/go-github/v31 v31.0.0 github.com/hashicorp/terraform-plugin-sdk v1.7.0 github.com/kylelemons/godebug v1.1.0 golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d diff --git a/go.sum b/go.sum index ad5036228d..555d660088 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-github/v29 v29.0.3 h1:IktKCTwU//aFHnpA+2SLIi7Oo9uhAzgsdZNbcAqhgdc= -github.com/google/go-github/v29 v29.0.3/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E= +github.com/google/go-github/v31 v31.0.0 h1:JJUxlP9lFK+ziXKimTCprajMApV1ecWD4NB6CCb0plo= +github.com/google/go-github/v31 v31.0.0/go.mod h1:NQPZol8/1sMoWYGN2yaALIBytu17gAWfhbweiEed3pM= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= diff --git a/vendor/github.com/google/go-github/v29/github/admin_orgs.go b/vendor/github.com/google/go-github/v29/github/admin_orgs.go deleted file mode 100644 index f063831085..0000000000 --- a/vendor/github.com/google/go-github/v29/github/admin_orgs.go +++ /dev/null @@ -1,43 +0,0 @@ -// 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 -} diff --git a/vendor/github.com/google/go-github/v29/github/gen-accessors.go b/vendor/github.com/google/go-github/v29/github/gen-accessors.go deleted file mode 100644 index 4c5e8eec7e..0000000000 --- a/vendor/github.com/google/go-github/v29/github/gen-accessors.go +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2017 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. - -// +build ignore - -// gen-accessors generates accessor methods for structs with pointer fields. -// -// It is meant to be used by go-github contributors in conjunction with the -// go generate tool before sending a PR to GitHub. -// Please see the CONTRIBUTING.md file for more information. -package main - -import ( - "bytes" - "flag" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "log" - "os" - "sort" - "strings" - "text/template" -) - -const ( - fileSuffix = "-accessors.go" -) - -var ( - verbose = flag.Bool("v", false, "Print verbose log messages") - - sourceTmpl = template.Must(template.New("source").Parse(source)) - - // blacklistStructMethod lists "struct.method" combos to skip. - blacklistStructMethod = map[string]bool{ - "RepositoryContent.GetContent": true, - "Client.GetBaseURL": true, - "Client.GetUploadURL": true, - "ErrorResponse.GetResponse": true, - "RateLimitError.GetResponse": true, - "AbuseRateLimitError.GetResponse": true, - } - // blacklistStruct lists structs to skip. - blacklistStruct = map[string]bool{ - "Client": true, - } -) - -func logf(fmt string, args ...interface{}) { - if *verbose { - log.Printf(fmt, args...) - } -} - -func main() { - flag.Parse() - fset := token.NewFileSet() - - pkgs, err := parser.ParseDir(fset, ".", sourceFilter, 0) - if err != nil { - log.Fatal(err) - return - } - - for pkgName, pkg := range pkgs { - t := &templateData{ - filename: pkgName + fileSuffix, - Year: 2017, - Package: pkgName, - Imports: map[string]string{}, - } - for filename, f := range pkg.Files { - logf("Processing %v...", filename) - if err := t.processAST(f); err != nil { - log.Fatal(err) - } - } - if err := t.dump(); err != nil { - log.Fatal(err) - } - } - logf("Done.") -} - -func (t *templateData) processAST(f *ast.File) error { - for _, decl := range f.Decls { - gd, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - for _, spec := range gd.Specs { - ts, ok := spec.(*ast.TypeSpec) - if !ok { - continue - } - // Skip unexported identifiers. - if !ts.Name.IsExported() { - logf("Struct %v is unexported; skipping.", ts.Name) - continue - } - // Check if the struct is blacklisted. - if blacklistStruct[ts.Name.Name] { - logf("Struct %v is blacklisted; skipping.", ts.Name) - continue - } - st, ok := ts.Type.(*ast.StructType) - if !ok { - continue - } - for _, field := range st.Fields.List { - se, ok := field.Type.(*ast.StarExpr) - if len(field.Names) == 0 || !ok { - continue - } - - fieldName := field.Names[0] - // Skip unexported identifiers. - if !fieldName.IsExported() { - logf("Field %v is unexported; skipping.", fieldName) - continue - } - // Check if "struct.method" is blacklisted. - if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); blacklistStructMethod[key] { - logf("Method %v is blacklisted; skipping.", key) - continue - } - - switch x := se.X.(type) { - case *ast.ArrayType: - t.addArrayType(x, ts.Name.String(), fieldName.String()) - case *ast.Ident: - t.addIdent(x, ts.Name.String(), fieldName.String()) - case *ast.MapType: - t.addMapType(x, ts.Name.String(), fieldName.String()) - case *ast.SelectorExpr: - t.addSelectorExpr(x, ts.Name.String(), fieldName.String()) - default: - logf("processAST: type %q, field %q, unknown %T: %+v", ts.Name, fieldName, x, x) - } - } - } - } - return nil -} - -func sourceFilter(fi os.FileInfo) bool { - return !strings.HasSuffix(fi.Name(), "_test.go") && !strings.HasSuffix(fi.Name(), fileSuffix) -} - -func (t *templateData) dump() error { - if len(t.Getters) == 0 { - logf("No getters for %v; skipping.", t.filename) - return nil - } - - // Sort getters by ReceiverType.FieldName. - sort.Sort(byName(t.Getters)) - - var buf bytes.Buffer - if err := sourceTmpl.Execute(&buf, t); err != nil { - return err - } - clean, err := format.Source(buf.Bytes()) - if err != nil { - return err - } - - logf("Writing %v...", t.filename) - return ioutil.WriteFile(t.filename, clean, 0644) -} - -func newGetter(receiverType, fieldName, fieldType, zeroValue string, namedStruct bool) *getter { - return &getter{ - sortVal: strings.ToLower(receiverType) + "." + strings.ToLower(fieldName), - ReceiverVar: strings.ToLower(receiverType[:1]), - ReceiverType: receiverType, - FieldName: fieldName, - FieldType: fieldType, - ZeroValue: zeroValue, - NamedStruct: namedStruct, - } -} - -func (t *templateData) addArrayType(x *ast.ArrayType, receiverType, fieldName string) { - var eltType string - switch elt := x.Elt.(type) { - case *ast.Ident: - eltType = elt.String() - default: - logf("addArrayType: type %q, field %q: unknown elt type: %T %+v; skipping.", receiverType, fieldName, elt, elt) - return - } - - t.Getters = append(t.Getters, newGetter(receiverType, fieldName, "[]"+eltType, "nil", false)) -} - -func (t *templateData) addIdent(x *ast.Ident, receiverType, fieldName string) { - var zeroValue string - var namedStruct = false - switch x.String() { - case "int", "int64": - zeroValue = "0" - case "string": - zeroValue = `""` - case "bool": - zeroValue = "false" - case "Timestamp": - zeroValue = "Timestamp{}" - default: - zeroValue = "nil" - namedStruct = true - } - - t.Getters = append(t.Getters, newGetter(receiverType, fieldName, x.String(), zeroValue, namedStruct)) -} - -func (t *templateData) addMapType(x *ast.MapType, receiverType, fieldName string) { - var keyType string - switch key := x.Key.(type) { - case *ast.Ident: - keyType = key.String() - default: - logf("addMapType: type %q, field %q: unknown key type: %T %+v; skipping.", receiverType, fieldName, key, key) - return - } - - var valueType string - switch value := x.Value.(type) { - case *ast.Ident: - valueType = value.String() - default: - logf("addMapType: type %q, field %q: unknown value type: %T %+v; skipping.", receiverType, fieldName, value, value) - return - } - - fieldType := fmt.Sprintf("map[%v]%v", keyType, valueType) - zeroValue := fmt.Sprintf("map[%v]%v{}", keyType, valueType) - t.Getters = append(t.Getters, newGetter(receiverType, fieldName, fieldType, zeroValue, false)) -} - -func (t *templateData) addSelectorExpr(x *ast.SelectorExpr, receiverType, fieldName string) { - if strings.ToLower(fieldName[:1]) == fieldName[:1] { // Non-exported field. - return - } - - var xX string - if xx, ok := x.X.(*ast.Ident); ok { - xX = xx.String() - } - - switch xX { - case "time", "json": - if xX == "json" { - t.Imports["encoding/json"] = "encoding/json" - } else { - t.Imports[xX] = xX - } - fieldType := fmt.Sprintf("%v.%v", xX, x.Sel.Name) - zeroValue := fmt.Sprintf("%v.%v{}", xX, x.Sel.Name) - if xX == "time" && x.Sel.Name == "Duration" { - zeroValue = "0" - } - t.Getters = append(t.Getters, newGetter(receiverType, fieldName, fieldType, zeroValue, false)) - default: - logf("addSelectorExpr: xX %q, type %q, field %q: unknown x=%+v; skipping.", xX, receiverType, fieldName, x) - } -} - -type templateData struct { - filename string - Year int - Package string - Imports map[string]string - Getters []*getter -} - -type getter struct { - sortVal string // Lower-case version of "ReceiverType.FieldName". - ReceiverVar string // The one-letter variable name to match the ReceiverType. - ReceiverType string - FieldName string - FieldType string - ZeroValue string - NamedStruct bool // Getter for named struct. -} - -type byName []*getter - -func (b byName) Len() int { return len(b) } -func (b byName) Less(i, j int) bool { return b[i].sortVal < b[j].sortVal } -func (b byName) Swap(i, j int) { b[i], b[j] = b[j], b[i] } - -const source = `// Copyright {{.Year}} 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. - -// Code generated by gen-accessors; DO NOT EDIT. - -package {{.Package}} -{{with .Imports}} -import ( - {{- range . -}} - "{{.}}" - {{end -}} -) -{{end}} -{{range .Getters}} -{{if .NamedStruct}} -// Get{{.FieldName}} returns the {{.FieldName}} field. -func ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() *{{.FieldType}} { - if {{.ReceiverVar}} == nil { - return {{.ZeroValue}} - } - return {{.ReceiverVar}}.{{.FieldName}} -} -{{else}} -// Get{{.FieldName}} returns the {{.FieldName}} field if it's non-nil, zero value otherwise. -func ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() {{.FieldType}} { - if {{.ReceiverVar}} == nil || {{.ReceiverVar}}.{{.FieldName}} == nil { - return {{.ZeroValue}} - } - return *{{.ReceiverVar}}.{{.FieldName}} -} -{{end}} -{{end}} -` diff --git a/vendor/github.com/google/go-github/v29/github/gen-stringify-test.go b/vendor/github.com/google/go-github/v29/github/gen-stringify-test.go deleted file mode 100644 index 7803801e63..0000000000 --- a/vendor/github.com/google/go-github/v29/github/gen-stringify-test.go +++ /dev/null @@ -1,358 +0,0 @@ -// 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. - -// +build ignore - -// gen-stringify-test generates test methods to test the String methods. -// -// These tests eliminate most of the code coverage problems so that real -// code coverage issues can be more readily identified. -// -// It is meant to be used by go-github contributors in conjunction with the -// go generate tool before sending a PR to GitHub. -// Please see the CONTRIBUTING.md file for more information. -package main - -import ( - "bytes" - "flag" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "log" - "os" - "strings" - "text/template" -) - -const ( - ignoreFilePrefix1 = "gen-" - ignoreFilePrefix2 = "github-" - outputFileSuffix = "-stringify_test.go" -) - -var ( - verbose = flag.Bool("v", false, "Print verbose log messages") - - // blacklistStructMethod lists "struct.method" combos to skip. - blacklistStructMethod = map[string]bool{} - // blacklistStruct lists structs to skip. - blacklistStruct = map[string]bool{ - "RateLimits": true, - } - - funcMap = template.FuncMap{ - "isNotLast": func(index int, slice []*structField) string { - if index+1 < len(slice) { - return ", " - } - return "" - }, - "processZeroValue": func(v string) string { - switch v { - case "Bool(false)": - return "false" - case "Float64(0.0)": - return "0" - case "0", "Int(0)", "Int64(0)": - return "0" - case `""`, `String("")`: - return `""` - case "Timestamp{}", "&Timestamp{}": - return "github.Timestamp{0001-01-01 00:00:00 +0000 UTC}" - case "nil": - return "map[]" - } - log.Fatalf("Unhandled zero value: %q", v) - return "" - }, - } - - sourceTmpl = template.Must(template.New("source").Funcs(funcMap).Parse(source)) -) - -func main() { - flag.Parse() - fset := token.NewFileSet() - - pkgs, err := parser.ParseDir(fset, ".", sourceFilter, 0) - if err != nil { - log.Fatal(err) - return - } - - for pkgName, pkg := range pkgs { - t := &templateData{ - filename: pkgName + outputFileSuffix, - Year: 2019, // No need to change this once set (even in following years). - Package: pkgName, - Imports: map[string]string{"testing": "testing"}, - StringFuncs: map[string]bool{}, - StructFields: map[string][]*structField{}, - } - for filename, f := range pkg.Files { - logf("Processing %v...", filename) - if err := t.processAST(f); err != nil { - log.Fatal(err) - } - } - if err := t.dump(); err != nil { - log.Fatal(err) - } - } - logf("Done.") -} - -func sourceFilter(fi os.FileInfo) bool { - return !strings.HasSuffix(fi.Name(), "_test.go") && - !strings.HasPrefix(fi.Name(), ignoreFilePrefix1) && - !strings.HasPrefix(fi.Name(), ignoreFilePrefix2) -} - -type templateData struct { - filename string - Year int - Package string - Imports map[string]string - StringFuncs map[string]bool - StructFields map[string][]*structField -} - -type structField struct { - sortVal string // Lower-case version of "ReceiverType.FieldName". - ReceiverVar string // The one-letter variable name to match the ReceiverType. - ReceiverType string - FieldName string - FieldType string - ZeroValue string - NamedStruct bool // Getter for named struct. -} - -func (t *templateData) processAST(f *ast.File) error { - for _, decl := range f.Decls { - fn, ok := decl.(*ast.FuncDecl) - if ok { - if fn.Recv != nil && len(fn.Recv.List) > 0 { - id, ok := fn.Recv.List[0].Type.(*ast.Ident) - if ok && fn.Name.Name == "String" { - logf("Got FuncDecl: Name=%q, id.Name=%#v", fn.Name.Name, id.Name) - t.StringFuncs[id.Name] = true - } else { - logf("Ignoring FuncDecl: Name=%q, Type=%T", fn.Name.Name, fn.Recv.List[0].Type) - } - } else { - logf("Ignoring FuncDecl: Name=%q, fn=%#v", fn.Name.Name, fn) - } - continue - } - - gd, ok := decl.(*ast.GenDecl) - if !ok { - logf("Ignoring AST decl type %T", decl) - continue - } - for _, spec := range gd.Specs { - ts, ok := spec.(*ast.TypeSpec) - if !ok { - continue - } - // Skip unexported identifiers. - if !ts.Name.IsExported() { - logf("Struct %v is unexported; skipping.", ts.Name) - continue - } - // Check if the struct is blacklisted. - if blacklistStruct[ts.Name.Name] { - logf("Struct %v is blacklisted; skipping.", ts.Name) - continue - } - st, ok := ts.Type.(*ast.StructType) - if !ok { - logf("Ignoring AST type %T, Name=%q", ts.Type, ts.Name.String()) - continue - } - for _, field := range st.Fields.List { - if len(field.Names) == 0 { - continue - } - - fieldName := field.Names[0] - if id, ok := field.Type.(*ast.Ident); ok { - t.addIdent(id, ts.Name.String(), fieldName.String()) - continue - } - - if _, ok := field.Type.(*ast.MapType); ok { - t.addMapType(ts.Name.String(), fieldName.String()) - continue - } - - se, ok := field.Type.(*ast.StarExpr) - if !ok { - logf("Ignoring type %T for Name=%q, FieldName=%q", field.Type, ts.Name.String(), fieldName.String()) - continue - } - - // Skip unexported identifiers. - if !fieldName.IsExported() { - logf("Field %v is unexported; skipping.", fieldName) - continue - } - // Check if "struct.method" is blacklisted. - if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); blacklistStructMethod[key] { - logf("Method %v is blacklisted; skipping.", key) - continue - } - - switch x := se.X.(type) { - case *ast.ArrayType: - case *ast.Ident: - t.addIdentPtr(x, ts.Name.String(), fieldName.String()) - case *ast.MapType: - case *ast.SelectorExpr: - default: - logf("processAST: type %q, field %q, unknown %T: %+v", ts.Name, fieldName, x, x) - } - } - } - } - return nil -} - -func (t *templateData) addMapType(receiverType, fieldName string) { - t.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, "map[]", "nil", false)) -} - -func (t *templateData) addIdent(x *ast.Ident, receiverType, fieldName string) { - var zeroValue string - var namedStruct = false - switch x.String() { - case "int": - zeroValue = "0" - case "int64": - zeroValue = "0" - case "float64": - zeroValue = "0.0" - case "string": - zeroValue = `""` - case "bool": - zeroValue = "false" - case "Timestamp": - zeroValue = "Timestamp{}" - default: - zeroValue = "nil" - namedStruct = true - } - - t.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, x.String(), zeroValue, namedStruct)) -} - -func (t *templateData) addIdentPtr(x *ast.Ident, receiverType, fieldName string) { - var zeroValue string - var namedStruct = false - switch x.String() { - case "int": - zeroValue = "Int(0)" - case "int64": - zeroValue = "Int64(0)" - case "float64": - zeroValue = "Float64(0.0)" - case "string": - zeroValue = `String("")` - case "bool": - zeroValue = "Bool(false)" - case "Timestamp": - zeroValue = "&Timestamp{}" - default: - zeroValue = "nil" - namedStruct = true - } - - t.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, x.String(), zeroValue, namedStruct)) -} - -func (t *templateData) dump() error { - if len(t.StructFields) == 0 { - logf("No StructFields for %v; skipping.", t.filename) - return nil - } - - // Remove unused structs. - var toDelete []string - for k := range t.StructFields { - if !t.StringFuncs[k] { - toDelete = append(toDelete, k) - continue - } - } - for _, k := range toDelete { - delete(t.StructFields, k) - } - - var buf bytes.Buffer - if err := sourceTmpl.Execute(&buf, t); err != nil { - return err - } - clean, err := format.Source(buf.Bytes()) - if err != nil { - log.Printf("failed-to-format source:\n%v", buf.String()) - return err - } - - logf("Writing %v...", t.filename) - return ioutil.WriteFile(t.filename, clean, 0644) -} - -func newStructField(receiverType, fieldName, fieldType, zeroValue string, namedStruct bool) *structField { - return &structField{ - sortVal: strings.ToLower(receiverType) + "." + strings.ToLower(fieldName), - ReceiverVar: strings.ToLower(receiverType[:1]), - ReceiverType: receiverType, - FieldName: fieldName, - FieldType: fieldType, - ZeroValue: zeroValue, - NamedStruct: namedStruct, - } -} - -func logf(fmt string, args ...interface{}) { - if *verbose { - log.Printf(fmt, args...) - } -} - -const source = `// Copyright {{.Year}} 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. - -// Code generated by gen-stringify-tests; DO NOT EDIT. - -package {{ $package := .Package}}{{$package}} -{{with .Imports}} -import ( - {{- range . -}} - "{{.}}" - {{end -}} -) -{{end}} -func Float64(v float64) *float64 { return &v } -{{range $key, $value := .StructFields}} -func Test{{ $key }}_String(t *testing.T) { - v := {{ $key }}{ {{range .}}{{if .NamedStruct}} - {{ .FieldName }}: &{{ .FieldType }}{},{{else}} - {{ .FieldName }}: {{.ZeroValue}},{{end}}{{end}} - } - want := ` + "`" + `{{ $package }}.{{ $key }}{{ $slice := . }}{ -{{- range $ind, $val := .}}{{if .NamedStruct}}{{ .FieldName }}:{{ $package }}.{{ .FieldType }}{}{{else}}{{ .FieldName }}:{{ processZeroValue .ZeroValue }}{{end}}{{ isNotLast $ind $slice }}{{end}}}` + "`" + ` - if got := v.String(); got != want { - t.Errorf("{{ $key }}.String = %v, want %v", got, want) - } -} -{{end}} -` diff --git a/vendor/github.com/google/go-github/v29/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v29/github/teams_discussion_comments.go deleted file mode 100644 index ff871f22be..0000000000 --- a/vendor/github.com/google/go-github/v29/github/teams_discussion_comments.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2018 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" - "fmt" -) - -// DiscussionComment represents a GitHub dicussion in a team. -type DiscussionComment struct { - Author *User `json:"author,omitempty"` - Body *string `json:"body,omitempty"` - BodyHTML *string `json:"body_html,omitempty"` - BodyVersion *string `json:"body_version,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - LastEditedAt *Timestamp `json:"last_edited_at,omitempty"` - DiscussionURL *string `json:"discussion_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Number *int `json:"number,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - URL *string `json:"url,omitempty"` - Reactions *Reactions `json:"reactions,omitempty"` -} - -func (c DiscussionComment) String() string { - return Stringify(c) -} - -// DiscussionCommentListOptions specifies optional parameters to the -// TeamServices.ListComments method. -type DiscussionCommentListOptions struct { - // Sorts the discussion comments by the date they were created. - // Accepted values are asc and desc. Default is desc. - Direction string `url:"direction,omitempty"` -} - -// ListComments lists all comments on a team discussion. -// Authenticated user must grant read:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#list-comments -func (s *TeamsService) ListComments(ctx context.Context, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments", teamID, discussionNumber) - u, err := addOptions(u, options) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var comments []*DiscussionComment - resp, err := s.client.Do(ctx, req, &comments) - if err != nil { - return nil, resp, err - } - - return comments, resp, nil -} - -// GetComment gets a specific comment on a team discussion. -// Authenticated user must grant read:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment -func (s *TeamsService) GetComment(ctx context.Context, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v", teamID, discussionNumber, commentNumber) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) - if err != nil { - return nil, resp, err - } - - return discussionComment, resp, nil -} - -// CreateComment creates a new discussion post on a team discussion. -// Authenticated user must grant write:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#create-a-comment -func (s *TeamsService) CreateComment(ctx context.Context, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments", teamID, discsusionNumber) - req, err := s.client.NewRequest("POST", u, comment) - if err != nil { - return nil, nil, err - } - - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) - if err != nil { - return nil, resp, err - } - - return discussionComment, resp, nil -} - -// EditComment edits the body text of a discussion comment. -// Authenticated user must grant write:discussion scope. -// User is allowed to edit body of a comment only. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment -func (s *TeamsService) EditComment(ctx context.Context, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v", teamID, discussionNumber, commentNumber) - req, err := s.client.NewRequest("PATCH", u, comment) - if err != nil { - return nil, nil, err - } - - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) - if err != nil { - return nil, resp, err - } - - return discussionComment, resp, nil -} - -// DeleteComment deletes a comment on a team discussion. -// Authenticated user must grant write:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment -func (s *TeamsService) DeleteComment(ctx context.Context, teamID int64, discussionNumber, commentNumber int) (*Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v", teamID, discussionNumber, commentNumber) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v29/github/teams_discussions.go b/vendor/github.com/google/go-github/v29/github/teams_discussions.go deleted file mode 100644 index 433d01595a..0000000000 --- a/vendor/github.com/google/go-github/v29/github/teams_discussions.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2018 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" - "fmt" -) - -// TeamDiscussion represents a GitHub dicussion in a team. -type TeamDiscussion struct { - Author *User `json:"author,omitempty"` - Body *string `json:"body,omitempty"` - BodyHTML *string `json:"body_html,omitempty"` - BodyVersion *string `json:"body_version,omitempty"` - CommentsCount *int `json:"comments_count,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - LastEditedAt *Timestamp `json:"last_edited_at,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Number *int `json:"number,omitempty"` - Pinned *bool `json:"pinned,omitempty"` - Private *bool `json:"private,omitempty"` - TeamURL *string `json:"team_url,omitempty"` - Title *string `json:"title,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - URL *string `json:"url,omitempty"` - Reactions *Reactions `json:"reactions,omitempty"` -} - -func (d TeamDiscussion) String() string { - return Stringify(d) -} - -// DiscussionListOptions specifies optional parameters to the -// TeamServices.ListDiscussions method. -type DiscussionListOptions struct { - // Sorts the discussion by the date they were created. - // Accepted values are asc and desc. Default is desc. - Direction string `url:"direction,omitempty"` -} - -// ListDiscussions lists all discussions on team's page. -// Authenticated user must grant read:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussions/#list-discussions -func (s *TeamsService) ListDiscussions(ctx context.Context, teamID int64, options *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions", teamID) - u, err := addOptions(u, options) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var teamDiscussions []*TeamDiscussion - resp, err := s.client.Do(ctx, req, &teamDiscussions) - if err != nil { - return nil, resp, err - } - - return teamDiscussions, resp, nil -} - -// GetDiscussion gets a specific discussion on a team's page. -// Authenticated user must grant read:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussions/#get-a-single-discussion -func (s *TeamsService) GetDiscussion(ctx context.Context, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v", teamID, discussionNumber) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) - if err != nil { - return nil, resp, err - } - - return teamDiscussion, resp, nil -} - -// CreateDiscussion creates a new discussion post on a team's page. -// Authenticated user must grant write:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussions/#create-a-discussion -func (s *TeamsService) CreateDiscussion(ctx context.Context, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions", teamID) - req, err := s.client.NewRequest("POST", u, discussion) - if err != nil { - return nil, nil, err - } - - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) - if err != nil { - return nil, resp, err - } - - return teamDiscussion, resp, nil -} - -// EditDiscussion edits the title and body text of a discussion post. -// Authenticated user must grant write:discussion scope. -// User is allowed to change Title and Body of a discussion only. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussions/#edit-a-discussion -func (s *TeamsService) EditDiscussion(ctx context.Context, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v", teamID, discussionNumber) - req, err := s.client.NewRequest("PATCH", u, discussion) - if err != nil { - return nil, nil, err - } - - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) - if err != nil { - return nil, resp, err - } - - return teamDiscussion, resp, nil -} - -// DeleteDiscussion deletes a discussion from team's page. -// Authenticated user must grant write:discussion scope. -// -// GitHub API docs: https://developer.github.com/v3/teams/discussions/#delete-a-discussion -func (s *TeamsService) DeleteDiscussion(ctx context.Context, teamID int64, discussionNumber int) (*Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v", teamID, discussionNumber) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v29/github/teams_members.go b/vendor/github.com/google/go-github/v29/github/teams_members.go deleted file mode 100644 index 36ca74353b..0000000000 --- a/vendor/github.com/google/go-github/v29/github/teams_members.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2018 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" - "fmt" -) - -// TeamListTeamMembersOptions specifies the optional parameters to the -// TeamsService.ListTeamMembers method. -type TeamListTeamMembersOptions struct { - // Role filters members returned by their role in the team. Possible - // values are "all", "member", "maintainer". Default is "all". - Role string `url:"role,omitempty"` - - ListOptions -} - -// ListTeamMembers lists all of the users who are members of the specified -// team. -// -// GitHub API docs: https://developer.github.com/v3/teams/members/#list-team-members -func (s *TeamsService) ListTeamMembers(ctx context.Context, team int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { - u := fmt.Sprintf("teams/%v/members", team) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var members []*User - resp, err := s.client.Do(ctx, req, &members) - if err != nil { - return nil, resp, err - } - - return members, resp, nil -} - -// IsTeamMember checks if a user is a member of the specified team. -// -// GitHub API docs: https://developer.github.com/v3/teams/members/#get-team-member -// -// Deprecated: This API has been marked as deprecated in the Github API docs, -// TeamsService.GetTeamMembership method should be used instead. -func (s *TeamsService) IsTeamMember(ctx context.Context, team int64, user string) (bool, *Response, error) { - u := fmt.Sprintf("teams/%v/members/%v", team, user) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return false, nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - member, err := parseBoolResponse(err) - return member, resp, err -} - -// GetTeamMembership returns the membership status for a user in a team. -// -// GitHub API docs: https://developer.github.com/v3/teams/members/#get-team-membership -func (s *TeamsService) GetTeamMembership(ctx context.Context, team int64, user string) (*Membership, *Response, error) { - u := fmt.Sprintf("teams/%v/memberships/%v", team, user) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// TeamAddTeamMembershipOptions specifies the optional -// parameters to the TeamsService.AddTeamMembership method. -type TeamAddTeamMembershipOptions struct { - // Role specifies the role the user should have in the team. Possible - // values are: - // member - a normal member of the team - // maintainer - a team maintainer. Able to add/remove other team - // members, promote other team members to team - // maintainer, and edit the team’s name and description - // - // Default value is "member". - Role string `json:"role,omitempty"` -} - -// AddTeamMembership adds or invites a user to a team. -// -// In order to add a membership between a user and a team, the authenticated -// user must have 'admin' permissions to the team or be an owner of the -// organization that the team is associated with. -// -// If the user is already a part of the team's organization (meaning they're on -// at least one other team in the organization), this endpoint will add the -// user to the team. -// -// If the user is completely unaffiliated with the team's organization (meaning -// they're on none of the organization's teams), this endpoint will send an -// invitation to the user via email. This newly-created membership will be in -// the "pending" state until the user accepts the invitation, at which point -// the membership will transition to the "active" state and the user will be -// added as a member of the team. -// -// GitHub API docs: https://developer.github.com/v3/teams/members/#add-or-update-team-membership -func (s *TeamsService) AddTeamMembership(ctx context.Context, team int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { - u := fmt.Sprintf("teams/%v/memberships/%v", team, user) - req, err := s.client.NewRequest("PUT", u, opts) - if err != nil { - return nil, nil, err - } - - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil -} - -// RemoveTeamMembership removes a user from a team. -// -// GitHub API docs: https://developer.github.com/v3/teams/members/#remove-team-membership -func (s *TeamsService) RemoveTeamMembership(ctx context.Context, team int64, user string) (*Response, error) { - u := fmt.Sprintf("teams/%v/memberships/%v", team, user) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// ListPendingTeamInvitations get pending invitaion list in team. -// Warning: The API may change without advance notice during the preview period. -// Preview features are not supported for production use. -// -// GitHub API docs: https://developer.github.com/v3/teams/members/#list-pending-team-invitations -func (s *TeamsService) ListPendingTeamInvitations(ctx context.Context, team int64, opts *ListOptions) ([]*Invitation, *Response, error) { - u := fmt.Sprintf("teams/%v/invitations", team) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var pendingInvitations []*Invitation - resp, err := s.client.Do(ctx, req, &pendingInvitations) - if err != nil { - return nil, resp, err - } - - return pendingInvitations, resp, nil -} diff --git a/vendor/github.com/google/go-github/v29/AUTHORS b/vendor/github.com/google/go-github/v31/AUTHORS similarity index 95% rename from vendor/github.com/google/go-github/v29/AUTHORS rename to vendor/github.com/google/go-github/v31/AUTHORS index 91ef2d84a2..4dd8d21b80 100644 --- a/vendor/github.com/google/go-github/v29/AUTHORS +++ b/vendor/github.com/google/go-github/v31/AUTHORS @@ -20,9 +20,11 @@ Akhil Mohan Alec Thomas Aleks Clark Alex Bramley +Alex Orr Alexander Harkness Allen Sun Amey Sakhadeo +Anders Janmyr Andreas Garnæs Andrew Ryabchun Andy Grunwald @@ -51,6 +53,7 @@ Brandon Cook Brian Egizi Bryan Boreham Cami Diez +Carl Johnson Carlos Alexandro Becker Carlos Tadeu Panato Junior chandresh-pancholi @@ -148,8 +151,8 @@ Junya Kono Justin Abrahms Jusung Lee jzhoucliqr +kadern0 Katrina Owen -Kautilya Tripathi < tripathi.kautilya@gmail.com> Kautilya Tripathi Keita Urashima Kevin Burke @@ -166,9 +169,11 @@ Luke Evers Luke Kysow Luke Roberts Luke Young +lynn [they] Maksim Zhylinski Mark Tareshawty Martin-Louis Bright +Martins Sipenko Marwan Sulaiman Masayuki Izumi Mat Geist @@ -189,19 +194,22 @@ Nick Spragg Nikhita Raghunath Noah Zoschke ns-cweber -Oleg Kovalov Ole Orhagen +Oleg Kovalov Ondřej Kupka Palash Nigam Panagiotis Moustafellos Parham Alvani Parker Moore parkhyukjun89 +Patrick DeVivo +Patrick Marabeas Pavel Shtanko Pete Wagner Petr Shevtsov Pierre Carrier Piotr Zurek +Qais Patankar Quang Le Hong Quentin Leffray Quinn Slack @@ -211,6 +219,7 @@ Radliński Ignacy Rajat Jindal Rajendra arora Ranbir Singh +Ravi Shekhar Jethani RaviTeja Pothana rc1140 Red Hat, Inc. @@ -221,6 +230,7 @@ Ronak Jain Ruben Vereecken Ryan Leung Ryan Lower +Ryo Nakao Safwan Olaimat Sahil Dua saisi @@ -246,6 +256,7 @@ sona-tar SoundCloud, Ltd. Sridhar Mocherla SriVignessh Pss +Stefan Sedich Stian Eikeland Suhaib Mujahid Szymon Kodrebski @@ -261,6 +272,7 @@ Vaibhav Singh Varadarajan Aravamudhan Victor Castell Victor Vrantchan +vikkyomkar Vlad Ungureanu Wasim Thabraze Will Maier diff --git a/vendor/github.com/google/go-github/v29/LICENSE b/vendor/github.com/google/go-github/v31/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v29/LICENSE rename to vendor/github.com/google/go-github/v31/LICENSE diff --git a/vendor/github.com/google/go-github/v29/github/actions.go b/vendor/github.com/google/go-github/v31/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/actions.go rename to vendor/github.com/google/go-github/v31/github/actions.go diff --git a/vendor/github.com/google/go-github/v31/github/actions_artifacts.go b/vendor/github.com/google/go-github/v31/github/actions_artifacts.go new file mode 100644 index 0000000000..1735849584 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/actions_artifacts.go @@ -0,0 +1,140 @@ +// Copyright 2020 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" + "fmt" + "net/http" + "net/url" +) + +// Artifact reprents a GitHub artifact. Artifacts allow sharing +// data between jobs in a workflow and provide storage for data +// once a workflow is complete. +// +// GitHub API docs: https://developer.github.com/v3/actions/artifacts/ +type Artifact struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + SizeInBytes *int64 `json:"size_in_bytes,omitempty"` + ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` + Expired *bool `json:"expired,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` +} + +// ArtifactList represents a list of GitHub artifacts. +// +// GitHub API docs: https://developer.github.com/v3/actions/artifacts/ +type ArtifactList struct { + TotalCount *int64 `json:"total_count,omitempty"` + Artifacts []*Artifact `json:"artifacts,omitempty"` +} + +// ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. +// +// GitHub API docs: https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts +func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/artifacts", owner, repo, runID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + artifactList := new(ArtifactList) + resp, err := s.client.Do(ctx, req, artifactList) + if err != nil { + return nil, resp, err + } + + return artifactList, resp, nil +} + +// GetArtifact gets a specific artifact for a workflow run. +// +// GitHub API docs: https://developer.github.com/v3/actions/artifacts/#get-an-artifact +func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + artifact := new(Artifact) + resp, err := s.client.Do(ctx, req, artifact) + if err != nil { + return nil, resp, err + } + + return artifact, resp, nil +} + +// DownloadArtifact gets a redirect URL to download an archive for a repository. +// +// GitHub API docs: https://developer.github.com/v3/actions/artifacts/#download-an-artifact +func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) + + resp, err := s.getDownloadArtifactFromURL(ctx, u, followRedirects) + if err != nil { + return nil, nil, err + } + + if resp.StatusCode != http.StatusFound { + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + } + parsedURL, err := url.Parse(resp.Header.Get("Location")) + return parsedURL, newResponse(resp), nil +} + +func (s *ActionsService) getDownloadArtifactFromURL(ctx context.Context, u string, followRedirects bool) (*http.Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, err + } + + var resp *http.Response + // Use http.DefaultTransport if no custom Transport is configured + req = withContext(ctx, req) + if s.client.client.Transport == nil { + resp, err = http.DefaultTransport.RoundTrip(req) + } else { + resp, err = s.client.client.Transport.RoundTrip(req) + } + if err != nil { + return nil, err + } + resp.Body.Close() + + // If redirect response is returned, follow it + if followRedirects && resp.StatusCode == http.StatusMovedPermanently { + u = resp.Header.Get("Location") + resp, err = s.getDownloadArtifactFromURL(ctx, u, false) + } + return resp, err +} + +// DeleteArtifact deletes a workflow run artifact. +// +// GitHub API docs: https://developer.github.com/v3/actions/artifacts/#delete-an-artifact +func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v31/github/actions_runners.go b/vendor/github.com/google/go-github/v31/github/actions_runners.go new file mode 100644 index 0000000000..24f88f0f99 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/actions_runners.go @@ -0,0 +1,161 @@ +// Copyright 2020 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" + "fmt" +) + +// RunnerApplicationDownload represents a binary for the self-hosted runner application that can be downloaded. +type RunnerApplicationDownload struct { + OS *string `json:"os,omitempty"` + Architecture *string `json:"architecture,omitempty"` + DownloadURL *string `json:"download_url,omitempty"` + Filename *string `json:"filename,omitempty"` +} + +// ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. +// +// GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#list-downloads-for-the-self-hosted-runner-application +func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rads []*RunnerApplicationDownload + resp, err := s.client.Do(ctx, req, &rads) + if err != nil { + return nil, resp, err + } + + return rads, resp, nil +} + +// RegistrationToken represents a token that can be used to add a self-hosted runner to a repository. +type RegistrationToken struct { + Token *string `json:"token,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` +} + +// CreateRegistrationToken creates a token that can be used to add a self-hosted runner. +// +// GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#create-a-registration-token +func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, nil, err + } + + registrationToken := new(RegistrationToken) + resp, err := s.client.Do(ctx, req, registrationToken) + if err != nil { + return nil, resp, err + } + + return registrationToken, resp, nil +} + +// Runner represents a self-hosted runner registered with a repository. +type Runner struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + OS *string `json:"os,omitempty"` + Status *string `json:"status,omitempty"` +} + +// Runners represents a collection of self-hosted runners for a repository. +type Runners struct { + TotalCount int `json:"total_count"` + Runners []*Runner `json:"runners"` +} + +// ListRunners lists all the self-hosted runners for a repository. +// +// GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#list-self-hosted-runners-for-a-repository +func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runners := &Runners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// GetRunner gets a specific self-hosted runner for a repository using its runner ID. +// +// GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#get-a-self-hosted-runner +func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runner := new(Runner) + resp, err := s.client.Do(ctx, req, runner) + if err != nil { + return nil, resp, err + } + + return runner, resp, nil +} + +// RemoveToken represents a token that can be used to remove a self-hosted runner from a repository. +type RemoveToken struct { + Token *string `json:"token,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` +} + +// CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. +// +// GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#create-a-remove-token +func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, nil, err + } + + removeToken := new(RemoveToken) + resp, err := s.client.Do(ctx, req, removeToken) + if err != nil { + return nil, resp, err + } + + return removeToken, resp, nil +} + +// RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. +// +// GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#remove-a-self-hosted-runner +func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v29/github/actions_secrets.go b/vendor/github.com/google/go-github/v31/github/actions_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/actions_secrets.go rename to vendor/github.com/google/go-github/v31/github/actions_secrets.go diff --git a/vendor/github.com/google/go-github/v31/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v31/github/actions_workflow_jobs.go new file mode 100644 index 0000000000..0838ce48d7 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/actions_workflow_jobs.go @@ -0,0 +1,149 @@ +// Copyright 2020 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" + "fmt" + "net/http" + "net/url" +) + +// TaskStep represents a single task step from a sequence of tasks of a job. +type TaskStep struct { + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + Number *int64 `json:"number,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + CompletedAt *Timestamp `json:"completed_at,omitempty"` +} + +// WorkflowJob represents a repository action workflow job. +type WorkflowJob struct { + ID *int64 `json:"id,omitempty"` + RunID *int64 `json:"run_id,omitempty"` + RunURL *string `json:"run_url,omitempty"` + NodeID *string `json:"node_id,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + Status *string `json:"status,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + CompletedAt *Timestamp `json:"completed_at,omitempty"` + Name *string `json:"name,omitempty"` + Steps []*TaskStep `json:"steps,omitempty"` + CheckRunURL *string `json:"check_run_url,omitempty"` +} + +// Jobs represents a slice of repository action workflow job. +type Jobs struct { + TotalCount *int `json:"total_count,omitempty"` + Jobs []*WorkflowJob `json:"jobs,omitempty"` +} + +// ListWorkflowJobsOptions specifies optional parameters to ListWorkflowJobs. +type ListWorkflowJobsOptions struct { + // Filter specifies how jobs should be filtered by their completed_at timestamp. + // Possible values are: + // latest - Returns jobs from the most recent execution of the workflow run + // all - Returns all jobs for a workflow run, including from old executions of the workflow run + // + // Default value is "latest". + Filter string `url:"filter,omitempty"` + ListOptions +} + +// ListWorkflowJobs lists all jobs for a workflow run. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_jobs/#list-jobs-for-a-workflow-run +func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/jobs", owner, repo, runID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + jobs := new(Jobs) + resp, err := s.client.Do(ctx, req, &jobs) + if err != nil { + return nil, resp, err + } + + return jobs, resp, nil +} + +// GetWorkflowJobByID gets a specific job in a workflow run by ID. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_jobs/#get-a-workflow-job +func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + job := new(WorkflowJob) + resp, err := s.client.Do(ctx, req, job) + if err != nil { + return nil, resp, err + } + + return job, resp, nil +} + +// GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_jobs/#list-workflow-job-logs +func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, followRedirects bool) (*url.URL, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) + + resp, err := s.getWorkflowLogsFromURL(ctx, u, followRedirects) + if err != nil { + return nil, nil, err + } + + if resp.StatusCode != http.StatusFound { + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + } + parsedURL, err := url.Parse(resp.Header.Get("Location")) + return parsedURL, newResponse(resp), err +} + +func (s *ActionsService) getWorkflowLogsFromURL(ctx context.Context, u string, followRedirects bool) (*http.Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, err + } + + var resp *http.Response + // Use http.DefaultTransport if no custom Transport is configured + req = withContext(ctx, req) + if s.client.client.Transport == nil { + resp, err = http.DefaultTransport.RoundTrip(req) + } else { + resp, err = s.client.client.Transport.RoundTrip(req) + } + if err != nil { + return nil, err + } + resp.Body.Close() + + // If redirect response is returned, follow it + if followRedirects && resp.StatusCode == http.StatusMovedPermanently { + u = resp.Header.Get("Location") + resp, err = s.getWorkflowLogsFromURL(ctx, u, false) + } + return resp, err + +} diff --git a/vendor/github.com/google/go-github/v31/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v31/github/actions_workflow_runs.go new file mode 100644 index 0000000000..b365bb1c75 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/actions_workflow_runs.go @@ -0,0 +1,181 @@ +// Copyright 2020 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" + "fmt" + "net/http" + "net/url" +) + +// WorkflowRun represents a repository action workflow run. +type WorkflowRun struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + RunNumber *int `json:"run_number,omitempty"` + Event *string `json:"event,omitempty"` + Status *string `json:"status,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + PullRequests []*PullRequest `json:"pull_requests,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + JobsURL *string `json:"jobs_url,omitempty"` + LogsURL *string `json:"logs_url,omitempty"` + CheckSuiteURL *string `json:"check_suite_url,omitempty"` + ArtifactsURL *string `json:"artifacts_url,omitempty"` + CancelURL *string `json:"cancel_url,omitempty"` + RerunURL *string `json:"rerun_url,omitempty"` + HeadCommit *HeadCommit `json:"head_commit,omitempty"` + WorkflowURL *string `json:"workflow_url,omitempty"` + Repository *Repository `json:"repository,omitempty"` + HeadRepository *Repository `json:"head_repository,omitempty"` +} + +// WorkflowRuns represents a slice of repository action workflow run. +type WorkflowRuns struct { + TotalCount *int `json:"total_count,omitempty"` + WorkflowRuns []*WorkflowRun `json:"workflow_runs,omitempty"` +} + +// ListWorkflowRunsOptions specifies optional parameters to ListWorkflowRuns. +type ListWorkflowRunsOptions struct { + Actor string `url:"actor,omitempty"` + Branch string `url:"branch,omitempty"` + Event string `url:"event,omitempty"` + Status string `url:"status,omitempty"` + ListOptions +} + +func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { + u, err := addOptions(endpoint, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runs := new(WorkflowRuns) + resp, err := s.client.Do(ctx, req, &runs) + if err != nil { + return nil, resp, err + } + + return runs, resp, nil +} + +// ListWorkflowRunsByID lists all workflow runs by workflow ID. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#list-workflow-runs +func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) + return s.listWorkflowRuns(ctx, u, opts) +} + +// ListWorkflowRunsByFileName lists all workflow runs by workflow file name. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#list-workflow-runs +func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) + return s.listWorkflowRuns(ctx, u, opts) +} + +// ListRepositoryWorkflowRuns lists all workflow runs for a repository. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#list-repository-workflow-runs +func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListOptions) (*WorkflowRuns, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/actions/runs", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runs := new(WorkflowRuns) + resp, err := s.client.Do(ctx, req, &runs) + if err != nil { + return nil, resp, err + } + + return runs, resp, nil +} + +// GetWorkflowRunByID gets a specific workflow run by ID. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#get-a-workflow-run +func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + run := new(WorkflowRun) + resp, err := s.client.Do(ctx, req, run) + if err != nil { + return nil, resp, err + } + + return run, resp, nil +} + +// RerunWorkflow re-runs a workflow by ID. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#re-run-a-workflow +func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// CancelWorkflowRunByID cancels a workflow run by ID. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#cancel-a-workflow-run +func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. +// +// GitHub API docs: https://developer.github.com/v3/actions/workflow_runs/#list-workflow-run-logs +func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, followRedirects bool) (*url.URL, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) + + resp, err := s.getWorkflowLogsFromURL(ctx, u, followRedirects) + if err != nil { + return nil, nil, err + } + + if resp.StatusCode != http.StatusFound { + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + } + parsedURL, err := url.Parse(resp.Header.Get("Location")) + return parsedURL, newResponse(resp), err +} diff --git a/vendor/github.com/google/go-github/v29/github/actions_workflows.go b/vendor/github.com/google/go-github/v31/github/actions_workflows.go similarity index 78% rename from vendor/github.com/google/go-github/v29/github/actions_workflows.go rename to vendor/github.com/google/go-github/v31/github/actions_workflows.go index fc4cf4a531..9743f5072b 100644 --- a/vendor/github.com/google/go-github/v29/github/actions_workflows.go +++ b/vendor/github.com/google/go-github/v31/github/actions_workflows.go @@ -12,22 +12,22 @@ import ( // Workflow represents a repository action workflow. type Workflow struct { - ID int64 `json:"id"` - NodeID string `json:"node_id"` - Name string `json:"name"` - Path string `json:"path"` - State string `json:"state"` - CreatedAt Timestamp `json:"created_at"` - UpdatedAt Timestamp `json:"updated_at"` - URL string `json:"url"` - HTMLURL string `json:"html_url"` - BadgeURL string `json:"badge_url"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + State *string `json:"state,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + BadgeURL *string `json:"badge_url,omitempty"` } // Workflows represents a slice of repository action workflows. type Workflows struct { - TotalCount int `json:"total_count"` - Workflows []*Workflow `json:"workflows"` + TotalCount *int `json:"total_count,omitempty"` + Workflows []*Workflow `json:"workflows,omitempty"` } // ListWorkflows lists all workflows in a repository. diff --git a/vendor/github.com/google/go-github/v29/github/activity.go b/vendor/github.com/google/go-github/v31/github/activity.go similarity index 82% rename from vendor/github.com/google/go-github/v29/github/activity.go rename to vendor/github.com/google/go-github/v31/github/activity.go index d6c992c7f5..f6336fcc99 100644 --- a/vendor/github.com/google/go-github/v29/github/activity.go +++ b/vendor/github.com/google/go-github/v31/github/activity.go @@ -29,13 +29,13 @@ type Feeds struct { 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"` + 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"` } diff --git a/vendor/github.com/google/go-github/v29/github/activity_events.go b/vendor/github.com/google/go-github/v31/github/activity_events.go similarity index 93% rename from vendor/github.com/google/go-github/v29/github/activity_events.go rename to vendor/github.com/google/go-github/v31/github/activity_events.go index 115bcc97d3..d45b26ddcd 100644 --- a/vendor/github.com/google/go-github/v29/github/activity_events.go +++ b/vendor/github.com/google/go-github/v31/github/activity_events.go @@ -59,7 +59,7 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository +// GitHub API docs: https://developer.github.com/v3/issues/events/#list-events-for-a-repository func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +107,7 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization +// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-organization-events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("orgs/%v/events", org) u, err := addOptions(u, opts) @@ -132,7 +132,8 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // 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 +// GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-for-the-authenticated-user +// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-a-user func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -162,7 +163,8 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received 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-that-a-user-has-received +// GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-received-by-the-authenticated-user +// GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-received-by-a-user func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -192,7 +194,7 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-for-an-organization +// GitHub API docs: https://developer.github.com/v3/activity/events/#list-organization-events-for-the-authenticated-user func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) u, err := addOptions(u, opts) diff --git a/vendor/github.com/google/go-github/v29/github/activity_notifications.go b/vendor/github.com/google/go-github/v31/github/activity_notifications.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/activity_notifications.go rename to vendor/github.com/google/go-github/v31/github/activity_notifications.go index 983da6f82f..9c19922bb3 100644 --- a/vendor/github.com/google/go-github/v29/github/activity_notifications.go +++ b/vendor/github.com/google/go-github/v31/github/activity_notifications.go @@ -49,7 +49,7 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/notifications/#list-your-notifications +// GitHub API docs: https://developer.github.com/v3/activity/notifications/#list-notifications-for-the-authenticated-user func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("notifications") u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository +// GitHub API docs: https://developer.github.com/v3/activity/notifications/#list-repository-notifications-for-the-authenticated-user func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) u, err := addOptions(u, opts) @@ -118,7 +118,7 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // -// GitHub API docs: https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository +// GitHub API docs: https://developer.github.com/v3/activity/notifications/#mark-repository-notifications-as-read func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -134,7 +134,7 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://developer.github.com/v3/activity/notifications/#view-a-single-thread +// GitHub API docs: https://developer.github.com/v3/activity/notifications/#get-a-thread func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -169,7 +169,7 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription +// GitHub API docs: https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription-for-the-authenticated-user func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) diff --git a/vendor/github.com/google/go-github/v29/github/activity_star.go b/vendor/github.com/google/go-github/v31/github/activity_star.go similarity index 92% rename from vendor/github.com/google/go-github/v29/github/activity_star.go rename to vendor/github.com/google/go-github/v31/github/activity_star.go index 1e9850f9e1..158f395210 100644 --- a/vendor/github.com/google/go-github/v29/github/activity_star.go +++ b/vendor/github.com/google/go-github/v31/github/activity_star.go @@ -67,7 +67,8 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/starring/#list-repositories-being-starred +// GitHub API docs: https://developer.github.com/v3/activity/starring/#list-repositories-starred-by-a-user +// GitHub API docs: https://developer.github.com/v3/activity/starring/#list-repositories-starred-by-the-authenticated-user func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) { var u string if user != "" { @@ -100,7 +101,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository +// GitHub API docs: https://developer.github.com/v3/activity/starring/#check-if-a-repository-is-starred-by-the-authenticated-user func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -114,7 +115,7 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/starring/#star-a-repository +// GitHub API docs: https://developer.github.com/v3/activity/starring/#star-a-repository-for-the-authenticated-user func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("PUT", u, nil) @@ -126,7 +127,7 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/starring/#unstar-a-repository +// GitHub API docs: https://developer.github.com/v3/activity/starring/#unstar-a-repository-for-the-authenticated-user func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/activity_watching.go b/vendor/github.com/google/go-github/v31/github/activity_watching.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/activity_watching.go rename to vendor/github.com/google/go-github/v31/github/activity_watching.go index 608647a6ce..0265a08d0d 100644 --- a/vendor/github.com/google/go-github/v29/github/activity_watching.go +++ b/vendor/github.com/google/go-github/v31/github/activity_watching.go @@ -52,7 +52,8 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched +// GitHub API docs: https://developer.github.com/v3/activity/watching/#list-repositories-watched-by-a-user +// GitHub API docs: https://developer.github.com/v3/activity/watching/#list-repositories-watched-by-the-authenticated-user func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) { var u string if user != "" { diff --git a/vendor/github.com/google/go-github/v29/github/admin.go b/vendor/github.com/google/go-github/v31/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/admin.go rename to vendor/github.com/google/go-github/v31/github/admin.go diff --git a/vendor/github.com/google/go-github/v31/github/admin_orgs.go b/vendor/github.com/google/go-github/v31/github/admin_orgs.go new file mode 100644 index 0000000000..448e51f631 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/admin_orgs.go @@ -0,0 +1,89 @@ +// 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" + "fmt" +) + +// 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 +} + +// renameOrgRequest is a subset of Organization and is used internally +// by RenameOrg and RenameOrgByName to pass only the known fields for the endpoint. +type renameOrgRequest struct { + Login *string `json:"login,omitempty"` +} + +// RenameOrgResponse is the response given when renaming an Organization. +type RenameOrgResponse struct { + Message *string `json:"message,omitempty"` + URL *string `json:"url,omitempty"` +} + +// RenameOrg renames an organization in GitHub Enterprise. +// +// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { + return s.RenameOrgByName(ctx, *org.Login, newName) +} + +// RenameOrgByName renames an organization in GitHub Enterprise using its current name. +// +// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { + u := fmt.Sprintf("admin/organizations/%v", org) + + orgReq := &renameOrgRequest{ + Login: &newName, + } + + req, err := s.client.NewRequest("PATCH", u, orgReq) + if err != nil { + return nil, nil, err + } + + o := new(RenameOrgResponse) + resp, err := s.client.Do(ctx, req, o) + if err != nil { + return nil, resp, err + } + + return o, resp, nil +} diff --git a/vendor/github.com/google/go-github/v29/github/admin_stats.go b/vendor/github.com/google/go-github/v31/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/admin_stats.go rename to vendor/github.com/google/go-github/v31/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v29/github/admin_users.go b/vendor/github.com/google/go-github/v31/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/admin_users.go rename to vendor/github.com/google/go-github/v31/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v29/github/apps.go b/vendor/github.com/google/go-github/v31/github/apps.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/apps.go rename to vendor/github.com/google/go-github/v31/github/apps.go index 75d9177fa9..c0e8c9a0bf 100644 --- a/vendor/github.com/google/go-github/v29/github/apps.go +++ b/vendor/github.com/google/go-github/v31/github/apps.go @@ -124,6 +124,7 @@ func (i Installation) String() string { // (e.g., https://github.com/settings/apps/:app_slug). // // GitHub API docs: https://developer.github.com/v3/apps/#get-a-single-github-app +// GitHub API docs: https://developer.github.com/v3/apps/#get-the-authenticated-github-app func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) { var u string if appSlug != "" { @@ -177,14 +178,14 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://developer.github.com/v3/apps/#get-a-single-installation +// GitHub API docs: https://developer.github.com/v3/apps/#get-an-installation func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("app/installations/%v", id)) } // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/apps/#list-installations-for-user +// GitHub API docs: https://developer.github.com/v3/apps/installations/#list-installations-for-a-user func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("user/installations", opts) if err != nil { @@ -235,7 +236,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// GitHub API docs: https://developer.github.com/v3/apps/#create-a-content-attachment +// GitHub API docs: https://developer.github.com/v3/apps/installations/#create-a-content-attachment func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} diff --git a/vendor/github.com/google/go-github/v29/github/apps_installation.go b/vendor/github.com/google/go-github/v31/github/apps_installation.go similarity index 94% rename from vendor/github.com/google/go-github/v29/github/apps_installation.go rename to vendor/github.com/google/go-github/v31/github/apps_installation.go index 59a90c15a9..2f7664cfba 100644 --- a/vendor/github.com/google/go-github/v29/github/apps_installation.go +++ b/vendor/github.com/google/go-github/v31/github/apps_installation.go @@ -90,7 +90,7 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub docs: https://developer.github.com/v3/apps/installations/#remove-repository-from-installation +// GitHub API docs: https://developer.github.com/v3/apps/installations/#remove-repository-from-installation func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -104,7 +104,7 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub docs: https://developer.github.com/v3/apps/installations/#revoke-an-installation-token +// GitHub API docs: https://developer.github.com/v3/apps/installations/#revoke-an-installation-token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/apps_manifest.go b/vendor/github.com/google/go-github/v31/github/apps_manifest.go similarity index 90% rename from vendor/github.com/google/go-github/v29/github/apps_manifest.go rename to vendor/github.com/google/go-github/v31/github/apps_manifest.go index 8d6ab3c8c4..9db76a3045 100644 --- a/vendor/github.com/google/go-github/v29/github/apps_manifest.go +++ b/vendor/github.com/google/go-github/v31/github/apps_manifest.go @@ -34,7 +34,7 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration +// GitHub API docs: https://developer.github.com/v3/apps/#create-a-github-app-from-a-manifest func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%s/conversions", code) req, err := s.client.NewRequest("POST", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/apps_marketplace.go b/vendor/github.com/google/go-github/v31/github/apps_marketplace.go similarity index 97% rename from vendor/github.com/google/go-github/v29/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v31/github/apps_marketplace.go index 053d451dc6..9026633e7a 100644 --- a/vendor/github.com/google/go-github/v29/github/apps_marketplace.go +++ b/vendor/github.com/google/go-github/v31/github/apps_marketplace.go @@ -150,7 +150,8 @@ func (s *MarketplaceService) ListPlanAccountsForAccount(ctx context.Context, acc // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://developer.github.com/v3/apps/marketplace/#get-a-users-marketplace-purchases +// GitHub API docs: https://developer.github.com/v3/apps/marketplace/#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://developer.github.com/v3/apps/marketplace/#list-subscriptions-for-the-authenticated-user-stubbed func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) { uri := "user/marketplace_purchases" if s.Stubbed { diff --git a/vendor/github.com/google/go-github/v29/github/authorizations.go b/vendor/github.com/google/go-github/v31/github/authorizations.go similarity index 56% rename from vendor/github.com/google/go-github/v29/github/authorizations.go rename to vendor/github.com/google/go-github/v31/github/authorizations.go index a73c37fd07..7447e2fbf7 100644 --- a/vendor/github.com/google/go-github/v29/github/authorizations.go +++ b/vendor/github.com/google/go-github/v31/github/authorizations.go @@ -134,137 +134,6 @@ func (a AuthorizationUpdateRequest) String() string { return Stringify(a) } -// List the authorizations for the authenticated user. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations -func (s *AuthorizationsService) List(ctx context.Context, opts *ListOptions) ([]*Authorization, *Response, error) { - u := "authorizations" - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var auths []*Authorization - resp, err := s.client.Do(ctx, req, &auths) - if err != nil { - return nil, resp, err - } - return auths, resp, nil -} - -// Get a single authorization. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization -func (s *AuthorizationsService) Get(ctx context.Context, id int64) (*Authorization, *Response, error) { - u := fmt.Sprintf("authorizations/%d", id) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) - if err != nil { - return nil, resp, err - } - return a, resp, nil -} - -// Create a new authorization for the specified OAuth application. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization -func (s *AuthorizationsService) Create(ctx context.Context, auth *AuthorizationRequest) (*Authorization, *Response, error) { - u := "authorizations" - - req, err := s.client.NewRequest("POST", u, auth) - if err != nil { - return nil, nil, err - } - - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) - if err != nil { - return nil, resp, err - } - return a, resp, nil -} - -// GetOrCreateForApp creates a new authorization for the specified OAuth -// application, only if an authorization for that application doesn’t already -// exist for the user. -// -// If a new token is created, the HTTP status code will be "201 Created", and -// the returned Authorization.Token field will be populated. If an existing -// token is returned, the status code will be "200 OK" and the -// Authorization.Token field will be empty. -// -// clientID is the OAuth Client ID with which to create the token. -// -// GitHub API docs: -// https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app -// https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint -func (s *AuthorizationsService) GetOrCreateForApp(ctx context.Context, clientID string, auth *AuthorizationRequest) (*Authorization, *Response, error) { - var u string - if auth.Fingerprint == nil || *auth.Fingerprint == "" { - u = fmt.Sprintf("authorizations/clients/%v", clientID) - } else { - u = fmt.Sprintf("authorizations/clients/%v/%v", clientID, *auth.Fingerprint) - } - - req, err := s.client.NewRequest("PUT", u, auth) - if err != nil { - return nil, nil, err - } - - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) - if err != nil { - return nil, resp, err - } - - return a, resp, nil -} - -// Edit a single authorization. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization -func (s *AuthorizationsService) Edit(ctx context.Context, id int64, auth *AuthorizationUpdateRequest) (*Authorization, *Response, error) { - u := fmt.Sprintf("authorizations/%d", id) - - req, err := s.client.NewRequest("PATCH", u, auth) - if err != nil { - return nil, nil, err - } - - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) - if err != nil { - return nil, resp, err - } - - return a, resp, nil -} - -// Delete a single authorization. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization -func (s *AuthorizationsService) Delete(ctx context.Context, id int64) (*Response, error) { - u := fmt.Sprintf("authorizations/%d", id) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - // Check if an OAuth token is valid for a specific app. // // Note that this operation requires the use of BasicAuth, but where the @@ -273,14 +142,19 @@ func (s *AuthorizationsService) Delete(ctx context.Context, id int64) (*Response // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#check-an-authorization -func (s *AuthorizationsService) Check(ctx context.Context, clientID string, token string) (*Authorization, *Response, error) { - u := fmt.Sprintf("applications/%v/tokens/%v", clientID, token) +// GitHub API docs: https://developer.github.com/v3/apps/oauth_applications/#check-a-token +func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { + u := fmt.Sprintf("applications/%v/token", clientID) + + reqBody := &struct { + AccessToken string `json:"access_token"` + }{AccessToken: accessToken} - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest("POST", u, reqBody) if err != nil { return nil, nil, err } + req.Header.Set("Accept", mediaTypeOAuthAppPreview) a := new(Authorization) resp, err := s.client.Do(ctx, req, a) @@ -301,14 +175,19 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID string, toke // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization -func (s *AuthorizationsService) Reset(ctx context.Context, clientID string, token string) (*Authorization, *Response, error) { - u := fmt.Sprintf("applications/%v/tokens/%v", clientID, token) +// GitHub API docs: https://developer.github.com/v3/apps/oauth_applications/#reset-a-token +func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { + u := fmt.Sprintf("applications/%v/token", clientID) - req, err := s.client.NewRequest("POST", u, nil) + reqBody := &struct { + AccessToken string `json:"access_token"` + }{AccessToken: accessToken} + + req, err := s.client.NewRequest("PATCH", u, reqBody) if err != nil { return nil, nil, err } + req.Header.Set("Accept", mediaTypeOAuthAppPreview) a := new(Authorization) resp, err := s.client.Do(ctx, req, a) @@ -325,74 +204,40 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID string, toke // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application -func (s *AuthorizationsService) Revoke(ctx context.Context, clientID string, token string) (*Response, error) { - u := fmt.Sprintf("applications/%v/tokens/%v", clientID, token) +// GitHub API docs: https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-token +func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { + u := fmt.Sprintf("applications/%v/token", clientID) - req, err := s.client.NewRequest("DELETE", u, nil) + reqBody := &struct { + AccessToken string `json:"access_token"` + }{AccessToken: accessToken} + + req, err := s.client.NewRequest("DELETE", u, reqBody) if err != nil { return nil, err } + req.Header.Set("Accept", mediaTypeOAuthAppPreview) return s.client.Do(ctx, req, nil) } -// ListGrants lists the set of OAuth applications that have been granted -// access to a user's account. This will return one entry for each application -// that has been granted access to the account, regardless of the number of -// tokens an application has generated for the user. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#list-your-grants -func (s *AuthorizationsService) ListGrants(ctx context.Context, opts *ListOptions) ([]*Grant, *Response, error) { - u, err := addOptions("applications/grants", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - grants := []*Grant{} - resp, err := s.client.Do(ctx, req, &grants) - if err != nil { - return nil, resp, err - } - - return grants, resp, nil -} - -// GetGrant gets a single OAuth application grant. -// -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant -func (s *AuthorizationsService) GetGrant(ctx context.Context, id int64) (*Grant, *Response, error) { - u := fmt.Sprintf("applications/grants/%d", id) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - grant := new(Grant) - resp, err := s.client.Do(ctx, req, grant) - if err != nil { - return nil, resp, err - } - - return grant, resp, nil -} - // DeleteGrant deletes an OAuth application grant. Deleting an application's // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#delete-a-grant -func (s *AuthorizationsService) DeleteGrant(ctx context.Context, id int64) (*Response, error) { - u := fmt.Sprintf("applications/grants/%d", id) - req, err := s.client.NewRequest("DELETE", u, nil) +// GitHub API docs: https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-authorization +func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { + u := fmt.Sprintf("applications/%v/grant", clientID) + + reqBody := &struct { + AccessToken string `json:"access_token"` + }{AccessToken: accessToken} + + req, err := s.client.NewRequest("DELETE", u, reqBody) if err != nil { return nil, err } + req.Header.Set("Accept", mediaTypeOAuthAppPreview) return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v29/github/checks.go b/vendor/github.com/google/go-github/v31/github/checks.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/checks.go rename to vendor/github.com/google/go-github/v31/github/checks.go index 55adf14ea1..8d08cb39fb 100644 --- a/vendor/github.com/google/go-github/v29/github/checks.go +++ b/vendor/github.com/google/go-github/v31/github/checks.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "net/url" ) // ChecksService provides access to the Checks API in the @@ -97,7 +96,7 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://developer.github.com/v3/checks/runs/#get-a-single-check-run +// GitHub API docs: https://developer.github.com/v3/checks/runs/#get-a-check-run func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("GET", u, nil) @@ -118,7 +117,7 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://developer.github.com/v3/checks/suites/#get-a-single-check-suite +// GitHub API docs: https://developer.github.com/v3/checks/suites/#get-a-check-suite func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) req, err := s.client.NewRequest("GET", u, nil) @@ -215,7 +214,7 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://developer.github.com/v3/checks/runs/#list-annotations-for-a-check-run +// GitHub API docs: https://developer.github.com/v3/checks/runs/#list-check-run-annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/annotations", owner, repo, checkRunID) u, err := addOptions(u, opts) @@ -256,9 +255,9 @@ type ListCheckRunsResults struct { // ListCheckRunsForRef lists check runs for a specific ref. // -// GitHub API docs: https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref +// GitHub API docs: https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-git-reference func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -322,9 +321,9 @@ type ListCheckSuiteResults struct { // ListCheckSuitesForRef lists check suite for a specific ref. // -// GitHub API docs: https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref +// GitHub API docs: https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-git-reference func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -370,7 +369,7 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://developer.github.com/v3/checks/suites/#set-preferences-for-check-suites-on-a-repository +// GitHub API docs: https://developer.github.com/v3/checks/suites/#update-repository-preferences-for-check-suites func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) req, err := s.client.NewRequest("PATCH", u, opts) @@ -418,7 +417,7 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://developer.github.com/v3/checks/suites/#rerequest-check-suite +// GitHub API docs: https://developer.github.com/v3/checks/suites/#rerequest-a-check-suite func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) diff --git a/vendor/github.com/google/go-github/v29/github/doc.go b/vendor/github.com/google/go-github/v31/github/doc.go similarity index 99% rename from vendor/github.com/google/go-github/v29/github/doc.go rename to vendor/github.com/google/go-github/v31/github/doc.go index 403a6ecc6f..c2f0b9cd83 100644 --- a/vendor/github.com/google/go-github/v29/github/doc.go +++ b/vendor/github.com/google/go-github/v31/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v29/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v31/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/vendor/github.com/google/go-github/v29/github/event.go b/vendor/github.com/google/go-github/v31/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/event.go rename to vendor/github.com/google/go-github/v31/github/event.go diff --git a/vendor/github.com/google/go-github/v29/github/event_types.go b/vendor/github.com/google/go-github/v31/github/event_types.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/event_types.go rename to vendor/github.com/google/go-github/v31/github/event_types.go index 4f537c8db9..2c18de6c13 100644 --- a/vendor/github.com/google/go-github/v29/github/event_types.go +++ b/vendor/github.com/google/go-github/v31/github/event_types.go @@ -649,13 +649,13 @@ type PullRequestReviewCommentEvent struct { // // GitHub API docs: https://developer.github.com/v3/activity/events/types/#pushevent type PushEvent struct { - PushID *int64 `json:"push_id,omitempty"` - Head *string `json:"head,omitempty"` - Ref *string `json:"ref,omitempty"` - Size *int `json:"size,omitempty"` - Commits []PushEventCommit `json:"commits,omitempty"` - Before *string `json:"before,omitempty"` - DistinctSize *int `json:"distinct_size,omitempty"` + PushID *int64 `json:"push_id,omitempty"` + Head *string `json:"head,omitempty"` + Ref *string `json:"ref,omitempty"` + Size *int `json:"size,omitempty"` + Commits []*HeadCommit `json:"commits,omitempty"` + Before *string `json:"before,omitempty"` + DistinctSize *int `json:"distinct_size,omitempty"` // The following fields are only populated by Webhook events. After *string `json:"after,omitempty"` @@ -665,7 +665,7 @@ type PushEvent struct { BaseRef *string `json:"base_ref,omitempty"` Compare *string `json:"compare,omitempty"` Repo *PushEventRepository `json:"repository,omitempty"` - HeadCommit *PushEventCommit `json:"head_commit,omitempty"` + HeadCommit *HeadCommit `json:"head_commit,omitempty"` Pusher *User `json:"pusher,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` @@ -675,8 +675,8 @@ func (p PushEvent) String() string { return Stringify(p) } -// PushEventCommit represents a git commit in a GitHub PushEvent. -type PushEventCommit struct { +// HeadCommit represents a git commit in a GitHub PushEvent. +type HeadCommit struct { Message *string `json:"message,omitempty"` Author *CommitAuthor `json:"author,omitempty"` URL *string `json:"url,omitempty"` @@ -695,7 +695,7 @@ type PushEventCommit struct { Modified []string `json:"modified,omitempty"` } -func (p PushEventCommit) String() string { +func (p HeadCommit) String() string { return Stringify(p) } diff --git a/vendor/github.com/google/go-github/v29/github/gists.go b/vendor/github.com/google/go-github/v31/github/gists.go similarity index 97% rename from vendor/github.com/google/go-github/v29/github/gists.go rename to vendor/github.com/google/go-github/v31/github/gists.go index 0f32605542..026b5d15ee 100644 --- a/vendor/github.com/google/go-github/v29/github/gists.go +++ b/vendor/github.com/google/go-github/v31/github/gists.go @@ -96,7 +96,8 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://developer.github.com/v3/gists/#list-gists +// GitHub API docs: https://developer.github.com/v3/gists/#list-gists-for-a-user +// GitHub API docs: https://developer.github.com/v3/gists/#list-gists-for-the-authenticated-user func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) { var u string if user != "" { @@ -125,7 +126,7 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://developer.github.com/v3/gists/#list-gists +// GitHub API docs: https://developer.github.com/v3/gists/#list-public-gists func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/public", opts) if err != nil { @@ -148,7 +149,7 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://developer.github.com/v3/gists/#list-gists +// GitHub API docs: https://developer.github.com/v3/gists/#list-starred-gists func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/starred", opts) if err != nil { @@ -171,7 +172,7 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://developer.github.com/v3/gists/#get-a-single-gist +// GitHub API docs: https://developer.github.com/v3/gists/#get-a-gist func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -228,7 +229,7 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://developer.github.com/v3/gists/#edit-a-gist +// GitHub API docs: https://developer.github.com/v3/gists/#update-a-gist func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("PATCH", u, gist) diff --git a/vendor/github.com/google/go-github/v29/github/gists_comments.go b/vendor/github.com/google/go-github/v31/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/gists_comments.go rename to vendor/github.com/google/go-github/v31/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v29/github/git.go b/vendor/github.com/google/go-github/v31/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/git.go rename to vendor/github.com/google/go-github/v31/github/git.go diff --git a/vendor/github.com/google/go-github/v29/github/git_blobs.go b/vendor/github.com/google/go-github/v31/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/git_blobs.go rename to vendor/github.com/google/go-github/v31/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v29/github/git_commits.go b/vendor/github.com/google/go-github/v31/github/git_commits.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/git_commits.go rename to vendor/github.com/google/go-github/v31/github/git_commits.go index 741961980a..e1dba1cf5d 100644 --- a/vendor/github.com/google/go-github/v29/github/git_commits.go +++ b/vendor/github.com/google/go-github/v31/github/git_commits.go @@ -31,7 +31,7 @@ type Commit struct { Committer *CommitAuthor `json:"committer,omitempty"` Message *string `json:"message,omitempty"` Tree *Tree `json:"tree,omitempty"` - Parents []Commit `json:"parents,omitempty"` + Parents []*Commit `json:"parents,omitempty"` Stats *CommitStats `json:"stats,omitempty"` HTMLURL *string `json:"html_url,omitempty"` URL *string `json:"url,omitempty"` diff --git a/vendor/github.com/google/go-github/v29/github/git_refs.go b/vendor/github.com/google/go-github/v31/github/git_refs.go similarity index 92% rename from vendor/github.com/google/go-github/v29/github/git_refs.go rename to vendor/github.com/google/go-github/v31/github/git_refs.go index 18494dae33..a6269e5a9e 100644 --- a/vendor/github.com/google/go-github/v29/github/git_refs.go +++ b/vendor/github.com/google/go-github/v31/github/git_refs.go @@ -58,7 +58,7 @@ type updateRefRequest struct { // GitHub API docs: https://developer.github.com/v3/git/refs/#get-a-reference func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -79,6 +79,16 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref return r, resp, nil } +// refURLEscape escapes every path segment of the given ref. Those must +// not contain escaped "/" - as "%2F" - or github will not recognize it. +func refURLEscape(ref string) string { + parts := strings.Split(ref, "/") + for i, s := range parts { + parts[i] = url.PathEscape(s) + } + return strings.Join(parts, "/") +} + // GetRefs fetches a slice of Reference objects for a given Git ref. // If there is an exact match, only that ref is returned. // If there is no exact match, GitHub returns all refs that start with ref. @@ -92,7 +102,7 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref // GitHub API docs: https://developer.github.com/v3/git/refs/#get-a-reference func (s *GitService) GetRefs(ctx context.Context, owner string, repo string, ref string) ([]*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -212,7 +222,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // GitHub API docs: https://developer.github.com/v3/git/refs/#delete-a-reference func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err diff --git a/vendor/github.com/google/go-github/v29/github/git_tags.go b/vendor/github.com/google/go-github/v31/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/git_tags.go rename to vendor/github.com/google/go-github/v31/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v29/github/git_trees.go b/vendor/github.com/google/go-github/v31/github/git_trees.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/git_trees.go rename to vendor/github.com/google/go-github/v31/github/git_trees.go index 7714946cf9..7430876ad9 100644 --- a/vendor/github.com/google/go-github/v29/github/git_trees.go +++ b/vendor/github.com/google/go-github/v31/github/git_trees.go @@ -13,8 +13,8 @@ import ( // Tree represents a GitHub tree. type Tree struct { - SHA *string `json:"sha,omitempty"` - Entries []TreeEntry `json:"tree,omitempty"` + SHA *string `json:"sha,omitempty"` + Entries []*TreeEntry `json:"tree,omitempty"` // Truncated is true if the number of items in the tree // exceeded GitHub's maximum limit and the Entries were truncated @@ -125,7 +125,7 @@ type createTree struct { // that tree with the new path contents and write a new tree out. // // GitHub API docs: https://developer.github.com/v3/git/trees/#create-a-tree -func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []TreeEntry) (*Tree, *Response, error) { +func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) newEntries := make([]interface{}, 0, len(entries)) diff --git a/vendor/github.com/google/go-github/v29/github/github-accessors.go b/vendor/github.com/google/go-github/v31/github/github-accessors.go similarity index 95% rename from vendor/github.com/google/go-github/v29/github/github-accessors.go rename to vendor/github.com/google/go-github/v31/github/github-accessors.go index 212e334b46..4141b9cd60 100644 --- a/vendor/github.com/google/go-github/v29/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v31/github/github-accessors.go @@ -308,6 +308,78 @@ func (a *AppConfig) GetWebhookSecret() string { return *a.WebhookSecret } +// GetArchiveDownloadURL returns the ArchiveDownloadURL field if it's non-nil, zero value otherwise. +func (a *Artifact) GetArchiveDownloadURL() string { + if a == nil || a.ArchiveDownloadURL == nil { + return "" + } + return *a.ArchiveDownloadURL +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (a *Artifact) GetCreatedAt() Timestamp { + if a == nil || a.CreatedAt == nil { + return Timestamp{} + } + return *a.CreatedAt +} + +// GetExpired returns the Expired field if it's non-nil, zero value otherwise. +func (a *Artifact) GetExpired() bool { + if a == nil || a.Expired == nil { + return false + } + return *a.Expired +} + +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (a *Artifact) GetExpiresAt() Timestamp { + if a == nil || a.ExpiresAt == nil { + return Timestamp{} + } + return *a.ExpiresAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (a *Artifact) GetID() int64 { + if a == nil || a.ID == nil { + return 0 + } + return *a.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (a *Artifact) GetName() string { + if a == nil || a.Name == nil { + return "" + } + return *a.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (a *Artifact) GetNodeID() string { + if a == nil || a.NodeID == nil { + return "" + } + return *a.NodeID +} + +// GetSizeInBytes returns the SizeInBytes field if it's non-nil, zero value otherwise. +func (a *Artifact) GetSizeInBytes() int64 { + if a == nil || a.SizeInBytes == nil { + return 0 + } + return *a.SizeInBytes +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (a *ArtifactList) GetTotalCount() int64 { + if a == nil || a.TotalCount == nil { + return 0 + } + return *a.TotalCount +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (a *Attachment) GetBody() string { if a == nil || a.Body == nil { @@ -3556,6 +3628,78 @@ func (g *Grant) GetURL() string { return *g.URL } +// GetAuthor returns the Author field. +func (h *HeadCommit) GetAuthor() *CommitAuthor { + if h == nil { + return nil + } + return h.Author +} + +// GetCommitter returns the Committer field. +func (h *HeadCommit) GetCommitter() *CommitAuthor { + if h == nil { + return nil + } + return h.Committer +} + +// GetDistinct returns the Distinct field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetDistinct() bool { + if h == nil || h.Distinct == nil { + return false + } + return *h.Distinct +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetID() string { + if h == nil || h.ID == nil { + return "" + } + return *h.ID +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetMessage() string { + if h == nil || h.Message == nil { + return "" + } + return *h.Message +} + +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetSHA() string { + if h == nil || h.SHA == nil { + return "" + } + return *h.SHA +} + +// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetTimestamp() Timestamp { + if h == nil || h.Timestamp == nil { + return Timestamp{} + } + return *h.Timestamp +} + +// GetTreeID returns the TreeID field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetTreeID() string { + if h == nil || h.TreeID == nil { + return "" + } + return *h.TreeID +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (h *HeadCommit) GetURL() string { + if h == nil || h.URL == nil { + return "" + } + return *h.URL +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (h *Hook) GetActive() bool { if h == nil || h.Active == nil { @@ -4340,6 +4484,14 @@ func (i *Issue) GetAssignee() *User { return i.Assignee } +// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. +func (i *Issue) GetAuthorAssociation() string { + if i == nil || i.AuthorAssociation == nil { + return "" + } + return *i.AuthorAssociation +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (i *Issue) GetBody() string { if i == nil || i.Body == nil { @@ -4972,6 +5124,14 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (j *Jobs) GetTotalCount() int { + if j == nil || j.TotalCount == nil { + return 0 + } + return *j.TotalCount +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (k *Key) GetCreatedAt() Timestamp { if k == nil || k.CreatedAt == nil { @@ -7068,6 +7228,22 @@ func (p *PageStats) GetTotalPages() int { return *p.TotalPages } +// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetCNAME() string { + if p == nil || p.CNAME == nil { + return "" + } + return *p.CNAME +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetSource() string { + if p == nil || p.Source == nil { + return "" + } + return *p.Source +} + // GetHook returns the Hook field. func (p *PingEvent) GetHook() *Hook { if p == nil { @@ -9117,7 +9293,7 @@ func (p *PushEvent) GetHead() string { } // GetHeadCommit returns the HeadCommit field. -func (p *PushEvent) GetHeadCommit() *PushEventCommit { +func (p *PushEvent) GetHeadCommit() *HeadCommit { if p == nil { return nil } @@ -9180,78 +9356,6 @@ func (p *PushEvent) GetSize() int { return *p.Size } -// GetAuthor returns the Author field. -func (p *PushEventCommit) GetAuthor() *CommitAuthor { - if p == nil { - return nil - } - return p.Author -} - -// GetCommitter returns the Committer field. -func (p *PushEventCommit) GetCommitter() *CommitAuthor { - if p == nil { - return nil - } - return p.Committer -} - -// GetDistinct returns the Distinct field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetDistinct() bool { - if p == nil || p.Distinct == nil { - return false - } - return *p.Distinct -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetID() string { - if p == nil || p.ID == nil { - return "" - } - return *p.ID -} - -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetMessage() string { - if p == nil || p.Message == nil { - return "" - } - return *p.Message -} - -// GetSHA returns the SHA field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetSHA() string { - if p == nil || p.SHA == nil { - return "" - } - return *p.SHA -} - -// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetTimestamp() Timestamp { - if p == nil || p.Timestamp == nil { - return Timestamp{} - } - return *p.Timestamp -} - -// GetTreeID returns the TreeID field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetTreeID() string { - if p == nil || p.TreeID == nil { - return "" - } - return *p.TreeID -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *PushEventCommit) GetURL() string { - if p == nil || p.URL == nil { - return "" - } - return *p.URL -} - // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (p *PushEventRepoOwner) GetEmail() string { if p == nil || p.Email == nil { @@ -9700,6 +9804,22 @@ func (r *Reference) GetURL() string { return *r.URL } +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (r *RegistrationToken) GetExpiresAt() Timestamp { + if r == nil || r.ExpiresAt == nil { + return Timestamp{} + } + return *r.ExpiresAt +} + +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (r *RegistrationToken) GetToken() string { + if r == nil || r.Token == nil { + return "" + } + return *r.Token +} + // GetBrowserDownloadURL returns the BrowserDownloadURL field if it's non-nil, zero value otherwise. func (r *ReleaseAsset) GetBrowserDownloadURL() string { if r == nil || r.BrowserDownloadURL == nil { @@ -9844,6 +9964,22 @@ func (r *ReleaseEvent) GetSender() *User { return r.Sender } +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (r *RemoveToken) GetExpiresAt() Timestamp { + if r == nil || r.ExpiresAt == nil { + return Timestamp{} + } + return *r.ExpiresAt +} + +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (r *RemoveToken) GetToken() string { + if r == nil || r.Token == nil { + return "" + } + return *r.Token +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *Rename) GetFrom() string { if r == nil || r.From == nil { @@ -9860,6 +9996,22 @@ func (r *Rename) GetTo() string { return *r.To } +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (r *RenameOrgResponse) GetMessage() string { + if r == nil || r.Message == nil { + return "" + } + return *r.Message +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (r *RenameOrgResponse) GetURL() string { + if r == nil || r.URL == nil { + return "" + } + return *r.URL +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetIncompleteResults() bool { if r == nil || r.IncompleteResults == nil { @@ -10572,6 +10724,14 @@ func (r *Repository) GetURL() string { return *r.URL } +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (r *Repository) GetVisibility() string { + if r == nil || r.Visibility == nil { + return "" + } + return *r.Visibility +} + // GetWatchersCount returns the WatchersCount field if it's non-nil, zero value otherwise. func (r *Repository) GetWatchersCount() int { if r == nil || r.WatchersCount == nil { @@ -11492,52 +11652,116 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *Runner) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + // GetName returns the Name field if it's non-nil, zero value otherwise. -func (s *ServiceHook) GetName() string { - if s == nil || s.Name == nil { +func (r *Runner) GetName() string { + if r == nil || r.Name == nil { return "" } - return *s.Name + return *r.Name } -// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. -func (s *SignaturesProtectedBranch) GetEnabled() bool { - if s == nil || s.Enabled == nil { - return false +// GetOS returns the OS field if it's non-nil, zero value otherwise. +func (r *Runner) GetOS() string { + if r == nil || r.OS == nil { + return "" } - return *s.Enabled + return *r.OS } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (s *SignaturesProtectedBranch) GetURL() string { - if s == nil || s.URL == nil { +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (r *Runner) GetStatus() string { + if r == nil || r.Status == nil { return "" } - return *s.URL + return *r.Status } -// GetPayload returns the Payload field if it's non-nil, zero value otherwise. -func (s *SignatureVerification) GetPayload() string { - if s == nil || s.Payload == nil { +// GetArchitecture returns the Architecture field if it's non-nil, zero value otherwise. +func (r *RunnerApplicationDownload) GetArchitecture() string { + if r == nil || r.Architecture == nil { return "" } - return *s.Payload + return *r.Architecture } -// GetReason returns the Reason field if it's non-nil, zero value otherwise. -func (s *SignatureVerification) GetReason() string { - if s == nil || s.Reason == nil { +// GetDownloadURL returns the DownloadURL field if it's non-nil, zero value otherwise. +func (r *RunnerApplicationDownload) GetDownloadURL() string { + if r == nil || r.DownloadURL == nil { return "" } - return *s.Reason + return *r.DownloadURL } -// GetSignature returns the Signature field if it's non-nil, zero value otherwise. -func (s *SignatureVerification) GetSignature() string { - if s == nil || s.Signature == nil { +// GetFilename returns the Filename field if it's non-nil, zero value otherwise. +func (r *RunnerApplicationDownload) GetFilename() string { + if r == nil || r.Filename == nil { return "" } - return *s.Signature + return *r.Filename +} + +// GetOS returns the OS field if it's non-nil, zero value otherwise. +func (r *RunnerApplicationDownload) GetOS() string { + if r == nil || r.OS == nil { + return "" + } + return *r.OS +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (s *ServiceHook) GetName() string { + if s == nil || s.Name == nil { + return "" + } + return *s.Name +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (s *SignaturesProtectedBranch) GetEnabled() bool { + if s == nil || s.Enabled == nil { + return false + } + return *s.Enabled +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *SignaturesProtectedBranch) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + +// GetPayload returns the Payload field if it's non-nil, zero value otherwise. +func (s *SignatureVerification) GetPayload() string { + if s == nil || s.Payload == nil { + return "" + } + return *s.Payload +} + +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (s *SignatureVerification) GetReason() string { + if s == nil || s.Reason == nil { + return "" + } + return *s.Reason +} + +// GetSignature returns the Signature field if it's non-nil, zero value otherwise. +func (s *SignatureVerification) GetSignature() string { + if s == nil || s.Signature == nil { + return "" + } + return *s.Signature } // GetVerified returns the Verified field if it's non-nil, zero value otherwise. @@ -11916,6 +12140,54 @@ func (t *Tag) GetVerification() *SignatureVerification { return t.Verification } +// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. +func (t *TaskStep) GetCompletedAt() Timestamp { + if t == nil || t.CompletedAt == nil { + return Timestamp{} + } + return *t.CompletedAt +} + +// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. +func (t *TaskStep) GetConclusion() string { + if t == nil || t.Conclusion == nil { + return "" + } + return *t.Conclusion +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (t *TaskStep) GetName() string { + if t == nil || t.Name == nil { + return "" + } + return *t.Name +} + +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (t *TaskStep) GetNumber() int64 { + if t == nil || t.Number == nil { + return 0 + } + return *t.Number +} + +// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. +func (t *TaskStep) GetStartedAt() Timestamp { + if t == nil || t.StartedAt == nil { + return Timestamp{} + } + return *t.StartedAt +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (t *TaskStep) GetStatus() string { + if t == nil || t.Status == nil { + return "" + } + return *t.Status +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (t *Team) GetDescription() string { if t == nil || t.Description == nil { @@ -13851,3 +14123,379 @@ func (w *WeeklyStats) GetWeek() Timestamp { } return *w.Week } + +// GetBadgeURL returns the BadgeURL field if it's non-nil, zero value otherwise. +func (w *Workflow) GetBadgeURL() string { + if w == nil || w.BadgeURL == nil { + return "" + } + return *w.BadgeURL +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (w *Workflow) GetCreatedAt() Timestamp { + if w == nil || w.CreatedAt == nil { + return Timestamp{} + } + return *w.CreatedAt +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (w *Workflow) GetHTMLURL() string { + if w == nil || w.HTMLURL == nil { + return "" + } + return *w.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (w *Workflow) GetID() int64 { + if w == nil || w.ID == nil { + return 0 + } + return *w.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (w *Workflow) GetName() string { + if w == nil || w.Name == nil { + return "" + } + return *w.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (w *Workflow) GetNodeID() string { + if w == nil || w.NodeID == nil { + return "" + } + return *w.NodeID +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (w *Workflow) GetPath() string { + if w == nil || w.Path == nil { + return "" + } + return *w.Path +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (w *Workflow) GetState() string { + if w == nil || w.State == nil { + return "" + } + return *w.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (w *Workflow) GetUpdatedAt() Timestamp { + if w == nil || w.UpdatedAt == nil { + return Timestamp{} + } + return *w.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (w *Workflow) GetURL() string { + if w == nil || w.URL == nil { + return "" + } + return *w.URL +} + +// GetCheckRunURL returns the CheckRunURL field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetCheckRunURL() string { + if w == nil || w.CheckRunURL == nil { + return "" + } + return *w.CheckRunURL +} + +// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetCompletedAt() Timestamp { + if w == nil || w.CompletedAt == nil { + return Timestamp{} + } + return *w.CompletedAt +} + +// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetConclusion() string { + if w == nil || w.Conclusion == nil { + return "" + } + return *w.Conclusion +} + +// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetHeadSHA() string { + if w == nil || w.HeadSHA == nil { + return "" + } + return *w.HeadSHA +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetHTMLURL() string { + if w == nil || w.HTMLURL == nil { + return "" + } + return *w.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetID() int64 { + if w == nil || w.ID == nil { + return 0 + } + return *w.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetName() string { + if w == nil || w.Name == nil { + return "" + } + return *w.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetNodeID() string { + if w == nil || w.NodeID == nil { + return "" + } + return *w.NodeID +} + +// GetRunID returns the RunID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunID() int64 { + if w == nil || w.RunID == nil { + return 0 + } + return *w.RunID +} + +// GetRunURL returns the RunURL field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunURL() string { + if w == nil || w.RunURL == nil { + return "" + } + return *w.RunURL +} + +// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetStartedAt() Timestamp { + if w == nil || w.StartedAt == nil { + return Timestamp{} + } + return *w.StartedAt +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetStatus() string { + if w == nil || w.Status == nil { + return "" + } + return *w.Status +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetURL() string { + if w == nil || w.URL == nil { + return "" + } + return *w.URL +} + +// GetArtifactsURL returns the ArtifactsURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetArtifactsURL() string { + if w == nil || w.ArtifactsURL == nil { + return "" + } + return *w.ArtifactsURL +} + +// GetCancelURL returns the CancelURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetCancelURL() string { + if w == nil || w.CancelURL == nil { + return "" + } + return *w.CancelURL +} + +// GetCheckSuiteURL returns the CheckSuiteURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetCheckSuiteURL() string { + if w == nil || w.CheckSuiteURL == nil { + return "" + } + return *w.CheckSuiteURL +} + +// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetConclusion() string { + if w == nil || w.Conclusion == nil { + return "" + } + return *w.Conclusion +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetCreatedAt() Timestamp { + if w == nil || w.CreatedAt == nil { + return Timestamp{} + } + return *w.CreatedAt +} + +// GetEvent returns the Event field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetEvent() string { + if w == nil || w.Event == nil { + return "" + } + return *w.Event +} + +// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetHeadBranch() string { + if w == nil || w.HeadBranch == nil { + return "" + } + return *w.HeadBranch +} + +// GetHeadCommit returns the HeadCommit field. +func (w *WorkflowRun) GetHeadCommit() *HeadCommit { + if w == nil { + return nil + } + return w.HeadCommit +} + +// GetHeadRepository returns the HeadRepository field. +func (w *WorkflowRun) GetHeadRepository() *Repository { + if w == nil { + return nil + } + return w.HeadRepository +} + +// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetHeadSHA() string { + if w == nil || w.HeadSHA == nil { + return "" + } + return *w.HeadSHA +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetHTMLURL() string { + if w == nil || w.HTMLURL == nil { + return "" + } + return *w.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetID() int64 { + if w == nil || w.ID == nil { + return 0 + } + return *w.ID +} + +// GetJobsURL returns the JobsURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetJobsURL() string { + if w == nil || w.JobsURL == nil { + return "" + } + return *w.JobsURL +} + +// GetLogsURL returns the LogsURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetLogsURL() string { + if w == nil || w.LogsURL == nil { + return "" + } + return *w.LogsURL +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetNodeID() string { + if w == nil || w.NodeID == nil { + return "" + } + return *w.NodeID +} + +// GetRepository returns the Repository field. +func (w *WorkflowRun) GetRepository() *Repository { + if w == nil { + return nil + } + return w.Repository +} + +// GetRerunURL returns the RerunURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetRerunURL() string { + if w == nil || w.RerunURL == nil { + return "" + } + return *w.RerunURL +} + +// GetRunNumber returns the RunNumber field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetRunNumber() int { + if w == nil || w.RunNumber == nil { + return 0 + } + return *w.RunNumber +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetStatus() string { + if w == nil || w.Status == nil { + return "" + } + return *w.Status +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetUpdatedAt() Timestamp { + if w == nil || w.UpdatedAt == nil { + return Timestamp{} + } + return *w.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetURL() string { + if w == nil || w.URL == nil { + return "" + } + return *w.URL +} + +// GetWorkflowURL returns the WorkflowURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetWorkflowURL() string { + if w == nil || w.WorkflowURL == nil { + return "" + } + return *w.WorkflowURL +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (w *WorkflowRuns) GetTotalCount() int { + if w == nil || w.TotalCount == nil { + return 0 + } + return *w.TotalCount +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (w *Workflows) GetTotalCount() int { + if w == nil || w.TotalCount == nil { + return 0 + } + return *w.TotalCount +} diff --git a/vendor/github.com/google/go-github/v29/github/github.go b/vendor/github.com/google/go-github/v31/github/github.go similarity index 97% rename from vendor/github.com/google/go-github/v29/github/github.go rename to vendor/github.com/google/go-github/v31/github/github.go index 696684b931..94f31a4c26 100644 --- a/vendor/github.com/google/go-github/v29/github/github.go +++ b/vendor/github.com/google/go-github/v31/github/github.go @@ -135,6 +135,12 @@ const ( // https://developer.github.com/changes/2019-10-03-multi-line-comments/ mediaTypeMultiLineCommentsPreview = "application/vnd.github.comfort-fade-preview+json" + + // https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/ + mediaTypeOAuthAppPreview = "application/vnd.github.doctor-strange-preview+json" + + // https://developer.github.com/changes/2019-12-03-internal-visibility-changes/ + mediaTypeRepositoryVisibilityPreview = "application/vnd.github.nebula-preview+json" ) // A Client manages communication with the GitHub API. @@ -293,7 +299,7 @@ func NewClient(httpClient *http.Client) *Client { // NewEnterpriseClient returns a new GitHub API client with provided // base URL and upload URL (often the same URL and is your GitHub Enterprise hostname). // If either URL does not have the suffix "/api/v3/", it will be added automatically. -// If a nil httpClient is provided, http.DefaultClient will be used. +// If a nil httpClient is provided, a new http.Client will be used. // // Note that NewEnterpriseClient is a convenience helper only; // its behavior is equivalent to using NewClient, followed by setting @@ -918,6 +924,24 @@ func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) return response.Resources, resp, nil } +func setCredentialsAsHeaders(req *http.Request, id, secret string) *http.Request { + // To set extra headers, we must make a copy of the Request so + // that we don't modify the Request we were given. This is required by the + // specification of http.RoundTripper. + // + // Since we are going to modify only req.Header here, we only need a deep copy + // of req.Header. + convertedRequest := new(http.Request) + *convertedRequest = *req + convertedRequest.Header = make(http.Header, len(req.Header)) + + for k, s := range req.Header { + convertedRequest.Header[k] = append([]string(nil), s...) + } + convertedRequest.SetBasicAuth(id, secret) + return convertedRequest +} + /* UnauthenticatedRateLimitedTransport allows you to make unauthenticated calls that need to use a higher rate limit associated with your OAuth application. @@ -928,8 +952,8 @@ that need to use a higher rate limit associated with your OAuth application. } client := github.NewClient(t.Client()) -This will append the querystring params client_id=xxx&client_secret=yyy to all -requests. +This will add the client id and secret as a base64-encoded string in the format +ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. See https://developer.github.com/v3/#unauthenticated-rate-limited-requests for more information. @@ -958,22 +982,7 @@ func (t *UnauthenticatedRateLimitedTransport) RoundTrip(req *http.Request) (*htt return nil, errors.New("t.ClientSecret is empty") } - // To set extra querystring params, we must make a copy of the Request so - // that we don't modify the Request we were given. This is required by the - // specification of http.RoundTripper. - // - // Since we are going to modify only req.URL here, we only need a deep copy - // of req.URL. - req2 := new(http.Request) - *req2 = *req - req2.URL = new(url.URL) - *req2.URL = *req.URL - - q := req2.URL.Query() - q.Set("client_id", t.ClientID) - q.Set("client_secret", t.ClientSecret) - req2.URL.RawQuery = q.Encode() - + req2 := setCredentialsAsHeaders(req, t.ClientID, t.ClientSecret) // Make the HTTP request. return t.transport().RoundTrip(req2) } @@ -1007,20 +1016,7 @@ type BasicAuthTransport struct { // RoundTrip implements the RoundTripper interface. func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) { - // To set extra headers, we must make a copy of the Request so - // that we don't modify the Request we were given. This is required by the - // specification of http.RoundTripper. - // - // Since we are going to modify only req.Header here, we only need a deep copy - // of req.Header. - req2 := new(http.Request) - *req2 = *req - req2.Header = make(http.Header, len(req.Header)) - for k, s := range req.Header { - req2.Header[k] = append([]string(nil), s...) - } - - req2.SetBasicAuth(t.Username, t.Password) + req2 := setCredentialsAsHeaders(req, t.Username, t.Password) if t.OTP != "" { req2.Header.Set(headerOTP, t.OTP) } diff --git a/vendor/github.com/google/go-github/v29/github/gitignore.go b/vendor/github.com/google/go-github/v31/github/gitignore.go similarity index 88% rename from vendor/github.com/google/go-github/v29/github/gitignore.go rename to vendor/github.com/google/go-github/v31/github/gitignore.go index 2f691bc323..dc2eab757a 100644 --- a/vendor/github.com/google/go-github/v29/github/gitignore.go +++ b/vendor/github.com/google/go-github/v31/github/gitignore.go @@ -29,7 +29,7 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // // GitHub API docs: https://developer.github.com/v3/gitignore/#listing-available-templates -func (s GitignoresService) List(ctx context.Context) ([]string, *Response, error) { +func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { return nil, nil, err @@ -47,7 +47,7 @@ func (s GitignoresService) List(ctx context.Context) ([]string, *Response, error // Get a Gitignore by name. // // GitHub API docs: https://developer.github.com/v3/gitignore/#get-a-single-template -func (s GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { +func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v29/github/interactions.go b/vendor/github.com/google/go-github/v31/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/interactions.go rename to vendor/github.com/google/go-github/v31/github/interactions.go diff --git a/vendor/github.com/google/go-github/v29/github/interactions_orgs.go b/vendor/github.com/google/go-github/v31/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v31/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v29/github/interactions_repos.go b/vendor/github.com/google/go-github/v31/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/interactions_repos.go rename to vendor/github.com/google/go-github/v31/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v29/github/issues.go b/vendor/github.com/google/go-github/v31/github/issues.go similarity index 82% rename from vendor/github.com/google/go-github/v29/github/issues.go rename to vendor/github.com/google/go-github/v31/github/issues.go index 63a5fde75c..ccce80abc7 100644 --- a/vendor/github.com/google/go-github/v29/github/issues.go +++ b/vendor/github.com/google/go-github/v31/github/issues.go @@ -26,36 +26,37 @@ type IssuesService service // this is an issue, and if PullRequestLinks is not nil, this is a pull request. // The IsPullRequest helper method can be used to check that. type Issue struct { - ID *int64 `json:"id,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - Locked *bool `json:"locked,omitempty"` - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` - User *User `json:"user,omitempty"` - Labels []Label `json:"labels,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Comments *int `json:"comments,omitempty"` - ClosedAt *time.Time `json:"closed_at,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - ClosedBy *User `json:"closed_by,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - EventsURL *string `json:"events_url,omitempty"` - LabelsURL *string `json:"labels_url,omitempty"` - RepositoryURL *string `json:"repository_url,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"` - Repository *Repository `json:"repository,omitempty"` - Reactions *Reactions `json:"reactions,omitempty"` - Assignees []*User `json:"assignees,omitempty"` - NodeID *string `json:"node_id,omitempty"` + ID *int64 `json:"id,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + Locked *bool `json:"locked,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + AuthorAssociation *string `json:"author_association,omitempty"` + User *User `json:"user,omitempty"` + Labels []*Label `json:"labels,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Comments *int `json:"comments,omitempty"` + ClosedAt *time.Time `json:"closed_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + ClosedBy *User `json:"closed_by,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + EventsURL *string `json:"events_url,omitempty"` + LabelsURL *string `json:"labels_url,omitempty"` + RepositoryURL *string `json:"repository_url,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` + Assignees []*User `json:"assignees,omitempty"` + NodeID *string `json:"node_id,omitempty"` // TextMatches is only populated from search results that request text matches // See: search.go and https://developer.github.com/v3/search/#text-match-metadata - TextMatches []TextMatch `json:"text_matches,omitempty"` + TextMatches []*TextMatch `json:"text_matches,omitempty"` // ActiveLockReason is populated only when LockReason is provided while locking the issue. // Possible values are: "off-topic", "too heated", "resolved", and "spam". @@ -128,7 +129,8 @@ type PullRequestLinks struct { // organization repositories; if false, list only owned and member // repositories. // -// GitHub API docs: https://developer.github.com/v3/issues/#list-issues +// GitHub API docs: https://developer.github.com/v3/issues/#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://developer.github.com/v3/issues/#list-user-account-issues-assigned-to-the-authenticated-user func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { @@ -142,7 +144,7 @@ func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptio // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://developer.github.com/v3/issues/#list-issues +// GitHub API docs: https://developer.github.com/v3/issues/#list-organization-issues-assigned-to-the-authenticated-user func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(ctx, u, opts) @@ -214,7 +216,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://developer.github.com/v3/issues/#list-issues-for-a-repository +// GitHub API docs: https://developer.github.com/v3/issues/#list-repository-issues func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) @@ -242,7 +244,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // Get a single issue. // -// GitHub API docs: https://developer.github.com/v3/issues/#get-a-single-issue +// GitHub API docs: https://developer.github.com/v3/issues/#get-an-issue func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -284,7 +286,7 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i // Edit an issue. // -// GitHub API docs: https://developer.github.com/v3/issues/#edit-an-issue +// GitHub API docs: https://developer.github.com/v3/issues/#update-an-issue func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) diff --git a/vendor/github.com/google/go-github/v29/github/issues_assignees.go b/vendor/github.com/google/go-github/v31/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/issues_assignees.go rename to vendor/github.com/google/go-github/v31/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v29/github/issues_comments.go b/vendor/github.com/google/go-github/v31/github/issues_comments.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/issues_comments.go rename to vendor/github.com/google/go-github/v31/github/issues_comments.go index 56b24c1917..5e5a754744 100644 --- a/vendor/github.com/google/go-github/v29/github/issues_comments.go +++ b/vendor/github.com/google/go-github/v31/github/issues_comments.go @@ -50,6 +50,7 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // +// GitHub API docs: https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository // GitHub API docs: https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string diff --git a/vendor/github.com/google/go-github/v29/github/issues_events.go b/vendor/github.com/google/go-github/v31/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/issues_events.go rename to vendor/github.com/google/go-github/v31/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v29/github/issues_labels.go b/vendor/github.com/google/go-github/v31/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/issues_labels.go rename to vendor/github.com/google/go-github/v31/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v29/github/issues_milestones.go b/vendor/github.com/google/go-github/v31/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/issues_milestones.go rename to vendor/github.com/google/go-github/v31/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v29/github/issues_timeline.go b/vendor/github.com/google/go-github/v31/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/issues_timeline.go rename to vendor/github.com/google/go-github/v31/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v29/github/licenses.go b/vendor/github.com/google/go-github/v31/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/licenses.go rename to vendor/github.com/google/go-github/v31/github/licenses.go diff --git a/vendor/github.com/google/go-github/v29/github/messages.go b/vendor/github.com/google/go-github/v31/github/messages.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/messages.go rename to vendor/github.com/google/go-github/v31/github/messages.go diff --git a/vendor/github.com/google/go-github/v29/github/migrations.go b/vendor/github.com/google/go-github/v31/github/migrations.go similarity index 92% rename from vendor/github.com/google/go-github/v29/github/migrations.go rename to vendor/github.com/google/go-github/v31/github/migrations.go index f4260bb77c..86b7c2789e 100644 --- a/vendor/github.com/google/go-github/v29/github/migrations.go +++ b/vendor/github.com/google/go-github/v31/github/migrations.go @@ -74,7 +74,7 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://developer.github.com/v3/migration/migrations/#start-a-migration +// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#start-an-organization-migration func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) @@ -103,7 +103,7 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#get-a-list-of-organization-migrations +// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#list-organization-migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) u, err := addOptions(u, opts) @@ -131,7 +131,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://developer.github.com/v3/migration/migrations/#get-the-status-of-a-migration +// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#get-the-status-of-an-organization-migration func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) @@ -155,7 +155,7 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://developer.github.com/v3/migration/migrations/#download-a-migration-archive +// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#download-an-organization-migration-archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -192,7 +192,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://developer.github.com/v3/migration/migrations/#delete-a-migration-archive +// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#delete-an-organization-migration-archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -212,7 +212,7 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://developer.github.com/v3/migration/migrations/#unlock-a-repository +// GitHub API docs: https://developer.github.com/v3/migrations/orgs/#unlock-an-organization-repository func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) diff --git a/vendor/github.com/google/go-github/v29/github/migrations_source_import.go b/vendor/github.com/google/go-github/v31/github/migrations_source_import.go similarity index 92% rename from vendor/github.com/google/go-github/v29/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v31/github/migrations_source_import.go index 080a5503f6..3980dc902c 100644 --- a/vendor/github.com/google/go-github/v29/github/migrations_source_import.go +++ b/vendor/github.com/google/go-github/v31/github/migrations_source_import.go @@ -106,7 +106,7 @@ type Import struct { // When the importer finds several projects or repositories at the // provided URLs, this will identify the available choices. Call // UpdateImport with the selected Import value. - ProjectChoices []Import `json:"project_choices,omitempty"` + ProjectChoices []*Import `json:"project_choices,omitempty"` } func (i Import) String() string { @@ -146,7 +146,7 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#start-an-import +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#start-an-import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PUT", u, in) @@ -165,7 +165,7 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-import-progress +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#get-import-progress func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -184,7 +184,7 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#update-existing-import +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#update-existing-import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -213,7 +213,7 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-commit-authors +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#get-commit-authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -234,7 +234,7 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#map-a-commit-author +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#map-a-commit-author func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, author) @@ -255,7 +255,7 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#set-git-lfs-preference +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#set-git-lfs-preference func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -274,7 +274,7 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-large-files +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#get-large-files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -293,7 +293,7 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://developer.github.com/v3/migration/source_imports/#cancel-an-import +// GitHub API docs: https://developer.github.com/v3/migrations/source_imports/#cancel-an-import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/migrations_user.go b/vendor/github.com/google/go-github/v31/github/migrations_user.go similarity index 99% rename from vendor/github.com/google/go-github/v29/github/migrations_user.go rename to vendor/github.com/google/go-github/v31/github/migrations_user.go index 5b58d29354..5224d7b844 100644 --- a/vendor/github.com/google/go-github/v29/github/migrations_user.go +++ b/vendor/github.com/google/go-github/v31/github/migrations_user.go @@ -96,7 +96,7 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://developer.github.com/v3/migrations/users/#get-a-list-of-user-migrations +// GitHub API docs: https://developer.github.com/v3/migrations/users/#list-user-migrations func (s *MigrationService) ListUserMigrations(ctx context.Context) ([]*UserMigration, *Response, error) { u := "user/migrations" diff --git a/vendor/github.com/google/go-github/v29/github/misc.go b/vendor/github.com/google/go-github/v31/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/misc.go rename to vendor/github.com/google/go-github/v31/github/misc.go diff --git a/vendor/github.com/google/go-github/v29/github/orgs.go b/vendor/github.com/google/go-github/v31/github/orgs.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/orgs.go rename to vendor/github.com/google/go-github/v31/github/orgs.go index 3c87ec84d4..564231bc41 100644 --- a/vendor/github.com/google/go-github/v29/github/orgs.go +++ b/vendor/github.com/google/go-github/v31/github/orgs.go @@ -145,6 +145,7 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // organizations for the authenticated user. // // GitHub API docs: https://developer.github.com/v3/orgs/#list-user-organizations +// GitHub API docs: https://developer.github.com/v3/orgs/#oauth-scope-requirements func (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) { var u string if user != "" { @@ -214,7 +215,7 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza // Edit an organization. // -// GitHub API docs: https://developer.github.com/v3/orgs/#edit-an-organization +// GitHub API docs: https://developer.github.com/v3/orgs/#members_can_create_repositories func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) req, err := s.client.NewRequest("PATCH", u, org) diff --git a/vendor/github.com/google/go-github/v29/github/orgs_hooks.go b/vendor/github.com/google/go-github/v31/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v31/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v29/github/orgs_members.go b/vendor/github.com/google/go-github/v31/github/orgs_members.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/orgs_members.go rename to vendor/github.com/google/go-github/v31/github/orgs_members.go index 6b96d05f67..0dfa92070d 100644 --- a/vendor/github.com/google/go-github/v29/github/orgs_members.go +++ b/vendor/github.com/google/go-github/v31/github/orgs_members.go @@ -72,6 +72,7 @@ type ListMembersOptions struct { // public members, otherwise it will only return public members. // // GitHub API docs: https://developer.github.com/v3/orgs/members/#members-list +// GitHub API docs: https://developer.github.com/v3/orgs/members/#public-members-list func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) { var u string if opts != nil && opts.PublicOnly { @@ -206,9 +207,8 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: -// https://developer.github.com/v3/orgs/members/#get-organization-membership -// https://developer.github.com/v3/orgs/members/#get-your-organization-membership +// GitHub API docs: https://developer.github.com/v3/orgs/members/#get-organization-membership +// GitHub API docs: https://developer.github.com/v3/orgs/members/#get-your-organization-membership func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) { var u string if user != "" { @@ -322,7 +322,7 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// https://developer.github.com/v3/orgs/members/#create-organization-invitation +// GitHub API docs: https://developer.github.com/v3/orgs/members/#create-organization-invitation func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) diff --git a/vendor/github.com/google/go-github/v29/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v31/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v31/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v29/github/orgs_projects.go b/vendor/github.com/google/go-github/v31/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/orgs_projects.go rename to vendor/github.com/google/go-github/v31/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v29/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v31/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v31/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v29/github/projects.go b/vendor/github.com/google/go-github/v31/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/projects.go rename to vendor/github.com/google/go-github/v31/github/projects.go diff --git a/vendor/github.com/google/go-github/v29/github/pulls.go b/vendor/github.com/google/go-github/v31/github/pulls.go similarity index 99% rename from vendor/github.com/google/go-github/v29/github/pulls.go rename to vendor/github.com/google/go-github/v31/github/pulls.go index bd799cede1..019432659a 100644 --- a/vendor/github.com/google/go-github/v29/github/pulls.go +++ b/vendor/github.com/google/go-github/v31/github/pulls.go @@ -214,6 +214,8 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string } // GetRaw gets a single pull request in raw (diff or patch) format. +// +// GitHub API docs: https://developer.github.com/v3/pulls/#get-a-single-pull-request func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -449,7 +451,7 @@ type PullRequestOptions struct { } type pullRequestMergeRequest struct { - CommitMessage string `json:"commit_message"` + CommitMessage string `json:"commit_message,omitempty"` CommitTitle string `json:"commit_title,omitempty"` MergeMethod string `json:"merge_method,omitempty"` SHA string `json:"sha,omitempty"` @@ -458,7 +460,7 @@ type pullRequestMergeRequest struct { // Merge a pull request (Merge Button™). // commitMessage is the title for the automatic commit message. // -// GitHub API docs: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-buttontrade +// GitHub API docs: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) diff --git a/vendor/github.com/google/go-github/v29/github/pulls_comments.go b/vendor/github.com/google/go-github/v31/github/pulls_comments.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/pulls_comments.go rename to vendor/github.com/google/go-github/v31/github/pulls_comments.go index 88fb209b6f..741454aeef 100644 --- a/vendor/github.com/google/go-github/v29/github/pulls_comments.go +++ b/vendor/github.com/google/go-github/v31/github/pulls_comments.go @@ -66,6 +66,7 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // +// GitHub API docs: https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository // GitHub API docs: https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request func (s *PullRequestsService) ListComments(ctx context.Context, owner string, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) { var u string @@ -144,7 +145,7 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner string, r // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://developer.github.com/v3/pulls/comments/#alternative-input +// GitHub API docs: https://developer.github.com/v3/pulls/comments/#create-a-comment func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner string, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { comment := &struct { Body string `json:"body,omitempty"` diff --git a/vendor/github.com/google/go-github/v29/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v31/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v31/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v29/github/pulls_reviews.go b/vendor/github.com/google/go-github/v31/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v31/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v29/github/reactions.go b/vendor/github.com/google/go-github/v31/github/reactions.go similarity index 62% rename from vendor/github.com/google/go-github/v29/github/reactions.go rename to vendor/github.com/google/go-github/v31/github/reactions.go index 43c863af61..ce0a751829 100644 --- a/vendor/github.com/google/go-github/v29/github/reactions.go +++ b/vendor/github.com/google/go-github/v31/github/reactions.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/http" ) // ReactionsService provides access to the reactions-related functions in the @@ -88,7 +89,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment -func (s ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { +func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) body := &Reaction{Content: String(content)} @@ -109,6 +110,24 @@ func (s ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo return m, resp, nil } +// DeleteCommentReaction deletes the reaction for a commit comment. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-a-commit-comment-reaction +func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-a-commit-comment-reaction +func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, u) +} + // ListIssueReactions lists the reactions for an issue. // // GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-an-issue @@ -142,7 +161,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue -func (s ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { +func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) body := &Reaction{Content: String(content)} @@ -163,6 +182,24 @@ func (s ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo s return m, resp, nil } +// DeleteIssueReaction deletes the reaction to an issue. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-an-issue-reaction +func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-an-issue-reaction +func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + // ListIssueCommentReactions lists the reactions for an issue comment. // // GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment @@ -196,7 +233,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment -func (s ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { +func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) body := &Reaction{Content: String(content)} @@ -217,9 +254,27 @@ func (s ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, return m, resp, nil } +// DeleteIssueCommentReaction deletes the reaction to an issue comment. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-an-issue-comment-reaction +func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-an-issue-comment-reaction +func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment +// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -249,8 +304,8 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // -// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment -func (s ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { +// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment +func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) body := &Reaction{Content: String(content)} @@ -271,9 +326,27 @@ func (s ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, return m, resp, nil } +// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-a-pull-request-comment-reaction +func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-a-pull-request-comment-reaction +func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + // ListTeamDiscussionReactions lists the reactions for a team discussion. // -// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion +// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -300,7 +373,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // CreateTeamDiscussionReaction creates a reaction for a team discussion. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // -// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion +// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -321,9 +394,27 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea return m, resp, nil } +// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-team-discussion-reaction +func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-team-discussion-reaction +func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // -// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment +// GitHub API docs: https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -349,7 +440,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". // -// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment +// GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -370,18 +461,31 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte return m, resp, nil } -// DeleteReaction deletes a reaction. +// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. +// +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-team-discussion-comment-reaction +func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // -// GitHub API docs: https://developer.github.com/v3/reaction/reactions/#delete-a-reaction-archive -func (s *ReactionsService) DeleteReaction(ctx context.Context, id int64) (*Response, error) { - u := fmt.Sprintf("reactions/%v", id) +// GitHub API docs: https://developer.github.com/v3/reactions/#delete-team-discussion-comment-reaction +func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - req, err := s.client.NewRequest("DELETE", u, nil) + return s.deleteReaction(ctx, url) +} + +func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest(http.MethodDelete, url, nil) if err != nil { return nil, err } - // TODO: remove custom Accept header when this API fully launches. + // TODO: remove custom Accept headers when APIs fully launch. req.Header.Set("Accept", mediaTypeReactionsPreview) return s.client.Do(ctx, req, nil) diff --git a/vendor/github.com/google/go-github/v29/github/repos.go b/vendor/github.com/google/go-github/v31/github/repos.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/repos.go rename to vendor/github.com/google/go-github/v31/github/repos.go index 5aa56006ee..1014d91f44 100644 --- a/vendor/github.com/google/go-github/v29/github/repos.go +++ b/vendor/github.com/google/go-github/v31/github/repos.go @@ -120,7 +120,12 @@ type Repository struct { // TextMatches is only populated from search results that request text matches // See: search.go and https://developer.github.com/v3/search/#text-match-metadata - TextMatches []TextMatch `json:"text_matches,omitempty"` + TextMatches []*TextMatch `json:"text_matches,omitempty"` + + // Visibility is only used for Create and Edit endpoints. The visibility field + // overrides the field parameter when both are used. + // Can be one of public, private or internal. + Visibility *string `json:"visibility,omitempty"` } func (r Repository) String() string { @@ -177,7 +182,8 @@ type RepositoryListOptions struct { // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // -// GitHub API docs: https://developer.github.com/v3/repos/#list-user-repositories +// GitHub API docs: https://developer.github.com/v3/repos/#list-repositories-for-a-user +// GitHub API docs: https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -263,7 +269,7 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://developer.github.com/v3/repos/#list-all-public-repositories +// GitHub API docs: https://developer.github.com/v3/repos/#list-public-repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { u, err := addOptions("repositories", opts) if err != nil { @@ -295,11 +301,12 @@ type createRepoRequest struct { Description *string `json:"description,omitempty"` Homepage *string `json:"homepage,omitempty"` - Private *bool `json:"private,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasProjects *bool `json:"has_projects,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - IsTemplate *bool `json:"is_template,omitempty"` + Private *bool `json:"private,omitempty"` + Visibility *string `json:"visibility,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasProjects *bool `json:"has_projects,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + IsTemplate *bool `json:"is_template,omitempty"` // Creating an organization repository. Required for non-owners. TeamID *int64 `json:"team_id,omitempty"` @@ -320,7 +327,8 @@ type createRepoRequest struct { // Note that only a subset of the repo fields are used and repo must // not be nil. // -// GitHub API docs: https://developer.github.com/v3/repos/#create +// GitHub API docs: https://developer.github.com/v3/repos/#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://developer.github.com/v3/repos/#create-an-organization-repository func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string if org != "" { @@ -334,6 +342,7 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo Description: repo.Description, Homepage: repo.Homepage, Private: repo.Private, + Visibility: repo.Visibility, HasIssues: repo.HasIssues, HasProjects: repo.HasProjects, HasWiki: repo.HasWiki, @@ -353,7 +362,8 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo return nil, nil, err } - req.Header.Set("Accept", mediaTypeRepositoryTemplatePreview) + acceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) r := new(Repository) resp, err := s.client.Do(ctx, req, r) if err != nil { @@ -375,7 +385,7 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://developer.github.com/v3/repos/#create-repository-using-a-repository-template +// GitHub API docs: https://developer.github.com/v3/repos/#create-a-repository-using-a-template func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) @@ -396,7 +406,7 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/#get +// GitHub API docs: https://developer.github.com/v3/repos/#get-a-repository func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -406,7 +416,12 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep // TODO: remove custom Accept header when the license support fully launches // https://developer.github.com/v3/licenses/#get-a-repositorys-license - acceptHeaders := []string{mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, mediaTypeRepositoryTemplatePreview} + acceptHeaders := []string{ + mediaTypeCodesOfConductPreview, + mediaTypeTopicsPreview, + mediaTypeRepositoryTemplatePreview, + mediaTypeRepositoryVisibilityPreview, + } req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) repository := new(Repository) @@ -461,7 +476,7 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/#edit +// GitHub API docs: https://developer.github.com/v3/repos/#update-a-repository func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("PATCH", u, repository) @@ -469,7 +484,8 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo return nil, nil, err } - req.Header.Set("Accept", mediaTypeRepositoryTemplatePreview) + acceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) r := new(Repository) resp, err := s.client.Do(ctx, req, r) if err != nil { @@ -884,7 +900,7 @@ type SignaturesProtectedBranch struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://developer.github.com/v3/repos/#list-branches +// GitHub API docs: https://developer.github.com/v3/repos/branches/#list-branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) @@ -911,7 +927,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/#get-branch +// GitHub API docs: https://developer.github.com/v3/repos/branches/#get-branch func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1290,7 +1306,7 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/#list-all-topics-for-a-repository +// GitHub API docs: https://developer.github.com/v3/repos/#get-all-repository-topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1312,7 +1328,7 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces topics for a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository +// GitHub API docs: https://developer.github.com/v3/repos/#replace-all-repository-topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) t := &repositoryTopics{ diff --git a/vendor/github.com/google/go-github/v29/github/repos_collaborators.go b/vendor/github.com/google/go-github/v31/github/repos_collaborators.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v31/github/repos_collaborators.go index bdfe04f13f..e461516cae 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_collaborators.go +++ b/vendor/github.com/google/go-github/v31/github/repos_collaborators.go @@ -68,7 +68,7 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://developer.github.com/v3/repos/collaborators/#get +// GitHub API docs: https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -141,7 +141,7 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://developer.github.com/v3/repos/collaborators/#remove-collaborator +// GitHub API docs: https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/repos_comments.go b/vendor/github.com/google/go-github/v31/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_comments.go rename to vendor/github.com/google/go-github/v31/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_commits.go b/vendor/github.com/google/go-github/v31/github/repos_commits.go similarity index 90% rename from vendor/github.com/google/go-github/v29/github/repos_commits.go rename to vendor/github.com/google/go-github/v31/github/repos_commits.go index a4ff2be4b9..4db577085a 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v31/github/repos_commits.go @@ -9,7 +9,6 @@ import ( "bytes" "context" "fmt" - "net/url" "time" ) @@ -17,20 +16,20 @@ import ( // Note that it's wrapping a Commit, so author/committer information is in two places, // but contain different details about them: in RepositoryCommit "github details", in Commit - "git details". type RepositoryCommit struct { - NodeID *string `json:"node_id,omitempty"` - SHA *string `json:"sha,omitempty"` - Commit *Commit `json:"commit,omitempty"` - Author *User `json:"author,omitempty"` - Committer *User `json:"committer,omitempty"` - Parents []Commit `json:"parents,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - URL *string `json:"url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` + NodeID *string `json:"node_id,omitempty"` + SHA *string `json:"sha,omitempty"` + Commit *Commit `json:"commit,omitempty"` + Author *User `json:"author,omitempty"` + Committer *User `json:"committer,omitempty"` + Parents []*Commit `json:"parents,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + URL *string `json:"url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` // Details about how many changes were made in this commit. Only filled in during GetCommit! Stats *CommitStats `json:"stats,omitempty"` // Details about which files, and how this commit touched. Only filled in during GetCommit! - Files []CommitFile `json:"files,omitempty"` + Files []*CommitFile `json:"files,omitempty"` } func (r RepositoryCommit) String() string { @@ -79,9 +78,9 @@ type CommitsComparison struct { BehindBy *int `json:"behind_by,omitempty"` TotalCommits *int `json:"total_commits,omitempty"` - Commits []RepositoryCommit `json:"commits,omitempty"` + Commits []*RepositoryCommit `json:"commits,omitempty"` - Files []CommitFile `json:"files,omitempty"` + Files []*CommitFile `json:"files,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PermalinkURL *string `json:"permalink_url,omitempty"` @@ -124,7 +123,7 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/commits/#list +// GitHub API docs: https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits", owner, repo) u, err := addOptions(u, opts) @@ -168,6 +167,8 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st } // GetCommitRaw fetches the specified commit in raw (diff or patch) format. +// +// GitHub API docs: https://developer.github.com/v3/repos/commits/#get-a-single-commit func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -196,9 +197,9 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://developer.github.com/v3/repos/commits/#get-the-sha-1-of-a-commit-reference +// GitHub API docs: https://developer.github.com/v3/repos/commits/#get-a-single-commit func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v29/github/repos_community_health.go b/vendor/github.com/google/go-github/v31/github/repos_community_health.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/repos_community_health.go rename to vendor/github.com/google/go-github/v31/github/repos_community_health.go index 73d1d573bf..e8775a6c15 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_community_health.go +++ b/vendor/github.com/google/go-github/v31/github/repos_community_health.go @@ -38,7 +38,7 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/community/#retrieve-community-health-metrics +// GitHub API docs: https://developer.github.com/v3/repos/community/#retrieve-community-profile-metrics func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/repos_contents.go b/vendor/github.com/google/go-github/v31/github/repos_contents.go similarity index 99% rename from vendor/github.com/google/go-github/v29/github/repos_contents.go rename to vendor/github.com/google/go-github/v31/github/repos_contents.go index ede93e4f4b..015d9471a5 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v31/github/repos_contents.go @@ -177,7 +177,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://developer.github.com/v3/repos/contents/#create-a-file +// GitHub API docs: https://developer.github.com/v3/repos/contents/#create-or-update-a-file func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -195,7 +195,7 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://developer.github.com/v3/repos/contents/#update-a-file +// GitHub API docs: https://developer.github.com/v3/repos/contents/#create-or-update-a-file func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) diff --git a/vendor/github.com/google/go-github/v29/github/repos_deployments.go b/vendor/github.com/google/go-github/v31/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_deployments.go rename to vendor/github.com/google/go-github/v31/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_forks.go b/vendor/github.com/google/go-github/v31/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_forks.go rename to vendor/github.com/google/go-github/v31/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_hooks.go b/vendor/github.com/google/go-github/v31/github/repos_hooks.go similarity index 90% rename from vendor/github.com/google/go-github/v29/github/repos_hooks.go rename to vendor/github.com/google/go-github/v31/github/repos_hooks.go index 8672822384..d81e74c9cf 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v31/github/repos_hooks.go @@ -19,18 +19,18 @@ import ( // // GitHub API docs: https://help.github.com/articles/post-receive-hooks type WebHookPayload struct { - After *string `json:"after,omitempty"` - Before *string `json:"before,omitempty"` - Commits []WebHookCommit `json:"commits,omitempty"` - Compare *string `json:"compare,omitempty"` - Created *bool `json:"created,omitempty"` - Deleted *bool `json:"deleted,omitempty"` - Forced *bool `json:"forced,omitempty"` - HeadCommit *WebHookCommit `json:"head_commit,omitempty"` - Pusher *User `json:"pusher,omitempty"` - Ref *string `json:"ref,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Sender *User `json:"sender,omitempty"` + After *string `json:"after,omitempty"` + Before *string `json:"before,omitempty"` + Commits []*WebHookCommit `json:"commits,omitempty"` + Compare *string `json:"compare,omitempty"` + Created *bool `json:"created,omitempty"` + Deleted *bool `json:"deleted,omitempty"` + Forced *bool `json:"forced,omitempty"` + HeadCommit *WebHookCommit `json:"head_commit,omitempty"` + Pusher *User `json:"pusher,omitempty"` + Ref *string `json:"ref,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` } func (w WebHookPayload) String() string { @@ -131,7 +131,7 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string // ListHooks lists all Hooks for the specified repository. // -// GitHub API docs: https://developer.github.com/v3/repos/hooks/#list +// GitHub API docs: https://developer.github.com/v3/repos/hooks/#list-hooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) u, err := addOptions(u, opts) diff --git a/vendor/github.com/google/go-github/v29/github/repos_invitations.go b/vendor/github.com/google/go-github/v31/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_invitations.go rename to vendor/github.com/google/go-github/v31/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_keys.go b/vendor/github.com/google/go-github/v31/github/repos_keys.go similarity index 81% rename from vendor/github.com/google/go-github/v29/github/repos_keys.go rename to vendor/github.com/google/go-github/v31/github/repos_keys.go index 64ee7422a0..0eefd3dd96 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_keys.go +++ b/vendor/github.com/google/go-github/v31/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/keys/#list +// GitHub API docs: https://developer.github.com/v3/repos/keys/#list-deploy-keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -38,7 +38,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // -// GitHub API docs: https://developer.github.com/v3/repos/keys/#get +// GitHub API docs: https://developer.github.com/v3/repos/keys/#get-a-deploy-key func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -58,7 +58,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://developer.github.com/v3/repos/keys/#create +// GitHub API docs: https://developer.github.com/v3/repos/keys/#add-a-new-deploy-key func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -76,29 +76,9 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo return k, resp, nil } -// EditKey edits a deploy key. -// -// GitHub API docs: https://developer.github.com/v3/repos/keys/#edit -func (s *RepositoriesService) EditKey(ctx context.Context, owner string, repo string, id int64, key *Key) (*Key, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) - - req, err := s.client.NewRequest("PATCH", u, key) - if err != nil { - return nil, nil, err - } - - k := new(Key) - resp, err := s.client.Do(ctx, req, k) - if err != nil { - return nil, resp, err - } - - return k, resp, nil -} - // DeleteKey deletes a deploy key. // -// GitHub API docs: https://developer.github.com/v3/repos/keys/#delete +// GitHub API docs: https://developer.github.com/v3/repos/keys/#remove-a-deploy-key func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/vendor/github.com/google/go-github/v29/github/repos_merging.go b/vendor/github.com/google/go-github/v31/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_merging.go rename to vendor/github.com/google/go-github/v31/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_pages.go b/vendor/github.com/google/go-github/v31/github/repos_pages.go similarity index 84% rename from vendor/github.com/google/go-github/v29/github/repos_pages.go rename to vendor/github.com/google/go-github/v31/github/repos_pages.go index ff8d2d55b9..bdbd84b6c0 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v31/github/repos_pages.go @@ -75,6 +75,35 @@ func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo strin return enable, resp, nil } +// PagesUpdate sets up parameters needed to update a GitHub Pages site. +type PagesUpdate struct { + // CNAME represents a custom domain for the repository. + // Leaving CNAME empty will remove the custom domain. + CNAME *string `json:"cname"` + // Source must include the branch name, and may optionally specify the subdirectory "/docs". + // Possible values are: "gh-pages", "master", and "master /docs". + Source *string `json:"source,omitempty"` +} + +// UpdatePages updates GitHub Pages for the named repo. +// +// GitHub API docs: https://developer.github.com/v3/repos/pages/#update-information-about-a-pages-site +func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) + + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + // DisablePages disables GitHub Pages for the named repo. // // GitHub API docs: https://developer.github.com/v3/repos/pages/#disable-a-pages-site @@ -136,7 +165,7 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://developer.github.com/v3/repos/pages/#list-latest-pages-build +// GitHub API docs: https://developer.github.com/v3/repos/pages/#get-latest-pages-build func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -155,7 +184,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://developer.github.com/v3/repos/pages/#list-a-specific-pages-build +// GitHub API docs: https://developer.github.com/v3/repos/pages/#get-a-specific-pages-build func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v31/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v31/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_projects.go b/vendor/github.com/google/go-github/v31/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/repos_projects.go rename to vendor/github.com/google/go-github/v31/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v29/github/repos_releases.go b/vendor/github.com/google/go-github/v31/github/repos_releases.go similarity index 95% rename from vendor/github.com/google/go-github/v29/github/repos_releases.go rename to vendor/github.com/google/go-github/v31/github/repos_releases.go index 645f980a53..6cd64c7ff8 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v31/github/repos_releases.go @@ -27,18 +27,18 @@ type RepositoryRelease struct { Prerelease *bool `json:"prerelease,omitempty"` // The following fields are not used in CreateRelease or EditRelease: - ID *int64 `json:"id,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PublishedAt *Timestamp `json:"published_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - AssetsURL *string `json:"assets_url,omitempty"` - Assets []ReleaseAsset `json:"assets,omitempty"` - UploadURL *string `json:"upload_url,omitempty"` - ZipballURL *string `json:"zipball_url,omitempty"` - TarballURL *string `json:"tarball_url,omitempty"` - Author *User `json:"author,omitempty"` - NodeID *string `json:"node_id,omitempty"` + ID *int64 `json:"id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PublishedAt *Timestamp `json:"published_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + AssetsURL *string `json:"assets_url,omitempty"` + Assets []*ReleaseAsset `json:"assets,omitempty"` + UploadURL *string `json:"upload_url,omitempty"` + ZipballURL *string `json:"zipball_url,omitempty"` + TarballURL *string `json:"tarball_url,omitempty"` + Author *User `json:"author,omitempty"` + NodeID *string `json:"node_id,omitempty"` } func (r RepositoryRelease) String() string { diff --git a/vendor/github.com/google/go-github/v29/github/repos_stats.go b/vendor/github.com/google/go-github/v31/github/repos_stats.go similarity index 94% rename from vendor/github.com/google/go-github/v29/github/repos_stats.go rename to vendor/github.com/google/go-github/v31/github/repos_stats.go index bb355aeadd..0e257bad39 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_stats.go +++ b/vendor/github.com/google/go-github/v31/github/repos_stats.go @@ -14,9 +14,9 @@ import ( // ContributorStats represents a contributor to a repository and their // weekly contributions to a given repo. type ContributorStats struct { - Author *Contributor `json:"author,omitempty"` - Total *int `json:"total,omitempty"` - Weeks []WeeklyStats `json:"weeks,omitempty"` + Author *Contributor `json:"author,omitempty"` + Total *int `json:"total,omitempty"` + Weeks []*WeeklyStats `json:"weeks,omitempty"` } func (c ContributorStats) String() string { @@ -45,7 +45,7 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://developer.github.com/v3/repos/statistics/#contributors +// GitHub API docs: https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +84,7 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://developer.github.com/v3/repos/statistics/#commit-activity +// GitHub API docs: https://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity-data func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -111,7 +111,7 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://developer.github.com/v3/repos/statistics/#code-frequency +// GitHub API docs: https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -164,7 +164,7 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://developer.github.com/v3/repos/statistics/#participation +// GitHub API docs: https://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-count-for-the-repository-owner-and-everyone-else func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -197,7 +197,7 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://developer.github.com/v3/repos/statistics/#punch-card +// GitHub API docs: https://developer.github.com/v3/repos/statistics/#get-the-number-of-commits-per-hour-in-each-day func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/vendor/github.com/google/go-github/v29/github/repos_statuses.go b/vendor/github.com/google/go-github/v31/github/repos_statuses.go similarity index 91% rename from vendor/github.com/google/go-github/v29/github/repos_statuses.go rename to vendor/github.com/google/go-github/v31/github/repos_statuses.go index 5543265880..cd7e424174 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/v31/github/repos_statuses.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "net/url" "time" ) @@ -46,7 +45,7 @@ func (r RepoStatus) String() string { // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -71,7 +70,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#create-a-status func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("POST", u, status) if err != nil { return nil, nil, err @@ -92,10 +91,10 @@ type CombinedStatus struct { // failure, pending, or success. State *string `json:"state,omitempty"` - Name *string `json:"name,omitempty"` - SHA *string `json:"sha,omitempty"` - TotalCount *int `json:"total_count,omitempty"` - Statuses []RepoStatus `json:"statuses,omitempty"` + Name *string `json:"name,omitempty"` + SHA *string `json:"sha,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + Statuses []*RepoStatus `json:"statuses,omitempty"` CommitURL *string `json:"commit_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` @@ -110,7 +109,7 @@ func (s CombinedStatus) String() string { // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, url.QueryEscape(ref)) + u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v29/github/repos_traffic.go b/vendor/github.com/google/go-github/v31/github/repos_traffic.go similarity index 99% rename from vendor/github.com/google/go-github/v29/github/repos_traffic.go rename to vendor/github.com/google/go-github/v31/github/repos_traffic.go index e7ee18849a..91d8570628 100644 --- a/vendor/github.com/google/go-github/v29/github/repos_traffic.go +++ b/vendor/github.com/google/go-github/v31/github/repos_traffic.go @@ -118,7 +118,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://developer.github.com/v3/repos/traffic/#views +// GitHub API docs: https://developer.github.com/v3/repos/traffic/#clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/clones", owner, repo) u, err := addOptions(u, opts) diff --git a/vendor/github.com/google/go-github/v29/github/search.go b/vendor/github.com/google/go-github/v31/github/search.go similarity index 89% rename from vendor/github.com/google/go-github/v29/github/search.go rename to vendor/github.com/google/go-github/v31/github/search.go index 80587a3e76..c15c1f2b27 100644 --- a/vendor/github.com/google/go-github/v29/github/search.go +++ b/vendor/github.com/google/go-github/v31/github/search.go @@ -62,9 +62,9 @@ type searchParameters struct { // RepositoriesSearchResult represents the result of a repositories search. type RepositoriesSearchResult struct { - Total *int `json:"total_count,omitempty"` - IncompleteResults *bool `json:"incomplete_results,omitempty"` - Repositories []Repository `json:"items,omitempty"` + Total *int `json:"total_count,omitempty"` + IncompleteResults *bool `json:"incomplete_results,omitempty"` + Repositories []*Repository `json:"items,omitempty"` } // Repositories searches repositories via various criteria. @@ -140,14 +140,14 @@ func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchO // IssuesSearchResult represents the result of an issues search. type IssuesSearchResult struct { - Total *int `json:"total_count,omitempty"` - IncompleteResults *bool `json:"incomplete_results,omitempty"` - Issues []Issue `json:"items,omitempty"` + Total *int `json:"total_count,omitempty"` + IncompleteResults *bool `json:"incomplete_results,omitempty"` + Issues []*Issue `json:"items,omitempty"` } // Issues searches issues via various criteria. // -// GitHub API docs: https://developer.github.com/v3/search/#search-issues +// GitHub API docs: https://developer.github.com/v3/search/#search-issues-and-pull-requests func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -156,9 +156,9 @@ func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOp // UsersSearchResult represents the result of a users search. type UsersSearchResult struct { - Total *int `json:"total_count,omitempty"` - IncompleteResults *bool `json:"incomplete_results,omitempty"` - Users []User `json:"items,omitempty"` + Total *int `json:"total_count,omitempty"` + IncompleteResults *bool `json:"incomplete_results,omitempty"` + Users []*User `json:"items,omitempty"` } // Users searches users via various criteria. @@ -178,11 +178,11 @@ type Match struct { // TextMatch represents a text match for a SearchResult type TextMatch struct { - ObjectURL *string `json:"object_url,omitempty"` - ObjectType *string `json:"object_type,omitempty"` - Property *string `json:"property,omitempty"` - Fragment *string `json:"fragment,omitempty"` - Matches []Match `json:"matches,omitempty"` + ObjectURL *string `json:"object_url,omitempty"` + ObjectType *string `json:"object_type,omitempty"` + Property *string `json:"property,omitempty"` + Fragment *string `json:"fragment,omitempty"` + Matches []*Match `json:"matches,omitempty"` } func (tm TextMatch) String() string { @@ -191,19 +191,19 @@ func (tm TextMatch) String() string { // CodeSearchResult represents the result of a code search. type CodeSearchResult struct { - Total *int `json:"total_count,omitempty"` - IncompleteResults *bool `json:"incomplete_results,omitempty"` - CodeResults []CodeResult `json:"items,omitempty"` + Total *int `json:"total_count,omitempty"` + IncompleteResults *bool `json:"incomplete_results,omitempty"` + CodeResults []*CodeResult `json:"items,omitempty"` } // CodeResult represents a single search result. type CodeResult struct { - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - SHA *string `json:"sha,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - Repository *Repository `json:"repository,omitempty"` - TextMatches []TextMatch `json:"text_matches,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + SHA *string `json:"sha,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + Repository *Repository `json:"repository,omitempty"` + TextMatches []*TextMatch `json:"text_matches,omitempty"` } func (c CodeResult) String() string { diff --git a/vendor/github.com/google/go-github/v29/github/strings.go b/vendor/github.com/google/go-github/v31/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/strings.go rename to vendor/github.com/google/go-github/v31/github/strings.go diff --git a/vendor/github.com/google/go-github/v29/github/teams.go b/vendor/github.com/google/go-github/v31/github/teams.go similarity index 92% rename from vendor/github.com/google/go-github/v29/github/teams.go rename to vendor/github.com/google/go-github/v31/github/teams.go index cfb814e7db..6eab37fd54 100644 --- a/vendor/github.com/google/go-github/v29/github/teams.go +++ b/vendor/github.com/google/go-github/v31/github/teams.go @@ -461,7 +461,7 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://developer.github.com/v3/teams/#add-team-repo +// GitHub API docs: https://developer.github.com/v3/teams/#add-or-update-team-repository func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -476,7 +476,7 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://developer.github.com/v3/teams/#add-team-repo +// GitHub API docs: https://developer.github.com/v3/teams/#add-or-update-team-repository func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -491,7 +491,7 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://developer.github.com/v3/teams/#remove-team-repo +// GitHub API docs: https://developer.github.com/v3/teams/#remove-team-repository func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -506,7 +506,7 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://developer.github.com/v3/teams/#remove-team-repo +// GitHub API docs: https://developer.github.com/v3/teams/#remove-team-repository func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -765,11 +765,12 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri return groups, resp, nil } -// ListIDPGroupsForTeam lists IDP groups connected to a team on GitHub. +// ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub +// given organization and team IDs. // // 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) +func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -784,12 +785,53 @@ func (s *TeamsService) ListIDPGroupsForTeam(ctx context.Context, teamID string) return groups, resp, err } -// CreateOrUpdateIDPGroupConnections creates, updates, or removes a connection between a team -// and an IDP group. +// ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub +// given organization name and team slug. +// +// GitHub API docs: https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-a-team +func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + groups := new(IDPGroupList) + resp, err := s.client.Do(ctx, req, groups) + if err != nil { + return nil, resp, err + } + return groups, resp, err +} + +// CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection +// between a team and an IDP group given organization and team IDs. +// +// GitHub API docs: https://developer.github.com/v3/teams/team_sync/#create-or-update-idp-group-connections +func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + groups := new(IDPGroupList) + resp, err := s.client.Do(ctx, req, groups) + if err != nil { + return nil, resp, err + } + + return groups, resp, nil +} + +// CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection +// between a team and an IDP group given organization name and team slug. // // 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, opts IDPGroupList) (*IDPGroupList, *Response, error) { - u := fmt.Sprintf("teams/%v/team-sync/group-mappings", teamID) +func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) req, err := s.client.NewRequest("PATCH", u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v31/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v31/github/teams_discussion_comments.go new file mode 100644 index 0000000000..61b18f3098 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/teams_discussion_comments.go @@ -0,0 +1,242 @@ +// Copyright 2018 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" + "fmt" +) + +// DiscussionComment represents a GitHub dicussion in a team. +type DiscussionComment struct { + Author *User `json:"author,omitempty"` + Body *string `json:"body,omitempty"` + BodyHTML *string `json:"body_html,omitempty"` + BodyVersion *string `json:"body_version,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + LastEditedAt *Timestamp `json:"last_edited_at,omitempty"` + DiscussionURL *string `json:"discussion_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Number *int `json:"number,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` +} + +func (c DiscussionComment) String() string { + return Stringify(c) +} + +// DiscussionCommentListOptions specifies optional parameters to the +// TeamServices.ListComments method. +type DiscussionCommentListOptions struct { + // Sorts the discussion comments by the date they were created. + // Accepted values are asc and desc. Default is desc. + Direction string `url:"direction,omitempty"` + ListOptions +} + +// ListCommentsByID lists all comments on a team discussion by team ID. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#list-comments +func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) + u, err := addOptions(u, options) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var comments []*DiscussionComment + resp, err := s.client.Do(ctx, req, &comments) + if err != nil { + return nil, resp, err + } + + return comments, resp, nil +} + +// ListCommentsBySlug lists all comments on a team discussion by team slug. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#list-comments +func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) + u, err := addOptions(u, options) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var comments []*DiscussionComment + resp, err := s.client.Do(ctx, req, &comments) + if err != nil { + return nil, resp, err + } + + return comments, resp, nil +} + +// GetCommentByID gets a specific comment on a team discussion by team ID. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment +func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + discussionComment := &DiscussionComment{} + resp, err := s.client.Do(ctx, req, discussionComment) + if err != nil { + return nil, resp, err + } + + return discussionComment, resp, nil +} + +// GetCommentBySlug gets a specific comment on a team discussion by team slug. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment +func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + discussionComment := &DiscussionComment{} + resp, err := s.client.Do(ctx, req, discussionComment) + if err != nil { + return nil, resp, err + } + + return discussionComment, resp, nil +} + +// CreateCommentByID creates a new comment on a team discussion by team ID. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#create-a-comment +func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) + req, err := s.client.NewRequest("POST", u, comment) + if err != nil { + return nil, nil, err + } + + discussionComment := &DiscussionComment{} + resp, err := s.client.Do(ctx, req, discussionComment) + if err != nil { + return nil, resp, err + } + + return discussionComment, resp, nil +} + +// CreateCommentBySlug creates a new comment on a team discussion by team slug. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#create-a-comment +func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) + req, err := s.client.NewRequest("POST", u, comment) + if err != nil { + return nil, nil, err + } + + discussionComment := &DiscussionComment{} + resp, err := s.client.Do(ctx, req, discussionComment) + if err != nil { + return nil, resp, err + } + + return discussionComment, resp, nil +} + +// EditCommentByID edits the body text of a discussion comment by team ID. +// Authenticated user must grant write:discussion scope. +// User is allowed to edit body of a comment only. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment +func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) + req, err := s.client.NewRequest("PATCH", u, comment) + if err != nil { + return nil, nil, err + } + + discussionComment := &DiscussionComment{} + resp, err := s.client.Do(ctx, req, discussionComment) + if err != nil { + return nil, resp, err + } + + return discussionComment, resp, nil +} + +// EditCommentBySlug edits the body text of a discussion comment by team slug. +// Authenticated user must grant write:discussion scope. +// User is allowed to edit body of a comment only. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment +func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) + req, err := s.client.NewRequest("PATCH", u, comment) + if err != nil { + return nil, nil, err + } + + discussionComment := &DiscussionComment{} + resp, err := s.client.Do(ctx, req, discussionComment) + if err != nil { + return nil, resp, err + } + + return discussionComment, resp, nil +} + +// DeleteCommentByID deletes a comment on a team discussion by team ID. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment +func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// DeleteCommentBySlug deletes a comment on a team discussion by team slug. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment +func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v31/github/teams_discussions.go b/vendor/github.com/google/go-github/v31/github/teams_discussions.go new file mode 100644 index 0000000000..f0f2206ac9 --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/teams_discussions.go @@ -0,0 +1,247 @@ +// Copyright 2018 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" + "fmt" +) + +// TeamDiscussion represents a GitHub dicussion in a team. +type TeamDiscussion struct { + Author *User `json:"author,omitempty"` + Body *string `json:"body,omitempty"` + BodyHTML *string `json:"body_html,omitempty"` + BodyVersion *string `json:"body_version,omitempty"` + CommentsCount *int `json:"comments_count,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + LastEditedAt *Timestamp `json:"last_edited_at,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Number *int `json:"number,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + Private *bool `json:"private,omitempty"` + TeamURL *string `json:"team_url,omitempty"` + Title *string `json:"title,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` +} + +func (d TeamDiscussion) String() string { + return Stringify(d) +} + +// DiscussionListOptions specifies optional parameters to the +// TeamServices.ListDiscussions method. +type DiscussionListOptions struct { + // Sorts the discussion by the date they were created. + // Accepted values are asc and desc. Default is desc. + Direction string `url:"direction,omitempty"` + + ListOptions +} + +// ListDiscussionsByID lists all discussions on team's page given Organization and Team ID. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#list-discussions +func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var teamDiscussions []*TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussions) + if err != nil { + return nil, resp, err + } + + return teamDiscussions, resp, nil +} + +// ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#list-discussions +func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var teamDiscussions []*TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussions) + if err != nil { + return nil, resp, err + } + + return teamDiscussions, resp, nil +} + +// GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#get-a-single-discussion +func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + teamDiscussion := &TeamDiscussion{} + resp, err := s.client.Do(ctx, req, teamDiscussion) + if err != nil { + return nil, resp, err + } + + return teamDiscussion, resp, nil +} + +// GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug. +// Authenticated user must grant read:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#get-a-single-discussion +func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + teamDiscussion := &TeamDiscussion{} + resp, err := s.client.Do(ctx, req, teamDiscussion) + if err != nil { + return nil, resp, err + } + + return teamDiscussion, resp, nil +} + +// CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#create-a-discussion +func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) + req, err := s.client.NewRequest("POST", u, discussion) + if err != nil { + return nil, nil, err + } + + teamDiscussion := &TeamDiscussion{} + resp, err := s.client.Do(ctx, req, teamDiscussion) + if err != nil { + return nil, resp, err + } + + return teamDiscussion, resp, nil +} + +// CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#create-a-discussion +func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) + req, err := s.client.NewRequest("POST", u, discussion) + if err != nil { + return nil, nil, err + } + + teamDiscussion := &TeamDiscussion{} + resp, err := s.client.Do(ctx, req, teamDiscussion) + if err != nil { + return nil, resp, err + } + + return teamDiscussion, resp, nil +} + +// EditDiscussionByID edits the title and body text of a discussion post given Organization and Team ID. +// Authenticated user must grant write:discussion scope. +// User is allowed to change Title and Body of a discussion only. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#edit-a-discussion +func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) + req, err := s.client.NewRequest("PATCH", u, discussion) + if err != nil { + return nil, nil, err + } + + teamDiscussion := &TeamDiscussion{} + resp, err := s.client.Do(ctx, req, teamDiscussion) + if err != nil { + return nil, resp, err + } + + return teamDiscussion, resp, nil +} + +// EditDiscussionBySlug edits the title and body text of a discussion post given Organization name and Team's slug. +// Authenticated user must grant write:discussion scope. +// User is allowed to change Title and Body of a discussion only. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#edit-a-discussion +func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) + req, err := s.client.NewRequest("PATCH", u, discussion) + if err != nil { + return nil, nil, err + } + + teamDiscussion := &TeamDiscussion{} + resp, err := s.client.Do(ctx, req, teamDiscussion) + if err != nil { + return nil, resp, err + } + + return teamDiscussion, resp, nil +} + +// DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#delete-a-discussion +func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. +// Authenticated user must grant write:discussion scope. +// +// GitHub API docs: https://developer.github.com/v3/teams/discussions/#delete-a-discussion +func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v31/github/teams_members.go b/vendor/github.com/google/go-github/v31/github/teams_members.go new file mode 100644 index 0000000000..a29263e75c --- /dev/null +++ b/vendor/github.com/google/go-github/v31/github/teams_members.go @@ -0,0 +1,243 @@ +// Copyright 2018 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" + "fmt" +) + +// TeamListTeamMembersOptions specifies the optional parameters to the +// TeamsService.ListTeamMembers method. +type TeamListTeamMembersOptions struct { + // Role filters members returned by their role in the team. Possible + // values are "all", "member", "maintainer". Default is "all". + Role string `url:"role,omitempty"` + + ListOptions +} + +// ListTeamMembersByID lists all of the users who are members of a team, given a specified +// organization ID, by team ID. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#list-team-members +func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/members", orgID, teamID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var members []*User + resp, err := s.client.Do(ctx, req, &members) + if err != nil { + return nil, resp, err + } + + return members, resp, nil +} + +// ListTeamMembersBySlug lists all of the users who are members of a team, given a specified +// organization name, by team slug. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#list-team-members +func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/members", org, slug) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var members []*User + resp, err := s.client.Do(ctx, req, &members) + if err != nil { + return nil, resp, err + } + + return members, resp, nil +} + +// GetTeamMembershipByID returns the membership status for a user in a team, given a specified +// organization ID, by team ID. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#get-team-membership +func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + t := new(Membership) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified +// organization name, by team slug. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#get-team-membership +func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + t := new(Membership) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// TeamAddTeamMembershipOptions specifies the optional +// parameters to the TeamsService.AddTeamMembership method. +type TeamAddTeamMembershipOptions struct { + // Role specifies the role the user should have in the team. Possible + // values are: + // member - a normal member of the team + // maintainer - a team maintainer. Able to add/remove other team + // members, promote other team members to team + // maintainer, and edit the team’s name and description + // + // Default value is "member". + Role string `json:"role,omitempty"` +} + +// AddTeamMembership adds or invites a user to a team, given a specified +// organization ID, by team ID. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#add-or-update-team-membership +func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, nil, err + } + + t := new(Membership) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// AddTeamMembershipBySlug adds or invites a user to a team, given a specified +// organization name, by team slug. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#add-or-update-team-membership +func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, nil, err + } + + t := new(Membership) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + +// RemoveTeamMembership removes a user from a team, given a specified +// organization ID, by team ID. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#remove-team-membership +func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveTeamMembership removes a user from a team, given a specified +// organization name, by team slug. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#remove-team-membership +func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified +// organization ID, by team ID. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#list-pending-team-invitations +func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/invitations", orgID, teamID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var pendingInvitations []*Invitation + resp, err := s.client.Do(ctx, req, &pendingInvitations) + if err != nil { + return nil, resp, err + } + + return pendingInvitations, resp, nil +} + +// ListPendingTeamInvitationsByID get pending invitation list of a team, given a specified +// organization name, by team slug. +// +// GitHub API docs: https://developer.github.com/v3/teams/members/#list-pending-team-invitations +func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/invitations", org, slug) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var pendingInvitations []*Invitation + resp, err := s.client.Do(ctx, req, &pendingInvitations) + if err != nil { + return nil, resp, err + } + + return pendingInvitations, resp, nil +} diff --git a/vendor/github.com/google/go-github/v29/github/timestamp.go b/vendor/github.com/google/go-github/v31/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/timestamp.go rename to vendor/github.com/google/go-github/v31/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v29/github/users.go b/vendor/github.com/google/go-github/v31/github/users.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/users.go rename to vendor/github.com/google/go-github/v31/github/users.go index f7c77c61d8..97747f713c 100644 --- a/vendor/github.com/google/go-github/v29/github/users.go +++ b/vendor/github.com/google/go-github/v31/github/users.go @@ -63,7 +63,7 @@ type User struct { // TextMatches is only populated from search results that request text matches // See: search.go and https://developer.github.com/v3/search/#text-match-metadata - TextMatches []TextMatch `json:"text_matches,omitempty"` + TextMatches []*TextMatch `json:"text_matches,omitempty"` // Permissions identifies the permissions that a user has on a given // repository. This is only populated when calling Repositories.ListCollaborators. @@ -78,7 +78,7 @@ func (u User) String() string { // user. // // GitHub API docs: https://developer.github.com/v3/users/#get-a-single-user -// and: https://developer.github.com/v3/users/#get-the-authenticated-user +// GitHub API docs: https://developer.github.com/v3/users/#get-the-authenticated-user func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { diff --git a/vendor/github.com/google/go-github/v29/github/users_administration.go b/vendor/github.com/google/go-github/v31/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/users_administration.go rename to vendor/github.com/google/go-github/v31/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v29/github/users_blocking.go b/vendor/github.com/google/go-github/v31/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/users_blocking.go rename to vendor/github.com/google/go-github/v31/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v29/github/users_emails.go b/vendor/github.com/google/go-github/v31/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/users_emails.go rename to vendor/github.com/google/go-github/v31/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v29/github/users_followers.go b/vendor/github.com/google/go-github/v31/github/users_followers.go similarity index 91% rename from vendor/github.com/google/go-github/v29/github/users_followers.go rename to vendor/github.com/google/go-github/v31/github/users_followers.go index afa7d4b6b7..fa841c6c5d 100644 --- a/vendor/github.com/google/go-github/v29/github/users_followers.go +++ b/vendor/github.com/google/go-github/v31/github/users_followers.go @@ -14,6 +14,7 @@ import ( // fetch followers for the authenticated user. // // GitHub API docs: https://developer.github.com/v3/users/followers/#list-followers-of-a-user +// GitHub API docs: https://developer.github.com/v3/users/followers/#list-followers-of-the-authenticated-user func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -44,6 +45,7 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // string will list people the authenticated user is following. // // GitHub API docs: https://developer.github.com/v3/users/followers/#list-users-followed-by-another-user +// GitHub API docs: https://developer.github.com/v3/users/followers/#list-users-followed-by-the-authenticated-user func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -73,6 +75,7 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // +// GitHub API docs: https://developer.github.com/v3/users/followers/#check-if-one-user-follows-another // GitHub API docs: https://developer.github.com/v3/users/followers/#check-if-you-are-following-a-user func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) { var u string diff --git a/vendor/github.com/google/go-github/v29/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v31/github/users_gpg_keys.go similarity index 80% rename from vendor/github.com/google/go-github/v29/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v31/github/users_gpg_keys.go index 42638eb541..20b6edfd5b 100644 --- a/vendor/github.com/google/go-github/v29/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/v31/github/users_gpg_keys.go @@ -15,18 +15,18 @@ import ( // // https://developer.github.com/changes/2016-04-04-git-signing-api-preview/ type GPGKey struct { - ID *int64 `json:"id,omitempty"` - PrimaryKeyID *int64 `json:"primary_key_id,omitempty"` - KeyID *string `json:"key_id,omitempty"` - PublicKey *string `json:"public_key,omitempty"` - Emails []GPGEmail `json:"emails,omitempty"` - Subkeys []GPGKey `json:"subkeys,omitempty"` - CanSign *bool `json:"can_sign,omitempty"` - CanEncryptComms *bool `json:"can_encrypt_comms,omitempty"` - CanEncryptStorage *bool `json:"can_encrypt_storage,omitempty"` - CanCertify *bool `json:"can_certify,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` + ID *int64 `json:"id,omitempty"` + PrimaryKeyID *int64 `json:"primary_key_id,omitempty"` + KeyID *string `json:"key_id,omitempty"` + PublicKey *string `json:"public_key,omitempty"` + Emails []*GPGEmail `json:"emails,omitempty"` + Subkeys []*GPGKey `json:"subkeys,omitempty"` + CanSign *bool `json:"can_sign,omitempty"` + CanEncryptComms *bool `json:"can_encrypt_comms,omitempty"` + CanEncryptStorage *bool `json:"can_encrypt_storage,omitempty"` + CanCertify *bool `json:"can_certify,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + ExpiresAt *time.Time `json:"expires_at,omitempty"` } // String stringifies a GPGKey. @@ -45,6 +45,7 @@ type GPGEmail struct { // via Basic Auth or via OAuth with at least read:gpg_key scope. // // GitHub API docs: https://developer.github.com/v3/users/gpg_keys/#list-gpg-keys-for-a-user +// GitHub API docs: https://developer.github.com/v3/users/gpg_keys/#list-your-gpg-keys func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) { var u string if user != "" { diff --git a/vendor/github.com/google/go-github/v29/github/users_keys.go b/vendor/github.com/google/go-github/v31/github/users_keys.go similarity index 96% rename from vendor/github.com/google/go-github/v29/github/users_keys.go rename to vendor/github.com/google/go-github/v31/github/users_keys.go index f12c01b9b0..1091606a9f 100644 --- a/vendor/github.com/google/go-github/v29/github/users_keys.go +++ b/vendor/github.com/google/go-github/v31/github/users_keys.go @@ -28,6 +28,7 @@ func (k Key) String() string { // string will fetch keys for the authenticated user. // // GitHub API docs: https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user +// GitHub API docs: https://developer.github.com/v3/users/keys/#list-your-public-keys func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) { var u string if user != "" { diff --git a/vendor/github.com/google/go-github/v29/github/users_projects.go b/vendor/github.com/google/go-github/v31/github/users_projects.go similarity index 98% rename from vendor/github.com/google/go-github/v29/github/users_projects.go rename to vendor/github.com/google/go-github/v31/github/users_projects.go index 64e85a0322..1357055040 100644 --- a/vendor/github.com/google/go-github/v29/github/users_projects.go +++ b/vendor/github.com/google/go-github/v31/github/users_projects.go @@ -49,7 +49,7 @@ type CreateUserProjectOptions struct { // // GitHub API docs: https://developer.github.com/v3/projects/#create-a-user-project func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { - u := "users/projects" + u := "user/projects" req, err := s.client.NewRequest("POST", u, opts) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v29/github/with_appengine.go b/vendor/github.com/google/go-github/v31/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/with_appengine.go rename to vendor/github.com/google/go-github/v31/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v29/github/without_appengine.go b/vendor/github.com/google/go-github/v31/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v29/github/without_appengine.go rename to vendor/github.com/google/go-github/v31/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 86fbe7469a..1c35af9e09 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,11 +1,11 @@ # cloud.google.com/go v0.45.1 -cloud.google.com/go/storage +cloud.google.com/go/compute/metadata cloud.google.com/go/iam cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -cloud.google.com/go/compute/metadata +cloud.google.com/go/storage # github.com/agext/levenshtein v1.2.2 github.com/agext/levenshtein # github.com/apparentlymart/go-cidr v1.0.1 @@ -16,42 +16,42 @@ github.com/apparentlymart/go-textseg/textseg github.com/armon/go-radix # github.com/aws/aws-sdk-go v1.25.3 github.com/aws/aws-sdk-go/aws -github.com/aws/aws-sdk-go/aws/credentials -github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds -github.com/aws/aws-sdk-go/aws/ec2metadata -github.com/aws/aws-sdk-go/aws/session -github.com/aws/aws-sdk-go/service/s3 github.com/aws/aws-sdk-go/aws/awserr -github.com/aws/aws-sdk-go/aws/endpoints -github.com/aws/aws-sdk-go/internal/sdkio -github.com/aws/aws-sdk-go/internal/ini -github.com/aws/aws-sdk-go/internal/shareddefaults +github.com/aws/aws-sdk-go/aws/awsutil github.com/aws/aws-sdk-go/aws/client -github.com/aws/aws-sdk-go/aws/request -github.com/aws/aws-sdk-go/internal/sdkuri github.com/aws/aws-sdk-go/aws/client/metadata github.com/aws/aws-sdk-go/aws/corehandlers +github.com/aws/aws-sdk-go/aws/credentials +github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds +github.com/aws/aws-sdk-go/aws/credentials/endpointcreds github.com/aws/aws-sdk-go/aws/credentials/processcreds github.com/aws/aws-sdk-go/aws/credentials/stscreds github.com/aws/aws-sdk-go/aws/csm github.com/aws/aws-sdk-go/aws/defaults -github.com/aws/aws-sdk-go/aws/awsutil +github.com/aws/aws-sdk-go/aws/ec2metadata +github.com/aws/aws-sdk-go/aws/endpoints +github.com/aws/aws-sdk-go/aws/request +github.com/aws/aws-sdk-go/aws/session github.com/aws/aws-sdk-go/aws/signer/v4 +github.com/aws/aws-sdk-go/internal/ini github.com/aws/aws-sdk-go/internal/s3err +github.com/aws/aws-sdk-go/internal/sdkio +github.com/aws/aws-sdk-go/internal/sdkmath +github.com/aws/aws-sdk-go/internal/sdkrand +github.com/aws/aws-sdk-go/internal/sdkuri +github.com/aws/aws-sdk-go/internal/shareddefaults github.com/aws/aws-sdk-go/private/protocol github.com/aws/aws-sdk-go/private/protocol/eventstream github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi +github.com/aws/aws-sdk-go/private/protocol/json/jsonutil +github.com/aws/aws-sdk-go/private/protocol/query +github.com/aws/aws-sdk-go/private/protocol/query/queryutil github.com/aws/aws-sdk-go/private/protocol/rest github.com/aws/aws-sdk-go/private/protocol/restxml github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil -github.com/aws/aws-sdk-go/internal/sdkrand +github.com/aws/aws-sdk-go/service/s3 github.com/aws/aws-sdk-go/service/sts github.com/aws/aws-sdk-go/service/sts/stsiface -github.com/aws/aws-sdk-go/aws/credentials/endpointcreds -github.com/aws/aws-sdk-go/internal/sdkmath -github.com/aws/aws-sdk-go/private/protocol/query -github.com/aws/aws-sdk-go/private/protocol/json/jsonutil -github.com/aws/aws-sdk-go/private/protocol/query/queryutil # github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d github.com/bgentry/go-netrc/netrc # github.com/bgentry/speakeasy v0.1.0 @@ -62,19 +62,19 @@ github.com/davecgh/go-spew/spew github.com/fatih/color # github.com/golang/protobuf v1.3.2 github.com/golang/protobuf/proto +github.com/golang/protobuf/protoc-gen-go/descriptor github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -github.com/golang/protobuf/protoc-gen-go/descriptor # github.com/google/go-cmp v0.3.1 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-github/v29 v29.0.3 -github.com/google/go-github/v29/github +# github.com/google/go-github/v31 v31.0.0 +github.com/google/go-github/v31/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/google/uuid v1.1.1 @@ -107,23 +107,23 @@ github.com/hashicorp/golang-lru/simplelru github.com/hashicorp/hcl github.com/hashicorp/hcl/hcl/ast github.com/hashicorp/hcl/hcl/parser -github.com/hashicorp/hcl/hcl/token -github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/hcl/scanner github.com/hashicorp/hcl/hcl/strconv +github.com/hashicorp/hcl/hcl/token +github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token # github.com/hashicorp/hcl/v2 v2.0.0 github.com/hashicorp/hcl/v2 -github.com/hashicorp/hcl/v2/hcldec -github.com/hashicorp/hcl/v2/hclsyntax +github.com/hashicorp/hcl/v2/ext/dynblock github.com/hashicorp/hcl/v2/ext/typeexpr github.com/hashicorp/hcl/v2/gohcl +github.com/hashicorp/hcl/v2/hcldec +github.com/hashicorp/hcl/v2/hcled github.com/hashicorp/hcl/v2/hclparse -github.com/hashicorp/hcl/v2/ext/dynblock +github.com/hashicorp/hcl/v2/hclsyntax github.com/hashicorp/hcl/v2/hclwrite github.com/hashicorp/hcl/v2/json -github.com/hashicorp/hcl/v2/hcled # github.com/hashicorp/logutils v1.0.0 github.com/hashicorp/logutils # github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 @@ -131,64 +131,64 @@ github.com/hashicorp/terraform-config-inspect/tfconfig # github.com/hashicorp/terraform-json v0.4.0 github.com/hashicorp/terraform-json # github.com/hashicorp/terraform-plugin-sdk v1.7.0 -github.com/hashicorp/terraform-plugin-sdk/plugin +github.com/hashicorp/terraform-plugin-sdk/acctest +github.com/hashicorp/terraform-plugin-sdk/helper/acctest +github.com/hashicorp/terraform-plugin-sdk/helper/hashcode github.com/hashicorp/terraform-plugin-sdk/helper/logging +github.com/hashicorp/terraform-plugin-sdk/helper/resource github.com/hashicorp/terraform-plugin-sdk/helper/schema -github.com/hashicorp/terraform-plugin-sdk/helper/validation -github.com/hashicorp/terraform-plugin-sdk/terraform -github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema -github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin -github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert -github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery -github.com/hashicorp/terraform-plugin-sdk/internal/providers -github.com/hashicorp/terraform-plugin-sdk/internal/provisioners -github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5 -github.com/hashicorp/terraform-plugin-sdk/helper/hashcode -github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim -github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags github.com/hashicorp/terraform-plugin-sdk/helper/structure +github.com/hashicorp/terraform-plugin-sdk/helper/validation +github.com/hashicorp/terraform-plugin-sdk/httpclient github.com/hashicorp/terraform-plugin-sdk/internal/addrs +github.com/hashicorp/terraform-plugin-sdk/internal/command/format github.com/hashicorp/terraform-plugin-sdk/internal/configs +github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload +github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema +github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim github.com/hashicorp/terraform-plugin-sdk/internal/dag +github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig +github.com/hashicorp/terraform-plugin-sdk/internal/flatmap +github.com/hashicorp/terraform-plugin-sdk/internal/helper/config github.com/hashicorp/terraform-plugin-sdk/internal/helper/didyoumean +github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin +github.com/hashicorp/terraform-plugin-sdk/internal/httpclient +github.com/hashicorp/terraform-plugin-sdk/internal/initwd github.com/hashicorp/terraform-plugin-sdk/internal/lang +github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr +github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs +github.com/hashicorp/terraform-plugin-sdk/internal/modsdir github.com/hashicorp/terraform-plugin-sdk/internal/moduledeps github.com/hashicorp/terraform-plugin-sdk/internal/plans github.com/hashicorp/terraform-plugin-sdk/internal/plans/objchange -github.com/hashicorp/terraform-plugin-sdk/internal/states -github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile -github.com/hashicorp/terraform-plugin-sdk/internal/version -github.com/hashicorp/terraform-plugin-sdk/helper/acctest -github.com/hashicorp/terraform-plugin-sdk/helper/resource -github.com/hashicorp/terraform-plugin-sdk/internal/httpclient +github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert +github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery +github.com/hashicorp/terraform-plugin-sdk/internal/providers +github.com/hashicorp/terraform-plugin-sdk/internal/provisioners github.com/hashicorp/terraform-plugin-sdk/internal/registry github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc github.com/hashicorp/terraform-plugin-sdk/internal/registry/response -github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr -github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs -github.com/hashicorp/terraform-plugin-sdk/acctest -github.com/hashicorp/terraform-plugin-sdk/internal/command/format -github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload -github.com/hashicorp/terraform-plugin-sdk/internal/helper/config -github.com/hashicorp/terraform-plugin-sdk/internal/initwd -github.com/hashicorp/terraform-plugin-sdk/httpclient -github.com/hashicorp/terraform-plugin-sdk/internal/modsdir -github.com/hashicorp/terraform-plugin-sdk/internal/flatmap -github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig +github.com/hashicorp/terraform-plugin-sdk/internal/states +github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile +github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags +github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5 +github.com/hashicorp/terraform-plugin-sdk/internal/version github.com/hashicorp/terraform-plugin-sdk/meta +github.com/hashicorp/terraform-plugin-sdk/plugin +github.com/hashicorp/terraform-plugin-sdk/terraform # github.com/hashicorp/terraform-plugin-test v1.2.0 github.com/hashicorp/terraform-plugin-test # github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 -github.com/hashicorp/terraform-svchost/disco github.com/hashicorp/terraform-svchost github.com/hashicorp/terraform-svchost/auth +github.com/hashicorp/terraform-svchost/disco # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux # github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af github.com/jmespath/go-jmespath # github.com/kylelemons/godebug v1.1.0 -github.com/kylelemons/godebug/pretty github.com/kylelemons/godebug/diff +github.com/kylelemons/godebug/pretty # github.com/mattn/go-colorable v0.1.1 github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.5 @@ -213,137 +213,139 @@ github.com/mitchellh/reflectwalk github.com/oklog/run # github.com/posener/complete v1.2.1 github.com/posener/complete -github.com/posener/complete/cmd/install github.com/posener/complete/cmd +github.com/posener/complete/cmd/install github.com/posener/complete/match # github.com/spf13/afero v1.2.2 github.com/spf13/afero github.com/spf13/afero/mem # github.com/ulikunitz/xz v0.5.5 github.com/ulikunitz/xz +github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog github.com/ulikunitz/xz/lzma -github.com/ulikunitz/xz/internal/hash # github.com/vmihailenco/msgpack v4.0.1+incompatible github.com/vmihailenco/msgpack github.com/vmihailenco/msgpack/codes # github.com/zclconf/go-cty v1.2.1 github.com/zclconf/go-cty/cty -github.com/zclconf/go-cty/cty/msgpack github.com/zclconf/go-cty/cty/convert -github.com/zclconf/go-cty/cty/json -github.com/zclconf/go-cty/cty/gocty -github.com/zclconf/go-cty/cty/set github.com/zclconf/go-cty/cty/function github.com/zclconf/go-cty/cty/function/stdlib +github.com/zclconf/go-cty/cty/gocty +github.com/zclconf/go-cty/cty/json +github.com/zclconf/go-cty/cty/msgpack +github.com/zclconf/go-cty/cty/set # github.com/zclconf/go-cty-yaml v1.0.1 github.com/zclconf/go-cty-yaml # go.opencensus.io v0.22.0 -go.opencensus.io/trace -go.opencensus.io/plugin/ochttp +go.opencensus.io go.opencensus.io/internal -go.opencensus.io/trace/internal -go.opencensus.io/trace/tracestate +go.opencensus.io/internal/tagencoding +go.opencensus.io/metric/metricdata +go.opencensus.io/metric/metricproducer +go.opencensus.io/plugin/ochttp go.opencensus.io/plugin/ochttp/propagation/b3 +go.opencensus.io/resource go.opencensus.io/stats +go.opencensus.io/stats/internal go.opencensus.io/stats/view go.opencensus.io/tag +go.opencensus.io/trace +go.opencensus.io/trace/internal go.opencensus.io/trace/propagation -go.opencensus.io -go.opencensus.io/metric/metricdata -go.opencensus.io/stats/internal -go.opencensus.io/internal/tagencoding -go.opencensus.io/metric/metricproducer -go.opencensus.io/resource +go.opencensus.io/trace/tracestate # golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d -golang.org/x/crypto/nacl/box -golang.org/x/crypto/openpgp +golang.org/x/crypto/bcrypt golang.org/x/crypto/blake2b +golang.org/x/crypto/blowfish +golang.org/x/crypto/cast5 +golang.org/x/crypto/chacha20 golang.org/x/crypto/curve25519 +golang.org/x/crypto/ed25519 +golang.org/x/crypto/ed25519/internal/edwards25519 +golang.org/x/crypto/internal/subtle +golang.org/x/crypto/nacl/box golang.org/x/crypto/nacl/secretbox -golang.org/x/crypto/salsa20/salsa +golang.org/x/crypto/openpgp golang.org/x/crypto/openpgp/armor +golang.org/x/crypto/openpgp/elgamal golang.org/x/crypto/openpgp/errors golang.org/x/crypto/openpgp/packet golang.org/x/crypto/openpgp/s2k -golang.org/x/crypto/internal/subtle golang.org/x/crypto/poly1305 +golang.org/x/crypto/salsa20/salsa golang.org/x/crypto/ssh -golang.org/x/crypto/cast5 -golang.org/x/crypto/openpgp/elgamal -golang.org/x/crypto/bcrypt -golang.org/x/crypto/chacha20 -golang.org/x/crypto/ed25519 golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -golang.org/x/crypto/blowfish -golang.org/x/crypto/ed25519/internal/edwards25519 # golang.org/x/net v0.0.0-20191009170851-d66e71096ffb golang.org/x/net/context -golang.org/x/net/trace golang.org/x/net/context/ctxhttp -golang.org/x/net/internal/timeseries +golang.org/x/net/http/httpguts golang.org/x/net/http2 golang.org/x/net/http2/hpack golang.org/x/net/idna -golang.org/x/net/http/httpguts +golang.org/x/net/internal/timeseries +golang.org/x/net/trace # golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/oauth2 -golang.org/x/oauth2/internal golang.org/x/oauth2/google +golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt # golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa golang.org/x/sys/cpu golang.org/x/sys/unix # golang.org/x/text v0.3.2 -golang.org/x/text/unicode/norm -golang.org/x/text/transform golang.org/x/text/secure/bidirule +golang.org/x/text/transform golang.org/x/text/unicode/bidi +golang.org/x/text/unicode/norm # google.golang.org/api v0.9.0 -google.golang.org/api/iterator +google.golang.org/api/gensupport google.golang.org/api/googleapi +google.golang.org/api/googleapi/internal/uritemplates +google.golang.org/api/googleapi/transport +google.golang.org/api/internal +google.golang.org/api/iterator google.golang.org/api/option google.golang.org/api/storage/v1 google.golang.org/api/transport/http -google.golang.org/api/googleapi/internal/uritemplates -google.golang.org/api/internal -google.golang.org/api/gensupport -google.golang.org/api/googleapi/transport google.golang.org/api/transport/http/internal/propagation # google.golang.org/appengine v1.6.1 -google.golang.org/appengine/urlfetch -google.golang.org/appengine/datastore -google.golang.org/appengine/internal -google.golang.org/appengine/internal/urlfetch google.golang.org/appengine +google.golang.org/appengine/datastore google.golang.org/appengine/datastore/internal/cloudkey -google.golang.org/appengine/internal/datastore +google.golang.org/appengine/datastore/internal/cloudpb +google.golang.org/appengine/internal +google.golang.org/appengine/internal/app_identity google.golang.org/appengine/internal/base +google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log -google.golang.org/appengine/internal/remote_api -google.golang.org/appengine/internal/app_identity google.golang.org/appengine/internal/modules -google.golang.org/appengine/datastore/internal/cloudpb +google.golang.org/appengine/internal/remote_api +google.golang.org/appengine/internal/urlfetch +google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 -google.golang.org/genproto/googleapis/rpc/status +google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/iam/v1 google.golang.org/genproto/googleapis/rpc/code -google.golang.org/genproto/googleapis/api/annotations +google.golang.org/genproto/googleapis/rpc/status google.golang.org/genproto/googleapis/type/expr # google.golang.org/grpc v1.23.0 google.golang.org/grpc -google.golang.org/grpc/credentials -google.golang.org/grpc/health -google.golang.org/grpc/health/grpc_health_v1 -google.golang.org/grpc/codes -google.golang.org/grpc/status google.golang.org/grpc/balancer +google.golang.org/grpc/balancer/base google.golang.org/grpc/balancer/roundrobin +google.golang.org/grpc/binarylog/grpc_binarylog_v1 +google.golang.org/grpc/codes google.golang.org/grpc/connectivity +google.golang.org/grpc/credentials +google.golang.org/grpc/credentials/internal google.golang.org/grpc/encoding google.golang.org/grpc/encoding/proto google.golang.org/grpc/grpclog +google.golang.org/grpc/health +google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancerload @@ -352,6 +354,7 @@ google.golang.org/grpc/internal/channelz google.golang.org/grpc/internal/envconfig google.golang.org/grpc/internal/grpcrand google.golang.org/grpc/internal/grpcsync +google.golang.org/grpc/internal/syscall google.golang.org/grpc/internal/transport google.golang.org/grpc/keepalive google.golang.org/grpc/metadata @@ -362,9 +365,6 @@ google.golang.org/grpc/resolver/dns google.golang.org/grpc/resolver/passthrough google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats +google.golang.org/grpc/status google.golang.org/grpc/tap google.golang.org/grpc/test/bufconn -google.golang.org/grpc/credentials/internal -google.golang.org/grpc/balancer/base -google.golang.org/grpc/binarylog/grpc_binarylog_v1 -google.golang.org/grpc/internal/syscall From 7f0f82a296b96ef9f23ddade005fb97999b12521 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Mon, 4 May 2020 20:41:59 -0400 Subject: [PATCH 2/2] update github_branch import statements to v31 of go-github --- github/resource_github_branch.go | 2 +- github/resource_github_branch_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 31ae99df7c..e2172b7307 100644 --- a/github/resource_github_branch.go +++ b/github/resource_github_branch.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch_test.go b/github/resource_github_branch_test.go index c583c7a5e4..012bbd3fe0 100644 --- a/github/resource_github_branch_test.go +++ b/github/resource_github_branch_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v29/github" + "github.com/google/go-github/v31/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform"