aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/shurcooL/githubv4
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/shurcooL/githubv4')
-rw-r--r--vendor/github.com/shurcooL/githubv4/.travis.yml16
-rw-r--r--vendor/github.com/shurcooL/githubv4/LICENSE21
-rw-r--r--vendor/github.com/shurcooL/githubv4/README.md408
-rw-r--r--vendor/github.com/shurcooL/githubv4/doc.go13
-rw-r--r--vendor/github.com/shurcooL/githubv4/enum.go529
-rw-r--r--vendor/github.com/shurcooL/githubv4/gen.go192
-rw-r--r--vendor/github.com/shurcooL/githubv4/githubv4.go56
-rw-r--r--vendor/github.com/shurcooL/githubv4/input.go483
-rw-r--r--vendor/github.com/shurcooL/githubv4/scalar.go139
9 files changed, 1857 insertions, 0 deletions
diff --git a/vendor/github.com/shurcooL/githubv4/.travis.yml b/vendor/github.com/shurcooL/githubv4/.travis.yml
new file mode 100644
index 00000000..93b1fcdb
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/.travis.yml
@@ -0,0 +1,16 @@
+sudo: false
+language: go
+go:
+ - 1.x
+ - master
+matrix:
+ allow_failures:
+ - go: master
+ fast_finish: true
+install:
+ - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
+script:
+ - go get -t -v ./...
+ - diff -u <(echo -n) <(gofmt -d -s .)
+ - go tool vet .
+ - go test -v -race ./...
diff --git a/vendor/github.com/shurcooL/githubv4/LICENSE b/vendor/github.com/shurcooL/githubv4/LICENSE
new file mode 100644
index 00000000..ca4c7764
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Dmitri Shuralyov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/github.com/shurcooL/githubv4/README.md b/vendor/github.com/shurcooL/githubv4/README.md
new file mode 100644
index 00000000..0d389ef0
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/README.md
@@ -0,0 +1,408 @@
+githubv4
+========
+
+[![Build Status](https://travis-ci.org/shurcooL/githubv4.svg?branch=master)](https://travis-ci.org/shurcooL/githubv4) [![GoDoc](https://godoc.org/github.com/shurcooL/githubv4?status.svg)](https://godoc.org/github.com/shurcooL/githubv4)
+
+Package `githubv4` is a client library for accessing GitHub GraphQL API v4 (https://developer.github.com/v4/).
+
+If you're looking for a client library for GitHub REST API v3, the recommended package is [`github.com/google/go-github/github`](https://godoc.org/github.com/google/go-github/github).
+
+**Status:** In research and development. The API will change when opportunities for improvement are discovered; it is not yet frozen.
+
+Focus
+-----
+
+- Friendly, simple and powerful API.
+- Correctness, high performance and efficiency.
+- Support all of GitHub GraphQL API v4 via code generation from schema.
+
+Installation
+------------
+
+`githubv4` requires Go version 1.8 or later.
+
+```bash
+go get -u github.com/shurcooL/githubv4
+```
+
+Usage
+-----
+
+### Authentication
+
+GitHub GraphQL API v4 [requires authentication](https://developer.github.com/v4/guides/forming-calls/#authenticating-with-graphql). The `githubv4` package does not directly handle authentication. Instead, when creating a new client, you're expected to pass an `http.Client` that performs authentication. The easiest and recommended way to do this is to use the [`golang.org/x/oauth2`](https://golang.org/x/oauth2) package. You'll need an OAuth token from GitHub (for example, a [personal API token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)) with the right scopes. Then:
+
+```Go
+import "golang.org/x/oauth2"
+
+func main() {
+ src := oauth2.StaticTokenSource(
+ &oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
+ )
+ httpClient := oauth2.NewClient(context.Background(), src)
+
+ client := githubv4.NewClient(httpClient)
+ // Use client...
+}
+```
+
+### Simple Query
+
+To make a query, you need to define a Go type that corresponds to the GitHub GraphQL schema, and contains the fields you're interested in querying. You can look up the GitHub GraphQL schema at https://developer.github.com/v4/reference/query/.
+
+For example, to make the following GraphQL query:
+
+```GraphQL
+query {
+ viewer {
+ login
+ createdAt
+ }
+}
+```
+
+You can define this variable:
+
+```Go
+var query struct {
+ Viewer struct {
+ Login githubv4.String
+ CreatedAt githubv4.DateTime
+ }
+}
+```
+
+Then call `client.Query`, passing a pointer to it:
+
+```Go
+err := client.Query(context.Background(), &query, nil)
+if err != nil {
+ // Handle error.
+}
+fmt.Println(" Login:", query.Viewer.Login)
+fmt.Println("CreatedAt:", query.Viewer.CreatedAt)
+
+// Output:
+// Login: gopher
+// CreatedAt: 2017-05-26 21:17:14 +0000 UTC
+```
+
+### Scalar Types
+
+For each scalar in the GitHub GraphQL schema listed at https://developer.github.com/v4/reference/scalar/, there is a corresponding Go type in package `githubv4`.
+
+You can use these types when writing queries:
+
+```Go
+var query struct {
+ Viewer struct {
+ Login githubv4.String
+ CreatedAt githubv4.DateTime
+ IsBountyHunter githubv4.Boolean
+ BioHTML githubv4.HTML
+ WebsiteURL githubv4.URI
+ }
+}
+// Call client.Query() and use results in query...
+```
+
+However, depending on how you're planning to use the results of your query, it's often more convenient to use other Go types.
+
+The `encoding/json` rules are used for converting individual JSON-encoded fields from a GraphQL response into Go values. See https://godoc.org/encoding/json#Unmarshal for details. The [`json.Unmarshaler`](https://godoc.org/encoding/json#Unmarshaler) interface is respected.
+
+That means you can simplify the earlier query by using predeclared Go types:
+
+```Go
+// import "time"
+
+var query struct {
+ Viewer struct {
+ Login string // E.g., "gopher".
+ CreatedAt time.Time // E.g., time.Date(2017, 5, 26, 21, 17, 14, 0, time.UTC).
+ IsBountyHunter bool // E.g., true.
+ BioHTML string // E.g., `I am learning <a href="https://graphql.org">GraphQL</a>!`.
+ WebsiteURL string // E.g., "https://golang.org".
+ }
+}
+// Call client.Query() and use results in query...
+```
+
+The [`DateTime`](https://developer.github.com/v4/reference/scalar/datetime/) scalar is described as "an ISO-8601 encoded UTC date string". If you wanted to fetch in that form without parsing it into a `time.Time`, you can use the `string` type. For example, this would work:
+
+```Go
+// import "html/template"
+
+type MyBoolean bool
+
+var query struct {
+ Viewer struct {
+ Login string // E.g., "gopher".
+ CreatedAt string // E.g., "2017-05-26T21:17:14Z".
+ IsBountyHunter MyBoolean // E.g., MyBoolean(true).
+ BioHTML template.HTML // E.g., template.HTML(`I am learning <a href="https://graphql.org">GraphQL</a>!`).
+ WebsiteURL template.URL // E.g., template.URL("https://golang.org").
+ }
+}
+// Call client.Query() and use results in query...
+```
+
+### Arguments and Variables
+
+Often, you'll want to specify arguments on some fields. You can use the `graphql` struct field tag for this.
+
+For example, to make the following GraphQL query:
+
+```GraphQL
+{
+ repository(owner: "octocat", name: "Hello-World") {
+ description
+ }
+}
+```
+
+You can define this variable:
+
+```Go
+var q struct {
+ Repository struct {
+ Description string
+ } `graphql:"repository(owner: \"octocat\", name: \"Hello-World\")"`
+}
+```
+
+Then call `client.Query`:
+
+```Go
+err := client.Query(context.Background(), &q, nil)
+if err != nil {
+ // Handle error.
+}
+fmt.Println(q.Repository.Description)
+
+// Output:
+// My first repository on GitHub!
+```
+
+However, that'll only work if the arguments are constant and known in advance. Otherwise, you will need to make use of variables. Replace the constants in the struct field tag with variable names:
+
+```Go
+// fetchRepoDescription fetches description of repo with owner and name.
+func fetchRepoDescription(ctx context.Context, owner, name string) (string, error) {
+ var q struct {
+ Repository struct {
+ Description string
+ } `graphql:"repository(owner: $owner, name: $name)"`
+ }
+```
+
+When sending variables to GraphQL, you need to use exact types that match GraphQL scalar types, otherwise the GraphQL server will return an error.
+
+So, define a `variables` map with their values that are converted to GraphQL scalar types:
+
+```Go
+ variables := map[string]interface{}{
+ "owner": githubv4.String(owner),
+ "name": githubv4.String(name),
+ }
+```
+
+Finally, call `client.Query` providing `variables`:
+
+```Go
+ err := client.Query(ctx, &q, variables)
+ return q.Repository.Description, err
+}
+```
+
+### Inline Fragments
+
+Some GraphQL queries contain inline fragments. You can use the `graphql` struct field tag to express them.
+
+For example, to make the following GraphQL query:
+
+```GraphQL
+{
+ repositoryOwner(login: "github") {
+ login
+ ... on Organization {
+ description
+ }
+ ... on User {
+ bio
+ }
+ }
+}
+```
+
+You can define this variable:
+
+```Go
+var q struct {
+ RepositoryOwner struct {
+ Login string
+ Organization struct {
+ Description string
+ } `graphql:"... on Organization"`
+ User struct {
+ Bio string
+ } `graphql:"... on User"`
+ } `graphql:"repositoryOwner(login: \"github\")"`
+}
+```
+
+Alternatively, you can define the struct types corresponding to inline fragments, and use them as embedded fields in your query:
+
+```Go
+type (
+ OrganizationFragment struct {
+ Description string
+ }
+ UserFragment struct {
+ Bio string
+ }
+)
+
+var q struct {
+ RepositoryOwner struct {
+ Login string
+ OrganizationFragment `graphql:"... on Organization"`
+ UserFragment `graphql:"... on User"`
+ } `graphql:"repositoryOwner(login: \"github\")"`
+}
+```
+
+Then call `client.Query`:
+
+```Go
+err := client.Query(context.Background(), &q, nil)
+if err != nil {
+ // Handle error.
+}
+fmt.Println(q.RepositoryOwner.Login)
+fmt.Println(q.RepositoryOwner.Description)
+fmt.Println(q.RepositoryOwner.Bio)
+
+// Output:
+// github
+// How people build software.
+//
+```
+
+### Pagination
+
+Imagine you wanted to get a complete list of comments in an issue, and not just the first 10 or so. To do that, you'll need to perform multiple queries and use pagination information. For example:
+
+```Go
+type comment struct {
+ Body string
+ Author struct {
+ Login string
+ AvatarURL string `graphql:"avatarUrl(size: 72)"`
+ }
+ ViewerCanReact bool
+}
+var q struct {
+ Repository struct {
+ Issue struct {
+ Comments struct {
+ Nodes []comment
+ PageInfo struct {
+ EndCursor githubv4.String
+ HasNextPage bool
+ }
+ } `graphql:"comments(first: 100, after: $commentsCursor)"` // 100 per page.
+ } `graphql:"issue(number: $issueNumber)"`
+ } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"`
+}
+variables := map[string]interface{}{
+ "repositoryOwner": githubv4.String(owner),
+ "repositoryName": githubv4.String(name),
+ "issueNumber": githubv4.Int(issue),
+ "commentsCursor": (*githubv4.String)(nil), // Null after argument to get first page.
+}
+
+// Get comments from all pages.
+var allComments []comment
+for {
+ err := s.clQL.Query(ctx, &q, variables)
+ if err != nil {
+ return err
+ }
+ allComments = append(allComments, q.Repository.Issue.Comments.Nodes...)
+ if !q.Repository.Issue.Comments.PageInfo.HasNextPage {
+ break
+ }
+ variables["commentsCursor"] = githubv4.NewString(q.Repository.Issue.Comments.PageInfo.EndCursor)
+}
+```
+
+There is more than one way to perform pagination. Consider additional fields inside [`PageInfo`](https://developer.github.com/v4/reference/object/pageinfo/) object.
+
+### Mutations
+
+Mutations often require information that you can only find out by performing a query first. Let's suppose you've already done that.
+
+For example, to make the following GraphQL mutation:
+
+```GraphQL
+mutation($input: AddReactionInput!) {
+ addReaction(input: $input) {
+ reaction {
+ content
+ }
+ subject {
+ id
+ }
+ }
+}
+variables {
+ "input": {
+ "subjectId": "MDU6SXNzdWUyMTc5NTQ0OTc=",
+ "content": "HOORAY"
+ }
+}
+```
+
+You can define:
+
+```Go
+var m struct {
+ AddReaction struct {
+ Reaction struct {
+ Content githubv4.ReactionContent
+ }
+ Subject struct {
+ ID githubv4.ID
+ }
+ } `graphql:"addReaction(input: $input)"`
+}
+input := githubv4.AddReactionInput{
+ SubjectID: targetIssue.ID, // ID of the target issue from a previous query.
+ Content: githubv4.ReactionContentHooray,
+}
+```
+
+Then call `client.Mutate`:
+
+```Go
+err := client.Mutate(context.Background(), &m, input, nil)
+if err != nil {
+ // Handle error.
+}
+fmt.Printf("Added a %v reaction to subject with ID %#v!\n", m.AddReaction.Reaction.Content, m.AddReaction.Subject.ID)
+
+// Output:
+// Added a HOORAY reaction to subject with ID "MDU6SXNzdWUyMTc5NTQ0OTc="!
+```
+
+Directories
+-----------
+
+| Path | Synopsis |
+|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
+| [example/githubv4dev](https://godoc.org/github.com/shurcooL/githubv4/example/githubv4dev) | githubv4dev is a test program currently being used for developing githubv4 package. |
+
+License
+-------
+
+- [MIT License](LICENSE)
diff --git a/vendor/github.com/shurcooL/githubv4/doc.go b/vendor/github.com/shurcooL/githubv4/doc.go
new file mode 100644
index 00000000..0ce1a508
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/doc.go
@@ -0,0 +1,13 @@
+// Package githubv4 is a client library for accessing GitHub
+// GraphQL API v4 (https://developer.github.com/v4/).
+//
+// If you're looking for a client library for GitHub REST API v3,
+// the recommended package is github.com/google/go-github/github.
+//
+// Status: In active early research and development. The API will change when
+// opportunities for improvement are discovered; it is not yet frozen.
+//
+// For now, see README for more details.
+package githubv4 // import "github.com/shurcooL/githubv4"
+
+//go:generate go run gen.go
diff --git a/vendor/github.com/shurcooL/githubv4/enum.go b/vendor/github.com/shurcooL/githubv4/enum.go
new file mode 100644
index 00000000..8293a23b
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/enum.go
@@ -0,0 +1,529 @@
+// Code generated by gen.go; DO NOT EDIT.
+
+package githubv4
+
+// CollaboratorAffiliation represents collaborators affiliation level with a subject.
+type CollaboratorAffiliation string
+
+// Collaborators affiliation level with a subject.
+const (
+ CollaboratorAffiliationOutside CollaboratorAffiliation = "OUTSIDE" // All outside collaborators of an organization-owned subject.
+ CollaboratorAffiliationDirect CollaboratorAffiliation = "DIRECT" // All collaborators with permissions to an organization-owned subject, regardless of organization membership status.
+ CollaboratorAffiliationAll CollaboratorAffiliation = "ALL" // All collaborators the authenticated user can see.
+)
+
+// CommentAuthorAssociation represents a comment author association with repository.
+type CommentAuthorAssociation string
+
+// A comment author association with repository.
+const (
+ CommentAuthorAssociationMember CommentAuthorAssociation = "MEMBER" // Author is a member of the organization that owns the repository.
+ CommentAuthorAssociationOwner CommentAuthorAssociation = "OWNER" // Author is the owner of the repository.
+ CommentAuthorAssociationCollaborator CommentAuthorAssociation = "COLLABORATOR" // Author has been invited to collaborate on the repository.
+ CommentAuthorAssociationContributor CommentAuthorAssociation = "CONTRIBUTOR" // Author has previously committed to the repository.
+ CommentAuthorAssociationFirstTimeContributor CommentAuthorAssociation = "FIRST_TIME_CONTRIBUTOR" // Author has not previously committed to the repository.
+ CommentAuthorAssociationFirstTimer CommentAuthorAssociation = "FIRST_TIMER" // Author has not previously committed to GitHub.
+ CommentAuthorAssociationNone CommentAuthorAssociation = "NONE" // Author has no association with the repository.
+)
+
+// CommentCannotUpdateReason represents the possible errors that will prevent a user from updating a comment.
+type CommentCannotUpdateReason string
+
+// The possible errors that will prevent a user from updating a comment.
+const (
+ CommentCannotUpdateReasonInsufficientAccess CommentCannotUpdateReason = "INSUFFICIENT_ACCESS" // You must be the author or have write access to this repository to update this comment.
+ CommentCannotUpdateReasonLocked CommentCannotUpdateReason = "LOCKED" // Unable to create comment because issue is locked.
+ CommentCannotUpdateReasonLoginRequired CommentCannotUpdateReason = "LOGIN_REQUIRED" // You must be logged in to update this comment.
+ CommentCannotUpdateReasonMaintenance CommentCannotUpdateReason = "MAINTENANCE" // Repository is under maintenance.
+ CommentCannotUpdateReasonVerifiedEmailRequired CommentCannotUpdateReason = "VERIFIED_EMAIL_REQUIRED" // At least one email address must be verified to update this comment.
+)
+
+// DefaultRepositoryPermissionField represents the possible default permissions for repositories.
+type DefaultRepositoryPermissionField string
+
+// The possible default permissions for repositories.
+const (
+ DefaultRepositoryPermissionFieldNone DefaultRepositoryPermissionField = "NONE" // No access.
+ DefaultRepositoryPermissionFieldRead DefaultRepositoryPermissionField = "READ" // Can read repos by default.
+ DefaultRepositoryPermissionFieldWrite DefaultRepositoryPermissionField = "WRITE" // Can read and write repos by default.
+ DefaultRepositoryPermissionFieldAdmin DefaultRepositoryPermissionField = "ADMIN" // Can read, write, and administrate repos by default.
+)
+
+// DeploymentState represents the possible states in which a deployment can be.
+type DeploymentState string
+
+// The possible states in which a deployment can be.
+const (
+ DeploymentStateAbandoned DeploymentState = "ABANDONED" // The pending deployment was not updated after 30 minutes.
+ DeploymentStateActive DeploymentState = "ACTIVE" // The deployment is currently active.
+ DeploymentStateDestroyed DeploymentState = "DESTROYED" // An inactive transient deployment.
+ DeploymentStateError DeploymentState = "ERROR" // The deployment experienced an error.
+ DeploymentStateFailure DeploymentState = "FAILURE" // The deployment has failed.
+ DeploymentStateInactive DeploymentState = "INACTIVE" // The deployment is inactive.
+ DeploymentStatePending DeploymentState = "PENDING" // The deployment is pending.
+)
+
+// DeploymentStatusState represents the possible states for a deployment status.
+type DeploymentStatusState string
+
+// The possible states for a deployment status.
+const (
+ DeploymentStatusStatePending DeploymentStatusState = "PENDING" // The deployment is pending.
+ DeploymentStatusStateSuccess DeploymentStatusState = "SUCCESS" // The deployment was successful.
+ DeploymentStatusStateFailure DeploymentStatusState = "FAILURE" // The deployment has failed.
+ DeploymentStatusStateInactive DeploymentStatusState = "INACTIVE" // The deployment is inactive.
+ DeploymentStatusStateError DeploymentStatusState = "ERROR" // The deployment experienced an error.
+)
+
+// GistOrderField represents properties by which gist connections can be ordered.
+type GistOrderField string
+
+// Properties by which gist connections can be ordered.
+const (
+ GistOrderFieldCreatedAt GistOrderField = "CREATED_AT" // Order gists by creation time.
+ GistOrderFieldUpdatedAt GistOrderField = "UPDATED_AT" // Order gists by update time.
+ GistOrderFieldPushedAt GistOrderField = "PUSHED_AT" // Order gists by push time.
+)
+
+// GistPrivacy represents the privacy of a Gist.
+type GistPrivacy string
+
+// The privacy of a Gist.
+const (
+ GistPrivacyPublic GistPrivacy = "PUBLIC" // Public.
+ GistPrivacySecret GistPrivacy = "SECRET" // Secret.
+ GistPrivacyAll GistPrivacy = "ALL" // Gists that are public and secret.
+)
+
+// GitSignatureState represents the state of a Git signature.
+type GitSignatureState string
+
+// The state of a Git signature.
+const (
+ GitSignatureStateValid GitSignatureState = "VALID" // Valid signature and verified by GitHub.
+ GitSignatureStateInvalid GitSignatureState = "INVALID" // Invalid signature.
+ GitSignatureStateMalformedSig GitSignatureState = "MALFORMED_SIG" // Malformed signature.
+ GitSignatureStateUnknownKey GitSignatureState = "UNKNOWN_KEY" // Key used for signing not known to GitHub.
+ GitSignatureStateBadEmail GitSignatureState = "BAD_EMAIL" // Invalid email used for signing.
+ GitSignatureStateUnverifiedEmail GitSignatureState = "UNVERIFIED_EMAIL" // Email used for signing unverified on GitHub.
+ GitSignatureStateNoUser GitSignatureState = "NO_USER" // Email used for signing not known to GitHub.
+ GitSignatureStateUnknownSigType GitSignatureState = "UNKNOWN_SIG_TYPE" // Unknown signature type.
+ GitSignatureStateUnsigned GitSignatureState = "UNSIGNED" // Unsigned.
+ GitSignatureStateGpgverifyUnavailable GitSignatureState = "GPGVERIFY_UNAVAILABLE" // Internal error - the GPG verification service is unavailable at the moment.
+ GitSignatureStateGpgverifyError GitSignatureState = "GPGVERIFY_ERROR" // Internal error - the GPG verification service misbehaved.
+ GitSignatureStateNotSigningKey GitSignatureState = "NOT_SIGNING_KEY" // The usage flags for the key that signed this don't allow signing.
+ GitSignatureStateExpiredKey GitSignatureState = "EXPIRED_KEY" // Signing key expired.
+ GitSignatureStateOcspPending GitSignatureState = "OCSP_PENDING" // Valid signature, pending certificate revocation checking.
+ GitSignatureStateOcspError GitSignatureState = "OCSP_ERROR" // Valid siganture, though certificate revocation check failed.
+ GitSignatureStateOcspRevoked GitSignatureState = "OCSP_REVOKED" // One or more certificates in chain has been revoked.
+)
+
+// IssueOrderField represents properties by which issue connections can be ordered.
+type IssueOrderField string
+
+// Properties by which issue connections can be ordered.
+const (
+ IssueOrderFieldCreatedAt IssueOrderField = "CREATED_AT" // Order issues by creation time.
+ IssueOrderFieldUpdatedAt IssueOrderField = "UPDATED_AT" // Order issues by update time.
+ IssueOrderFieldComments IssueOrderField = "COMMENTS" // Order issues by comment count.
+)
+
+// IssuePubSubTopic represents the possible PubSub channels for an issue.
+type IssuePubSubTopic string
+
+// The possible PubSub channels for an issue.
+const (
+ IssuePubSubTopicUpdated IssuePubSubTopic = "UPDATED" // The channel ID for observing issue updates.
+ IssuePubSubTopicMarkasread IssuePubSubTopic = "MARKASREAD" // The channel ID for marking an issue as read.
+ IssuePubSubTopicTimeline IssuePubSubTopic = "TIMELINE" // The channel ID for updating items on the issue timeline.
+)
+
+// IssueState represents the possible states of an issue.
+type IssueState string
+
+// The possible states of an issue.
+const (
+ IssueStateOpen IssueState = "OPEN" // An issue that is still open.
+ IssueStateClosed IssueState = "CLOSED" // An issue that has been closed.
+)
+
+// LanguageOrderField represents properties by which language connections can be ordered.
+type LanguageOrderField string
+
+// Properties by which language connections can be ordered.
+const (
+ LanguageOrderFieldSize LanguageOrderField = "SIZE" // Order languages by the size of all files containing the language.
+)
+
+// LockReason represents the possible reasons that an issue or pull request was locked.
+type LockReason string
+
+// The possible reasons that an issue or pull request was locked.
+const (
+ LockReasonOffTopic LockReason = "OFF_TOPIC" // The issue or pull request was locked because the conversation was off-topic.
+ LockReasonTooHeated LockReason = "TOO_HEATED" // The issue or pull request was locked because the conversation was too heated.
+ LockReasonResolved LockReason = "RESOLVED" // The issue or pull request was locked because the conversation was resolved.
+ LockReasonSpam LockReason = "SPAM" // The issue or pull request was locked because the conversation was spam.
+)
+
+// MergeableState represents whether or not a PullRequest can be merged.
+type MergeableState string
+
+// Whether or not a PullRequest can be merged.
+const (
+ MergeableStateMergeable MergeableState = "MERGEABLE" // The pull request can be merged.
+ MergeableStateConflicting MergeableState = "CONFLICTING" // The pull request cannot be merged due to merge conflicts.
+ MergeableStateUnknown MergeableState = "UNKNOWN" // The mergeability of the pull request is still being calculated.
+)
+
+// MilestoneOrderField represents properties by which milestone connections can be ordered.
+type MilestoneOrderField string
+
+// Properties by which milestone connections can be ordered.
+const (
+ MilestoneOrderFieldDueDate MilestoneOrderField = "DUE_DATE" // Order milestones by when they are due.
+ MilestoneOrderFieldCreatedAt MilestoneOrderField = "CREATED_AT" // Order milestones by when they were created.
+ MilestoneOrderFieldUpdatedAt MilestoneOrderField = "UPDATED_AT" // Order milestones by when they were last updated.
+ MilestoneOrderFieldNumber MilestoneOrderField = "NUMBER" // Order milestones by their number.
+)
+
+// MilestoneState represents the possible states of a milestone.
+type MilestoneState string
+
+// The possible states of a milestone.
+const (
+ MilestoneStateOpen MilestoneState = "OPEN" // A milestone that is still open.
+ MilestoneStateClosed MilestoneState = "CLOSED" // A milestone that has been closed.
+)
+
+// OrderDirection represents possible directions in which to order a list of items when provided an `orderBy` argument.
+type OrderDirection string
+
+// Possible directions in which to order a list of items when provided an `orderBy` argument.
+const (
+ OrderDirectionAsc OrderDirection = "ASC" // Specifies an ascending order for a given `orderBy` argument.
+ OrderDirectionDesc OrderDirection = "DESC" // Specifies a descending order for a given `orderBy` argument.
+)
+
+// OrganizationInvitationRole represents the possible organization invitation roles.
+type OrganizationInvitationRole string
+
+// The possible organization invitation roles.
+const (
+ OrganizationInvitationRoleDirectMember OrganizationInvitationRole = "DIRECT_MEMBER" // The user is invited to be a direct member of the organization.
+ OrganizationInvitationRoleAdmin OrganizationInvitationRole = "ADMIN" // The user is invited to be an admin of the organization.
+ OrganizationInvitationRoleBillingManager OrganizationInvitationRole = "BILLING_MANAGER" // The user is invited to be a billing manager of the organization.
+ OrganizationInvitationRoleReinstate OrganizationInvitationRole = "REINSTATE" // The user's previous role will be reinstated.
+)
+
+// OrganizationInvitationType represents the possible organization invitation types.
+type OrganizationInvitationType string
+
+// The possible organization invitation types.
+const (
+ OrganizationInvitationTypeUser OrganizationInvitationType = "USER" // The invitation was to an existing user.
+ OrganizationInvitationTypeEmail OrganizationInvitationType = "EMAIL" // The invitation was to an email address.
+)
+
+// ProjectCardState represents various content states of a ProjectCard.
+type ProjectCardState string
+
+// Various content states of a ProjectCard.
+const (
+ ProjectCardStateContentOnly ProjectCardState = "CONTENT_ONLY" // The card has content only.
+ ProjectCardStateNoteOnly ProjectCardState = "NOTE_ONLY" // The card has a note only.
+ ProjectCardStateRedacted ProjectCardState = "REDACTED" // The card is redacted.
+)
+
+// ProjectOrderField represents properties by which project connections can be ordered.
+type ProjectOrderField string
+
+// Properties by which project connections can be ordered.
+const (
+ ProjectOrderFieldCreatedAt ProjectOrderField = "CREATED_AT" // Order projects by creation time.
+ ProjectOrderFieldUpdatedAt ProjectOrderField = "UPDATED_AT" // Order projects by update time.
+ ProjectOrderFieldName ProjectOrderField = "NAME" // Order projects by name.
+)
+
+// ProjectState represents state of the project; either 'open' or 'closed'.
+type ProjectState string
+
+// State of the project; either 'open' or 'closed'.
+const (
+ ProjectStateOpen ProjectState = "OPEN" // The project is open.
+ ProjectStateClosed ProjectState = "CLOSED" // The project is closed.
+)
+
+// PullRequestPubSubTopic represents the possible PubSub channels for a pull request.
+type PullRequestPubSubTopic string
+
+// The possible PubSub channels for a pull request.
+const (
+ PullRequestPubSubTopicUpdated PullRequestPubSubTopic = "UPDATED" // The channel ID for observing pull request updates.
+ PullRequestPubSubTopicMarkasread PullRequestPubSubTopic = "MARKASREAD" // The channel ID for marking an pull request as read.
+ PullRequestPubSubTopicHeadRef PullRequestPubSubTopic = "HEAD_REF" // The channel ID for observing head ref updates.
+ PullRequestPubSubTopicTimeline PullRequestPubSubTopic = "TIMELINE" // The channel ID for updating items on the pull request timeline.
+)
+
+// PullRequestReviewEvent represents the possible events to perform on a pull request review.
+type PullRequestReviewEvent string
+
+// The possible events to perform on a pull request review.
+const (
+ PullRequestReviewEventComment PullRequestReviewEvent = "COMMENT" // Submit general feedback without explicit approval.
+ PullRequestReviewEventApprove PullRequestReviewEvent = "APPROVE" // Submit feedback and approve merging these changes.
+ PullRequestReviewEventRequestChanges PullRequestReviewEvent = "REQUEST_CHANGES" // Submit feedback that must be addressed before merging.
+ PullRequestReviewEventDismiss PullRequestReviewEvent = "DISMISS" // Dismiss review so it now longer effects merging.
+)
+
+// PullRequestReviewState represents the possible states of a pull request review.
+type PullRequestReviewState string
+
+// The possible states of a pull request review.
+const (
+ PullRequestReviewStatePending PullRequestReviewState = "PENDING" // A review that has not yet been submitted.
+ PullRequestReviewStateCommented PullRequestReviewState = "COMMENTED" // An informational review.
+ PullRequestReviewStateApproved PullRequestReviewState = "APPROVED" // A review allowing the pull request to merge.
+ PullRequestReviewStateChangesRequested PullRequestReviewState = "CHANGES_REQUESTED" // A review blocking the pull request from merging.
+ PullRequestReviewStateDismissed PullRequestReviewState = "DISMISSED" // A review that has been dismissed.
+)
+
+// PullRequestState represents the possible states of a pull request.
+type PullRequestState string
+
+// The possible states of a pull request.
+const (
+ PullRequestStateOpen PullRequestState = "OPEN" // A pull request that is still open.
+ PullRequestStateClosed PullRequestState = "CLOSED" // A pull request that has been closed without being merged.
+ PullRequestStateMerged PullRequestState = "MERGED" // A pull request that has been closed by being merged.
+)
+
+// ReactionContent represents emojis that can be attached to Issues, Pull Requests and Comments.
+type ReactionContent string
+
+// Emojis that can be attached to Issues, Pull Requests and Comments.
+const (
+ ReactionContentThumbsUp ReactionContent = "THUMBS_UP" // Represents the πŸ‘ emoji.
+ ReactionContentThumbsDown ReactionContent = "THUMBS_DOWN" // Represents the πŸ‘Ž emoji.
+ ReactionContentLaugh ReactionContent = "LAUGH" // Represents the πŸ˜„ emoji.
+ ReactionContentHooray ReactionContent = "HOORAY" // Represents the πŸŽ‰ emoji.
+ ReactionContentConfused ReactionContent = "CONFUSED" // Represents the πŸ˜• emoji.
+ ReactionContentHeart ReactionContent = "HEART" // Represents the ❀️ emoji.
+)
+
+// ReactionOrderField represents a list of fields that reactions can be ordered by.
+type ReactionOrderField string
+
+// A list of fields that reactions can be ordered by.
+const (
+ ReactionOrderFieldCreatedAt ReactionOrderField = "CREATED_AT" // Allows ordering a list of reactions by when they were created.
+)
+
+// RefOrderField represents properties by which ref connections can be ordered.
+type RefOrderField string
+
+// Properties by which ref connections can be ordered.
+const (
+ RefOrderFieldTagCommitDate RefOrderField = "TAG_COMMIT_DATE" // Order refs by underlying commit date if the ref prefix is refs/tags/.
+ RefOrderFieldAlphabetical RefOrderField = "ALPHABETICAL" // Order refs by their alphanumeric name.
+)
+
+// ReleaseOrderField represents properties by which release connections can be ordered.
+type ReleaseOrderField string
+
+// Properties by which release connections can be ordered.
+const (
+ ReleaseOrderFieldCreatedAt ReleaseOrderField = "CREATED_AT" // Order releases by creation time.
+ ReleaseOrderFieldName ReleaseOrderField = "NAME" // Order releases alphabetically by name.
+)
+
+// RepositoryAffiliation represents the affiliation of a user to a repository.
+type RepositoryAffiliation string
+
+// The affiliation of a user to a repository.
+const (
+ RepositoryAffiliationOwner RepositoryAffiliation = "OWNER" // Repositories that are owned by the authenticated user.
+ RepositoryAffiliationCollaborator RepositoryAffiliation = "COLLABORATOR" // Repositories that the user has been added to as a collaborator.
+ RepositoryAffiliationOrganizationMember RepositoryAffiliation = "ORGANIZATION_MEMBER" // Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on.
+)
+
+// RepositoryCollaboratorAffiliation represents the affiliation type between collaborator and repository.
+type RepositoryCollaboratorAffiliation string
+
+// The affiliation type between collaborator and repository.
+const (
+ RepositoryCollaboratorAffiliationAll RepositoryCollaboratorAffiliation = "ALL" // All collaborators of the repository.
+ RepositoryCollaboratorAffiliationOutside RepositoryCollaboratorAffiliation = "OUTSIDE" // All outside collaborators of an organization-owned repository.
+)
+
+// RepositoryContributionType represents the reason a repository is listed as 'contributed'.
+type RepositoryContributionType string
+
+// The reason a repository is listed as 'contributed'.
+const (
+ RepositoryContributionTypeCommit RepositoryContributionType = "COMMIT" // Created a commit.
+ RepositoryContributionTypeIssue RepositoryContributionType = "ISSUE" // Created an issue.
+ RepositoryContributionTypePullRequest RepositoryContributionType = "PULL_REQUEST" // Created a pull request.
+ RepositoryContributionTypeRepository RepositoryContributionType = "REPOSITORY" // Created the repository.
+ RepositoryContributionTypePullRequestReview RepositoryContributionType = "PULL_REQUEST_REVIEW" // Reviewed a pull request.
+)
+
+// RepositoryLockReason represents the possible reasons a given repository could be in a locked state.
+type RepositoryLockReason string
+
+// The possible reasons a given repository could be in a locked state.
+const (
+ RepositoryLockReasonMoving RepositoryLockReason = "MOVING" // The repository is locked due to a move.
+ RepositoryLockReasonBilling RepositoryLockReason = "BILLING" // The repository is locked due to a billing related reason.
+ RepositoryLockReasonRename RepositoryLockReason = "RENAME" // The repository is locked due to a rename.
+ RepositoryLockReasonMigrating RepositoryLockReason = "MIGRATING" // The repository is locked due to a migration.
+)
+
+// RepositoryOrderField represents properties by which repository connections can be ordered.
+type RepositoryOrderField string
+
+// Properties by which repository connections can be ordered.
+const (
+ RepositoryOrderFieldCreatedAt RepositoryOrderField = "CREATED_AT" // Order repositories by creation time.
+ RepositoryOrderFieldUpdatedAt RepositoryOrderField = "UPDATED_AT" // Order repositories by update time.
+ RepositoryOrderFieldPushedAt RepositoryOrderField = "PUSHED_AT" // Order repositories by push time.
+ RepositoryOrderFieldName RepositoryOrderField = "NAME" // Order repositories by name.
+ RepositoryOrderFieldStargazers RepositoryOrderField = "STARGAZERS" // Order repositories by number of stargazers.
+)
+
+// RepositoryPermission represents the access level to a repository.
+type RepositoryPermission string
+
+// The access level to a repository.
+const (
+ RepositoryPermissionAdmin RepositoryPermission = "ADMIN" // Can read, clone, push, and add collaborators.
+ RepositoryPermissionWrite RepositoryPermission = "WRITE" // Can read, clone and push.
+ RepositoryPermissionRead RepositoryPermission = "READ" // Can read and clone.
+)
+
+// RepositoryPrivacy represents the privacy of a repository.
+type RepositoryPrivacy string
+
+// The privacy of a repository.
+const (
+ RepositoryPrivacyPublic RepositoryPrivacy = "PUBLIC" // Public.
+ RepositoryPrivacyPrivate RepositoryPrivacy = "PRIVATE" // Private.
+)
+
+// SearchType represents represents the individual results of a search.
+type SearchType string
+
+// Represents the individual results of a search.
+const (
+ SearchTypeIssue SearchType = "ISSUE" // Returns results matching issues in repositories.
+ SearchTypeRepository SearchType = "REPOSITORY" // Returns results matching repositories.
+ SearchTypeUser SearchType = "USER" // Returns results matching users and organizations on GitHub.
+)
+
+// StarOrderField represents properties by which star connections can be ordered.
+type StarOrderField string
+
+// Properties by which star connections can be ordered.
+const (
+ StarOrderFieldStarredAt StarOrderField = "STARRED_AT" // Allows ordering a list of stars by when they were created.
+)
+
+// StatusState represents the possible commit status states.
+type StatusState string
+
+// The possible commit status states.
+const (
+ StatusStateExpected StatusState = "EXPECTED" // Status is expected.
+ StatusStateError StatusState = "ERROR" // Status is errored.
+ StatusStateFailure StatusState = "FAILURE" // Status is failing.
+ StatusStatePending StatusState = "PENDING" // Status is pending.
+ StatusStateSuccess StatusState = "SUCCESS" // Status is successful.
+)
+
+// SubscriptionState represents the possible states of a subscription.
+type SubscriptionState string
+
+// The possible states of a subscription.
+const (
+ SubscriptionStateUnsubscribed SubscriptionState = "UNSUBSCRIBED" // The User is only notified when particpating or @mentioned.
+ SubscriptionStateSubscribed SubscriptionState = "SUBSCRIBED" // The User is notified of all conversations.
+ SubscriptionStateIgnored SubscriptionState = "IGNORED" // The User is never notified.
+)
+
+// TeamMemberOrderField represents properties by which team member connections can be ordered.
+type TeamMemberOrderField string
+
+// Properties by which team member connections can be ordered.
+const (
+ TeamMemberOrderFieldLogin TeamMemberOrderField = "LOGIN" // Order team members by login.
+ TeamMemberOrderFieldCreatedAt TeamMemberOrderField = "CREATED_AT" // Order team members by creation time.
+)
+
+// TeamMemberRole represents the possible team member roles; either 'maintainer' or 'member'.
+type TeamMemberRole string
+
+// The possible team member roles; either 'maintainer' or 'member'.
+const (
+ TeamMemberRoleMaintainer TeamMemberRole = "MAINTAINER" // A team maintainer has permission to add and remove team members.
+ TeamMemberRoleMember TeamMemberRole = "MEMBER" // A team member has no administrative permissions on the team.
+)
+
+// TeamMembershipType represents defines which types of team members are included in the returned list. Can be one of IMMEDIATE, CHILD_TEAM or ALL.
+type TeamMembershipType string
+
+// Defines which types of team members are included in the returned list. Can be one of IMMEDIATE, CHILD_TEAM or ALL.
+const (
+ TeamMembershipTypeImmediate TeamMembershipType = "IMMEDIATE" // Includes only immediate members of the team.
+ TeamMembershipTypeChildTeam TeamMembershipType = "CHILD_TEAM" // Includes only child team members for the team.
+ TeamMembershipTypeAll TeamMembershipType = "ALL" // Includes immediate and child team members for the team.
+)
+
+// TeamOrderField represents properties by which team connections can be ordered.
+type TeamOrderField string
+
+// Properties by which team connections can be ordered.
+const (
+ TeamOrderFieldName TeamOrderField = "NAME" // Allows ordering a list of teams by name.
+)
+
+// TeamPrivacy represents the possible team privacy values.
+type TeamPrivacy string
+
+// The possible team privacy values.
+const (
+ TeamPrivacySecret TeamPrivacy = "SECRET" // A secret team can only be seen by its members.
+ TeamPrivacyVisible TeamPrivacy = "VISIBLE" // A visible team can be seen and @mentioned by every member of the organization.
+)
+
+// TeamRepositoryOrderField represents properties by which team repository connections can be ordered.
+type TeamRepositoryOrderField string
+
+// Properties by which team repository connections can be ordered.
+const (
+ TeamRepositoryOrderFieldCreatedAt TeamRepositoryOrderField = "CREATED_AT" // Order repositories by creation time.
+ TeamRepositoryOrderFieldUpdatedAt TeamRepositoryOrderField = "UPDATED_AT" // Order repositories by update time.
+ TeamRepositoryOrderFieldPushedAt TeamRepositoryOrderField = "PUSHED_AT" // Order repositories by push time.
+ TeamRepositoryOrderFieldName TeamRepositoryOrderField = "NAME" // Order repositories by name.
+ TeamRepositoryOrderFieldPermission TeamRepositoryOrderField = "PERMISSION" // Order repositories by permission.
+ TeamRepositoryOrderFieldStargazers TeamRepositoryOrderField = "STARGAZERS" // Order repositories by number of stargazers.
+)
+
+// TeamRole represents the role of a user on a team.
+type TeamRole string
+
+// The role of a user on a team.
+const (
+ TeamRoleAdmin TeamRole = "ADMIN" // User has admin rights on the team.
+ TeamRoleMember TeamRole = "MEMBER" // User is a member of the team.
+)
+
+// TopicSuggestionDeclineReason represents reason that the suggested topic is declined.
+type TopicSuggestionDeclineReason string
+
+// Reason that the suggested topic is declined.
+const (
+ TopicSuggestionDeclineReasonNotRelevant TopicSuggestionDeclineReason = "NOT_RELEVANT" // The suggested topic is not relevant to the repository.
+ TopicSuggestionDeclineReasonTooSpecific TopicSuggestionDeclineReason = "TOO_SPECIFIC" // The suggested topic is too specific for the repository (e.g. #ruby-on-rails-version-4-2-1).
+ TopicSuggestionDeclineReasonPersonalPreference TopicSuggestionDeclineReason = "PERSONAL_PREFERENCE" // The viewer does not like the suggested topic.
+ TopicSuggestionDeclineReasonTooGeneral TopicSuggestionDeclineReason = "TOO_GENERAL" // The suggested topic is too general for the repository.
+)
diff --git a/vendor/github.com/shurcooL/githubv4/gen.go b/vendor/github.com/shurcooL/githubv4/gen.go
new file mode 100644
index 00000000..43ad1e35
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/gen.go
@@ -0,0 +1,192 @@
+// +build ignore
+
+package main
+
+import (
+ "bytes"
+ "encoding/json"
+ "flag"
+ "fmt"
+ "go/format"
+ "io/ioutil"
+ "log"
+ "net/http"
+ "os"
+ "sort"
+ "strconv"
+ "strings"
+ "text/template"
+
+ "github.com/shurcooL/graphql/ident"
+)
+
+func main() {
+ flag.Parse()
+
+ err := run()
+ if err != nil {
+ log.Fatalln(err)
+ }
+}
+
+func run() error {
+ githubToken, ok := os.LookupEnv("GITHUB_TOKEN")
+ if !ok {
+ return fmt.Errorf("GITHUB_TOKEN environment variable not set")
+ }
+ schema, err := loadSchema(githubToken)
+ if err != nil {
+ return err
+ }
+
+ for filename, t := range templates {
+ var buf bytes.Buffer
+ err := t.Execute(&buf, schema)
+ if err != nil {
+ return err
+ }
+ out, err := format.Source(buf.Bytes())
+ if err != nil {
+ log.Println(err)
+ out = []byte("// gofmt error: " + err.Error() + "\n\n" + buf.String())
+ }
+ fmt.Println("writing", filename)
+ err = ioutil.WriteFile(filename, out, 0644)
+ if err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func loadSchema(githubToken string) (schema interface{}, err error) {
+ req, err := http.NewRequest("GET", "https://api.github.com/graphql", nil)
+ if err != nil {
+ return nil, err
+ }
+ req.Header.Set("Authorization", "bearer "+githubToken)
+ resp, err := http.DefaultClient.Do(req)
+ if err != nil {
+ return nil, err
+ }
+ defer resp.Body.Close()
+ err = json.NewDecoder(resp.Body).Decode(&schema)
+ return schema, err
+}
+
+// Filename -> Template.
+var templates = map[string]*template.Template{
+ "enum.go": t(`// Code generated by gen.go; DO NOT EDIT.
+
+package githubv4
+{{range .data.__schema.types | sortByName}}{{if and (eq .kind "ENUM") (not (internal .name))}}
+{{template "enum" .}}
+{{end}}{{end}}
+
+
+{{- define "enum" -}}
+// {{.name}} {{.description | endSentence}}
+type {{.name}} string
+
+// {{.description | fullSentence}}
+const ({{range .enumValues}}
+ {{$.name}}{{.name | enumIdentifier}} {{$.name}} = {{.name | quote}} // {{.description | fullSentence}}{{end}}
+)
+{{- end -}}
+`),
+
+ "input.go": t(`// Code generated by gen.go; DO NOT EDIT.
+
+package githubv4
+
+// Input represents one of the Input structs:
+//
+// {{join (inputObjects .data.__schema.types) ", "}}.
+type Input interface{}
+{{range .data.__schema.types | sortByName}}{{if eq .kind "INPUT_OBJECT"}}
+{{template "inputObject" .}}
+{{end}}{{end}}
+
+
+{{- define "inputObject" -}}
+// {{.name}} {{.description | endSentence}}
+type {{.name}} struct {{"{"}}{{range .inputFields}}{{if eq .type.kind "NON_NULL"}}
+ // {{.description | fullSentence}} (Required.)
+ {{.name | identifier}} {{.type | type}} ` + "`" + `json:"{{.name}}"` + "`" + `{{end}}{{end}}
+{{range .inputFields}}{{if ne .type.kind "NON_NULL"}}
+ // {{.description | fullSentence}} (Optional.)
+ {{.name | identifier}} {{.type | type}} ` + "`" + `json:"{{.name}},omitempty"` + "`" + `{{end}}{{end}}
+}
+{{- end -}}
+`),
+}
+
+func t(text string) *template.Template {
+ // typeString returns a string representation of GraphQL type t.
+ var typeString func(t map[string]interface{}) string
+ typeString = func(t map[string]interface{}) string {
+ switch t["kind"] {
+ case "NON_NULL":
+ s := typeString(t["ofType"].(map[string]interface{}))
+ if !strings.HasPrefix(s, "*") {
+ panic(fmt.Errorf("nullable type %q doesn't begin with '*'", s))
+ }
+ return s[1:] // Strip star from nullable type to make it non-null.
+ case "LIST":
+ return "*[]" + typeString(t["ofType"].(map[string]interface{}))
+ default:
+ return "*" + t["name"].(string)
+ }
+ }
+
+ return template.Must(template.New("").Funcs(template.FuncMap{
+ "internal": func(s string) bool { return strings.HasPrefix(s, "__") },
+ "quote": strconv.Quote,
+ "join": strings.Join,
+ "sortByName": func(types []interface{}) []interface{} {
+ sort.Slice(types, func(i, j int) bool {
+ ni := types[i].(map[string]interface{})["name"].(string)
+ nj := types[j].(map[string]interface{})["name"].(string)
+ return ni < nj
+ })
+ return types
+ },
+ "inputObjects": func(types []interface{}) []string {
+ var names []string
+ for _, t := range types {
+ t := t.(map[string]interface{})
+ if t["kind"].(string) != "INPUT_OBJECT" {
+ continue
+ }
+ names = append(names, t["name"].(string))
+ }
+ sort.Strings(names)
+ return names
+ },
+ "identifier": func(name string) string { return ident.ParseLowerCamelCase(name).ToMixedCaps() },
+ "enumIdentifier": func(name string) string { return ident.ParseScreamingSnakeCase(name).ToMixedCaps() },
+ "type": typeString,
+ "endSentence": func(s string) string {
+ s = strings.ToLower(s[0:1]) + s[1:]
+ switch {
+ default:
+ s = "represents " + s
+ case strings.HasPrefix(s, "autogenerated "):
+ s = "is an " + s
+ case strings.HasPrefix(s, "specifies "):
+ // Do nothing.
+ }
+ if !strings.HasSuffix(s, ".") {
+ s += "."
+ }
+ return s
+ },
+ "fullSentence": func(s string) string {
+ if !strings.HasSuffix(s, ".") {
+ s += "."
+ }
+ return s
+ },
+ }).Parse(text))
+}
diff --git a/vendor/github.com/shurcooL/githubv4/githubv4.go b/vendor/github.com/shurcooL/githubv4/githubv4.go
new file mode 100644
index 00000000..3a544bf2
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/githubv4.go
@@ -0,0 +1,56 @@
+package githubv4
+
+import (
+ "context"
+ "net/http"
+
+ "github.com/shurcooL/graphql"
+)
+
+// Client is a GitHub GraphQL API v4 client.
+type Client struct {
+ client *graphql.Client
+}
+
+// NewClient creates a new GitHub GraphQL API v4 client with the provided http.Client.
+// If httpClient is nil, then http.DefaultClient is used.
+//
+// Note that GitHub GraphQL API v4 requires authentication, so
+// the provided http.Client is expected to take care of that.
+func NewClient(httpClient *http.Client) *Client {
+ return &Client{
+ client: graphql.NewClient("https://api.github.com/graphql", httpClient),
+ }
+}
+
+// NewEnterpriseClient creates a new GitHub GraphQL API v4 client for the GitHub Enterprise
+// instance with the specified GraphQL endpoint URL, using the provided http.Client.
+// If httpClient is nil, then http.DefaultClient is used.
+//
+// Note that GitHub GraphQL API v4 requires authentication, so
+// the provided http.Client is expected to take care of that.
+func NewEnterpriseClient(url string, httpClient *http.Client) *Client {
+ return &Client{
+ client: graphql.NewClient(url, httpClient),
+ }
+}
+
+// Query executes a single GraphQL query request,
+// with a query derived from q, populating the response into it.
+// q should be a pointer to struct that corresponds to the GitHub GraphQL schema.
+func (c *Client) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error {
+ return c.client.Query(ctx, q, variables)
+}
+
+// Mutate executes a single GraphQL mutation request,
+// with a mutation derived from m, populating the response into it.
+// m should be a pointer to struct that corresponds to the GitHub GraphQL schema.
+// Provided input will be set as a variable named "input".
+func (c *Client) Mutate(ctx context.Context, m interface{}, input Input, variables map[string]interface{}) error {
+ if variables == nil {
+ variables = map[string]interface{}{"input": input}
+ } else {
+ variables["input"] = input
+ }
+ return c.client.Mutate(ctx, m, variables)
+}
diff --git a/vendor/github.com/shurcooL/githubv4/input.go b/vendor/github.com/shurcooL/githubv4/input.go
new file mode 100644
index 00000000..ce1976f8
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/input.go
@@ -0,0 +1,483 @@
+// Code generated by gen.go; DO NOT EDIT.
+
+package githubv4
+
+// Input represents one of the Input structs:
+//
+// AcceptTopicSuggestionInput, AddCommentInput, AddProjectCardInput, AddProjectColumnInput, AddPullRequestReviewCommentInput, AddPullRequestReviewInput, AddReactionInput, AddStarInput, CommitAuthor, CreateProjectInput, DeclineTopicSuggestionInput, DeleteProjectCardInput, DeleteProjectColumnInput, DeleteProjectInput, DeletePullRequestReviewInput, DismissPullRequestReviewInput, DraftPullRequestReviewComment, GistOrder, IssueOrder, LanguageOrder, LockLockableInput, MilestoneOrder, MoveProjectCardInput, MoveProjectColumnInput, ProjectOrder, ReactionOrder, RefOrder, ReleaseOrder, RemoveOutsideCollaboratorInput, RemoveReactionInput, RemoveStarInput, RepositoryOrder, RequestReviewsInput, StarOrder, SubmitPullRequestReviewInput, TeamMemberOrder, TeamOrder, TeamRepositoryOrder, UpdateProjectCardInput, UpdateProjectColumnInput, UpdateProjectInput, UpdatePullRequestReviewCommentInput, UpdatePullRequestReviewInput, UpdateSubscriptionInput, UpdateTopicsInput.
+type Input interface{}
+
+// AcceptTopicSuggestionInput is an autogenerated input type of AcceptTopicSuggestion.
+type AcceptTopicSuggestionInput struct {
+ // The Node ID of the repository. (Required.)
+ RepositoryID ID `json:"repositoryId"`
+ // The name of the suggested topic. (Required.)
+ Name String `json:"name"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddCommentInput is an autogenerated input type of AddComment.
+type AddCommentInput struct {
+ // The Node ID of the subject to modify. (Required.)
+ SubjectID ID `json:"subjectId"`
+ // The contents of the comment. (Required.)
+ Body String `json:"body"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddProjectCardInput is an autogenerated input type of AddProjectCard.
+type AddProjectCardInput struct {
+ // The Node ID of the ProjectColumn. (Required.)
+ ProjectColumnID ID `json:"projectColumnId"`
+
+ // The content of the card. Must be a member of the ProjectCardItem union. (Optional.)
+ ContentID *ID `json:"contentId,omitempty"`
+ // The note on the card. (Optional.)
+ Note *String `json:"note,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddProjectColumnInput is an autogenerated input type of AddProjectColumn.
+type AddProjectColumnInput struct {
+ // The Node ID of the project. (Required.)
+ ProjectID ID `json:"projectId"`
+ // The name of the column. (Required.)
+ Name String `json:"name"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddPullRequestReviewCommentInput is an autogenerated input type of AddPullRequestReviewComment.
+type AddPullRequestReviewCommentInput struct {
+ // The Node ID of the review to modify. (Required.)
+ PullRequestReviewID ID `json:"pullRequestReviewId"`
+ // The text of the comment. (Required.)
+ Body String `json:"body"`
+
+ // The SHA of the commit to comment on. (Optional.)
+ CommitOID *GitObjectID `json:"commitOID,omitempty"`
+ // The relative path of the file to comment on. (Optional.)
+ Path *String `json:"path,omitempty"`
+ // The line index in the diff to comment on. (Optional.)
+ Position *Int `json:"position,omitempty"`
+ // The comment id to reply to. (Optional.)
+ InReplyTo *ID `json:"inReplyTo,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddPullRequestReviewInput is an autogenerated input type of AddPullRequestReview.
+type AddPullRequestReviewInput struct {
+ // The Node ID of the pull request to modify. (Required.)
+ PullRequestID ID `json:"pullRequestId"`
+
+ // The commit OID the review pertains to. (Optional.)
+ CommitOID *GitObjectID `json:"commitOID,omitempty"`
+ // The contents of the review body comment. (Optional.)
+ Body *String `json:"body,omitempty"`
+ // The event to perform on the pull request review. (Optional.)
+ Event *PullRequestReviewEvent `json:"event,omitempty"`
+ // The review line comments. (Optional.)
+ Comments *[]*DraftPullRequestReviewComment `json:"comments,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddReactionInput is an autogenerated input type of AddReaction.
+type AddReactionInput struct {
+ // The Node ID of the subject to modify. (Required.)
+ SubjectID ID `json:"subjectId"`
+ // The name of the emoji to react with. (Required.)
+ Content ReactionContent `json:"content"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// AddStarInput is an autogenerated input type of AddStar.
+type AddStarInput struct {
+ // The Starrable ID to star. (Required.)
+ StarrableID ID `json:"starrableId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// CommitAuthor specifies an author for filtering Git commits.
+type CommitAuthor struct {
+
+ // ID of a User to filter by. If non-null, only commits authored by this user will be returned. This field takes precedence over emails. (Optional.)
+ ID *ID `json:"id,omitempty"`
+ // Email addresses to filter by. Commits authored by any of the specified email addresses will be returned. (Optional.)
+ Emails *[]String `json:"emails,omitempty"`
+}
+
+// CreateProjectInput is an autogenerated input type of CreateProject.
+type CreateProjectInput struct {
+ // The owner ID to create the project under. (Required.)
+ OwnerID ID `json:"ownerId"`
+ // The name of project. (Required.)
+ Name String `json:"name"`
+
+ // The description of project. (Optional.)
+ Body *String `json:"body,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DeclineTopicSuggestionInput is an autogenerated input type of DeclineTopicSuggestion.
+type DeclineTopicSuggestionInput struct {
+ // The Node ID of the repository. (Required.)
+ RepositoryID ID `json:"repositoryId"`
+ // The name of the suggested topic. (Required.)
+ Name String `json:"name"`
+ // The reason why the suggested topic is declined. (Required.)
+ Reason TopicSuggestionDeclineReason `json:"reason"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DeleteProjectCardInput is an autogenerated input type of DeleteProjectCard.
+type DeleteProjectCardInput struct {
+ // The id of the card to delete. (Required.)
+ CardID ID `json:"cardId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DeleteProjectColumnInput is an autogenerated input type of DeleteProjectColumn.
+type DeleteProjectColumnInput struct {
+ // The id of the column to delete. (Required.)
+ ColumnID ID `json:"columnId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DeleteProjectInput is an autogenerated input type of DeleteProject.
+type DeleteProjectInput struct {
+ // The Project ID to update. (Required.)
+ ProjectID ID `json:"projectId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DeletePullRequestReviewInput is an autogenerated input type of DeletePullRequestReview.
+type DeletePullRequestReviewInput struct {
+ // The Node ID of the pull request review to delete. (Required.)
+ PullRequestReviewID ID `json:"pullRequestReviewId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DismissPullRequestReviewInput is an autogenerated input type of DismissPullRequestReview.
+type DismissPullRequestReviewInput struct {
+ // The Node ID of the pull request review to modify. (Required.)
+ PullRequestReviewID ID `json:"pullRequestReviewId"`
+ // The contents of the pull request review dismissal message. (Required.)
+ Message String `json:"message"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// DraftPullRequestReviewComment specifies a review comment to be left with a Pull Request Review.
+type DraftPullRequestReviewComment struct {
+ // Path to the file being commented on. (Required.)
+ Path String `json:"path"`
+ // Position in the file to leave a comment on. (Required.)
+ Position Int `json:"position"`
+ // Body of the comment to leave. (Required.)
+ Body String `json:"body"`
+}
+
+// GistOrder represents ordering options for gist connections.
+type GistOrder struct {
+ // The field to order repositories by. (Required.)
+ Field GistOrderField `json:"field"`
+ // The ordering direction. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// IssueOrder represents ways in which lists of issues can be ordered upon return.
+type IssueOrder struct {
+ // The field in which to order issues by. (Required.)
+ Field IssueOrderField `json:"field"`
+ // The direction in which to order issues by the specified field. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// LanguageOrder represents ordering options for language connections.
+type LanguageOrder struct {
+ // The field to order languages by. (Required.)
+ Field LanguageOrderField `json:"field"`
+ // The ordering direction. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// LockLockableInput is an autogenerated input type of LockLockable.
+type LockLockableInput struct {
+ // ID of the issue or pull request to be locked. (Required.)
+ LockableID ID `json:"lockableId"`
+
+ // A reason for why the issue or pull request will be locked. (Optional.)
+ LockReason *LockReason `json:"lockReason,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// MilestoneOrder represents ordering options for milestone connections.
+type MilestoneOrder struct {
+ // The field to order milestones by. (Required.)
+ Field MilestoneOrderField `json:"field"`
+ // The ordering direction. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// MoveProjectCardInput is an autogenerated input type of MoveProjectCard.
+type MoveProjectCardInput struct {
+ // The id of the card to move. (Required.)
+ CardID ID `json:"cardId"`
+ // The id of the column to move it into. (Required.)
+ ColumnID ID `json:"columnId"`
+
+ // Place the new card after the card with this id. Pass null to place it at the top. (Optional.)
+ AfterCardID *ID `json:"afterCardId,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// MoveProjectColumnInput is an autogenerated input type of MoveProjectColumn.
+type MoveProjectColumnInput struct {
+ // The id of the column to move. (Required.)
+ ColumnID ID `json:"columnId"`
+
+ // Place the new column after the column with this id. Pass null to place it at the front. (Optional.)
+ AfterColumnID *ID `json:"afterColumnId,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// ProjectOrder represents ways in which lists of projects can be ordered upon return.
+type ProjectOrder struct {
+ // The field in which to order projects by. (Required.)
+ Field ProjectOrderField `json:"field"`
+ // The direction in which to order projects by the specified field. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// ReactionOrder represents ways in which lists of reactions can be ordered upon return.
+type ReactionOrder struct {
+ // The field in which to order reactions by. (Required.)
+ Field ReactionOrderField `json:"field"`
+ // The direction in which to order reactions by the specified field. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// RefOrder represents ways in which lists of git refs can be ordered upon return.
+type RefOrder struct {
+ // The field in which to order refs by. (Required.)
+ Field RefOrderField `json:"field"`
+ // The direction in which to order refs by the specified field. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// ReleaseOrder represents ways in which lists of releases can be ordered upon return.
+type ReleaseOrder struct {
+ // The field in which to order releases by. (Required.)
+ Field ReleaseOrderField `json:"field"`
+ // The direction in which to order releases by the specified field. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// RemoveOutsideCollaboratorInput is an autogenerated input type of RemoveOutsideCollaborator.
+type RemoveOutsideCollaboratorInput struct {
+ // The ID of the outside collaborator to remove. (Required.)
+ UserID ID `json:"userId"`
+ // The ID of the organization to remove the outside collaborator from. (Required.)
+ OrganizationID ID `json:"organizationId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// RemoveReactionInput is an autogenerated input type of RemoveReaction.
+type RemoveReactionInput struct {
+ // The Node ID of the subject to modify. (Required.)
+ SubjectID ID `json:"subjectId"`
+ // The name of the emoji reaction to remove. (Required.)
+ Content ReactionContent `json:"content"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// RemoveStarInput is an autogenerated input type of RemoveStar.
+type RemoveStarInput struct {
+ // The Starrable ID to unstar. (Required.)
+ StarrableID ID `json:"starrableId"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// RepositoryOrder represents ordering options for repository connections.
+type RepositoryOrder struct {
+ // The field to order repositories by. (Required.)
+ Field RepositoryOrderField `json:"field"`
+ // The ordering direction. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// RequestReviewsInput is an autogenerated input type of RequestReviews.
+type RequestReviewsInput struct {
+ // The Node ID of the pull request to modify. (Required.)
+ PullRequestID ID `json:"pullRequestId"`
+
+ // The Node IDs of the user to request. (Optional.)
+ UserIDs *[]ID `json:"userIds,omitempty"`
+ // The Node IDs of the team to request. (Optional.)
+ TeamIDs *[]ID `json:"teamIds,omitempty"`
+ // Add users to the set rather than replace. (Optional.)
+ Union *Boolean `json:"union,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// StarOrder represents ways in which star connections can be ordered.
+type StarOrder struct {
+ // The field in which to order nodes by. (Required.)
+ Field StarOrderField `json:"field"`
+ // The direction in which to order nodes. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// SubmitPullRequestReviewInput is an autogenerated input type of SubmitPullRequestReview.
+type SubmitPullRequestReviewInput struct {
+ // The Pull Request Review ID to submit. (Required.)
+ PullRequestReviewID ID `json:"pullRequestReviewId"`
+ // The event to send to the Pull Request Review. (Required.)
+ Event PullRequestReviewEvent `json:"event"`
+
+ // The text field to set on the Pull Request Review. (Optional.)
+ Body *String `json:"body,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// TeamMemberOrder represents ordering options for team member connections.
+type TeamMemberOrder struct {
+ // The field to order team members by. (Required.)
+ Field TeamMemberOrderField `json:"field"`
+ // The ordering direction. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// TeamOrder represents ways in which team connections can be ordered.
+type TeamOrder struct {
+ // The field in which to order nodes by. (Required.)
+ Field TeamOrderField `json:"field"`
+ // The direction in which to order nodes. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// TeamRepositoryOrder represents ordering options for team repository connections.
+type TeamRepositoryOrder struct {
+ // The field to order repositories by. (Required.)
+ Field TeamRepositoryOrderField `json:"field"`
+ // The ordering direction. (Required.)
+ Direction OrderDirection `json:"direction"`
+}
+
+// UpdateProjectCardInput is an autogenerated input type of UpdateProjectCard.
+type UpdateProjectCardInput struct {
+ // The ProjectCard ID to update. (Required.)
+ ProjectCardID ID `json:"projectCardId"`
+ // The note of ProjectCard. (Required.)
+ Note String `json:"note"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// UpdateProjectColumnInput is an autogenerated input type of UpdateProjectColumn.
+type UpdateProjectColumnInput struct {
+ // The ProjectColumn ID to update. (Required.)
+ ProjectColumnID ID `json:"projectColumnId"`
+ // The name of project column. (Required.)
+ Name String `json:"name"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// UpdateProjectInput is an autogenerated input type of UpdateProject.
+type UpdateProjectInput struct {
+ // The Project ID to update. (Required.)
+ ProjectID ID `json:"projectId"`
+
+ // The name of project. (Optional.)
+ Name *String `json:"name,omitempty"`
+ // The description of project. (Optional.)
+ Body *String `json:"body,omitempty"`
+ // Whether the project is open or closed. (Optional.)
+ State *ProjectState `json:"state,omitempty"`
+ // Whether the project is public or not. (Optional.)
+ Public *Boolean `json:"public,omitempty"`
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// UpdatePullRequestReviewCommentInput is an autogenerated input type of UpdatePullRequestReviewComment.
+type UpdatePullRequestReviewCommentInput struct {
+ // The Node ID of the comment to modify. (Required.)
+ PullRequestReviewCommentID ID `json:"pullRequestReviewCommentId"`
+ // The text of the comment. (Required.)
+ Body String `json:"body"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// UpdatePullRequestReviewInput is an autogenerated input type of UpdatePullRequestReview.
+type UpdatePullRequestReviewInput struct {
+ // The Node ID of the pull request review to modify. (Required.)
+ PullRequestReviewID ID `json:"pullRequestReviewId"`
+ // The contents of the pull request review body. (Required.)
+ Body String `json:"body"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// UpdateSubscriptionInput is an autogenerated input type of UpdateSubscription.
+type UpdateSubscriptionInput struct {
+ // The Node ID of the subscribable object to modify. (Required.)
+ SubscribableID ID `json:"subscribableId"`
+ // The new state of the subscription. (Required.)
+ State SubscriptionState `json:"state"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
+
+// UpdateTopicsInput is an autogenerated input type of UpdateTopics.
+type UpdateTopicsInput struct {
+ // The Node ID of the repository. (Required.)
+ RepositoryID ID `json:"repositoryId"`
+ // An array of topic names. (Required.)
+ TopicNames []String `json:"topicNames"`
+
+ // A unique identifier for the client performing the mutation. (Optional.)
+ ClientMutationID *String `json:"clientMutationId,omitempty"`
+}
diff --git a/vendor/github.com/shurcooL/githubv4/scalar.go b/vendor/github.com/shurcooL/githubv4/scalar.go
new file mode 100644
index 00000000..56a39530
--- /dev/null
+++ b/vendor/github.com/shurcooL/githubv4/scalar.go
@@ -0,0 +1,139 @@
+package githubv4
+
+import (
+ "crypto/x509"
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "time"
+
+ "github.com/shurcooL/graphql"
+)
+
+// Note: These custom types are meant to be used in queries for now.
+// But the plan is to switch to using native Go types (string, int, bool, time.Time, etc.).
+// See https://github.com/shurcooL/githubv4/issues/9 for details.
+//
+// These custom types currently provide documentation, and their use
+// is required for sending outbound queries. However, native Go types
+// can be used for unmarshaling. Once https://github.com/shurcooL/githubv4/issues/9
+// is resolved, native Go types can completely replace these.
+
+type (
+ // Boolean represents true or false values.
+ Boolean graphql.Boolean
+
+ // Date is an ISO-8601 encoded date.
+ Date struct{ time.Time }
+
+ // DateTime is an ISO-8601 encoded UTC date.
+ DateTime struct{ time.Time }
+
+ // Float represents signed double-precision fractional values as
+ // specified by IEEE 754.
+ Float graphql.Float
+
+ // GitObjectID is a Git object ID. For example,
+ // "912ec1990bd09f8fc128c3fa6b59105085aabc03".
+ GitObjectID string
+
+ // GitTimestamp is an ISO-8601 encoded date.
+ // Unlike the DateTime type, GitTimestamp is not converted in UTC.
+ GitTimestamp struct{ time.Time }
+
+ // HTML is a string containing HTML code.
+ HTML string
+
+ // ID represents a unique identifier that is Base64 obfuscated. It
+ // is often used to refetch an object or as key for a cache. The ID
+ // type appears in a JSON response as a String; however, it is not
+ // intended to be human-readable. When expected as an input type,
+ // any string (such as "VXNlci0xMA==") or integer (such as 4) input
+ // value will be accepted as an ID.
+ ID graphql.ID
+
+ // Int represents non-fractional signed whole numeric values.
+ // Int can represent values between -(2^31) and 2^31 - 1.
+ Int graphql.Int
+
+ // String represents textual data as UTF-8 character sequences.
+ // This type is most often used by GraphQL to represent free-form
+ // human-readable text.
+ String graphql.String
+
+ // URI is an RFC 3986, RFC 3987, and RFC 6570 (level 4) compliant URI.
+ URI struct{ *url.URL }
+
+ // X509Certificate is a valid x509 certificate.
+ X509Certificate struct{ *x509.Certificate }
+)
+
+// MarshalJSON implements the json.Marshaler interface.
+// The URI is a quoted string.
+func (u URI) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface.
+// The URI is expected to be a quoted string.
+func (u *URI) UnmarshalJSON(data []byte) error {
+ // Ignore null, like in the main JSON package.
+ if string(data) == "null" {
+ return nil
+ }
+ var s string
+ err := json.Unmarshal(data, &s)
+ if err != nil {
+ return err
+ }
+ u.URL, err = url.Parse(s)
+ return err
+}
+
+// MarshalJSON implements the json.Marshaler interface.
+func (x X509Certificate) MarshalJSON() ([]byte, error) {
+ // TODO: Implement.
+ return nil, fmt.Errorf("X509Certificate.MarshalJSON: not implemented")
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface.
+func (x *X509Certificate) UnmarshalJSON(data []byte) error {
+ // TODO: Implement.
+ return fmt.Errorf("X509Certificate.UnmarshalJSON: not implemented")
+}
+
+// NewBoolean is a helper to make a new *Boolean.
+func NewBoolean(v Boolean) *Boolean { return &v }
+
+// NewDate is a helper to make a new *Date.
+func NewDate(v Date) *Date { return &v }
+
+// NewDateTime is a helper to make a new *DateTime.
+func NewDateTime(v DateTime) *DateTime { return &v }
+
+// NewFloat is a helper to make a new *Float.
+func NewFloat(v Float) *Float { return &v }
+
+// NewGitObjectID is a helper to make a new *GitObjectID.
+func NewGitObjectID(v GitObjectID) *GitObjectID { return &v }
+
+// NewGitTimestamp is a helper to make a new *GitTimestamp.
+func NewGitTimestamp(v GitTimestamp) *GitTimestamp { return &v }
+
+// NewHTML is a helper to make a new *HTML.
+func NewHTML(v HTML) *HTML { return &v }
+
+// NewID is a helper to make a new *ID.
+func NewID(v ID) *ID { return &v }
+
+// NewInt is a helper to make a new *Int.
+func NewInt(v Int) *Int { return &v }
+
+// NewString is a helper to make a new *String.
+func NewString(v String) *String { return &v }
+
+// NewURI is a helper to make a new *URI.
+func NewURI(v URI) *URI { return &v }
+
+// NewX509Certificate is a helper to make a new *X509Certificate.
+func NewX509Certificate(v X509Certificate) *X509Certificate { return &v }