receiver/githubreceiver/internal/scraper/githubscraper/generated_graphql.go (933 lines of code) (raw):
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
package githubscraper
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/Khan/genqlient/graphql"
)
// BranchHistory includes the requested fields of the GraphQL type Ref.
// The GraphQL type's documentation follows.
//
// Represents a Git reference.
type BranchHistory struct {
// The object the ref points to. Returns null when object does not exist.
Target BranchHistoryTargetGitObject `json:"-"`
}
// GetTarget returns BranchHistory.Target, and is useful for accessing the field via an interface.
func (v *BranchHistory) GetTarget() BranchHistoryTargetGitObject { return v.Target }
func (v *BranchHistory) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
return nil
}
var firstPass struct {
*BranchHistory
Target json.RawMessage `json:"target"`
graphql.NoUnmarshalJSON
}
firstPass.BranchHistory = v
err := json.Unmarshal(b, &firstPass)
if err != nil {
return err
}
{
dst := &v.Target
src := firstPass.Target
if len(src) != 0 && string(src) != "null" {
err = __unmarshalBranchHistoryTargetGitObject(
src, dst)
if err != nil {
return fmt.Errorf(
"unable to unmarshal BranchHistory.Target: %w", err)
}
}
}
return nil
}
type __premarshalBranchHistory struct {
Target json.RawMessage `json:"target"`
}
func (v *BranchHistory) MarshalJSON() ([]byte, error) {
premarshaled, err := v.__premarshalJSON()
if err != nil {
return nil, err
}
return json.Marshal(premarshaled)
}
func (v *BranchHistory) __premarshalJSON() (*__premarshalBranchHistory, error) {
var retval __premarshalBranchHistory
{
dst := &retval.Target
src := v.Target
var err error
*dst, err = __marshalBranchHistoryTargetGitObject(
&src)
if err != nil {
return nil, fmt.Errorf(
"unable to marshal BranchHistory.Target: %w", err)
}
}
return &retval, nil
}
// BranchHistoryTargetBlob includes the requested fields of the GraphQL type Blob.
// The GraphQL type's documentation follows.
//
// Represents a Git blob.
type BranchHistoryTargetBlob struct {
Typename string `json:"__typename"`
}
// GetTypename returns BranchHistoryTargetBlob.Typename, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetBlob) GetTypename() string { return v.Typename }
// BranchHistoryTargetCommit includes the requested fields of the GraphQL type Commit.
// The GraphQL type's documentation follows.
//
// Represents a Git commit.
type BranchHistoryTargetCommit struct {
Typename string `json:"__typename"`
Id string `json:"id"`
// The linear commit history starting from (and including) this commit, in the same order as `git log`.
History BranchHistoryTargetCommitHistoryCommitHistoryConnection `json:"history"`
}
// GetTypename returns BranchHistoryTargetCommit.Typename, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommit) GetTypename() string { return v.Typename }
// GetId returns BranchHistoryTargetCommit.Id, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommit) GetId() string { return v.Id }
// GetHistory returns BranchHistoryTargetCommit.History, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommit) GetHistory() BranchHistoryTargetCommitHistoryCommitHistoryConnection {
return v.History
}
// BranchHistoryTargetCommitHistoryCommitHistoryConnection includes the requested fields of the GraphQL type CommitHistoryConnection.
// The GraphQL type's documentation follows.
//
// The connection type for Commit.
type BranchHistoryTargetCommitHistoryCommitHistoryConnection struct {
// A list of nodes.
Nodes []CommitNode `json:"nodes"`
// Information to aid in pagination.
PageInfo BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo `json:"pageInfo"`
}
// GetNodes returns BranchHistoryTargetCommitHistoryCommitHistoryConnection.Nodes, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommitHistoryCommitHistoryConnection) GetNodes() []CommitNode {
return v.Nodes
}
// GetPageInfo returns BranchHistoryTargetCommitHistoryCommitHistoryConnection.PageInfo, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommitHistoryCommitHistoryConnection) GetPageInfo() BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo {
return v.PageInfo
}
// BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo includes the requested fields of the GraphQL type PageInfo.
// The GraphQL type's documentation follows.
//
// Information about pagination in a connection.
type BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo struct {
// When paginating forwards, the cursor to continue.
EndCursor string `json:"endCursor"`
// When paginating forwards, are there more items?
HasNextPage bool `json:"hasNextPage"`
}
// GetEndCursor returns BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo.EndCursor, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo) GetEndCursor() string {
return v.EndCursor
}
// GetHasNextPage returns BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo.HasNextPage, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo) GetHasNextPage() bool {
return v.HasNextPage
}
// BranchHistoryTargetGitObject includes the requested fields of the GraphQL interface GitObject.
//
// BranchHistoryTargetGitObject is implemented by the following types:
// BranchHistoryTargetBlob
// BranchHistoryTargetCommit
// BranchHistoryTargetTag
// BranchHistoryTargetTree
// The GraphQL type's documentation follows.
//
// Represents a Git object.
type BranchHistoryTargetGitObject interface {
implementsGraphQLInterfaceBranchHistoryTargetGitObject()
// GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values).
GetTypename() string
}
func (v *BranchHistoryTargetBlob) implementsGraphQLInterfaceBranchHistoryTargetGitObject() {}
func (v *BranchHistoryTargetCommit) implementsGraphQLInterfaceBranchHistoryTargetGitObject() {}
func (v *BranchHistoryTargetTag) implementsGraphQLInterfaceBranchHistoryTargetGitObject() {}
func (v *BranchHistoryTargetTree) implementsGraphQLInterfaceBranchHistoryTargetGitObject() {}
func __unmarshalBranchHistoryTargetGitObject(b []byte, v *BranchHistoryTargetGitObject) error {
if string(b) == "null" {
return nil
}
var tn struct {
TypeName string `json:"__typename"`
}
err := json.Unmarshal(b, &tn)
if err != nil {
return err
}
switch tn.TypeName {
case "Blob":
*v = new(BranchHistoryTargetBlob)
return json.Unmarshal(b, *v)
case "Commit":
*v = new(BranchHistoryTargetCommit)
return json.Unmarshal(b, *v)
case "Tag":
*v = new(BranchHistoryTargetTag)
return json.Unmarshal(b, *v)
case "Tree":
*v = new(BranchHistoryTargetTree)
return json.Unmarshal(b, *v)
case "":
return fmt.Errorf(
"response was missing GitObject.__typename")
default:
return fmt.Errorf(
`unexpected concrete type for BranchHistoryTargetGitObject: "%v"`, tn.TypeName)
}
}
func __marshalBranchHistoryTargetGitObject(v *BranchHistoryTargetGitObject) ([]byte, error) {
var typename string
switch v := (*v).(type) {
case *BranchHistoryTargetBlob:
typename = "Blob"
result := struct {
TypeName string `json:"__typename"`
*BranchHistoryTargetBlob
}{typename, v}
return json.Marshal(result)
case *BranchHistoryTargetCommit:
typename = "Commit"
result := struct {
TypeName string `json:"__typename"`
*BranchHistoryTargetCommit
}{typename, v}
return json.Marshal(result)
case *BranchHistoryTargetTag:
typename = "Tag"
result := struct {
TypeName string `json:"__typename"`
*BranchHistoryTargetTag
}{typename, v}
return json.Marshal(result)
case *BranchHistoryTargetTree:
typename = "Tree"
result := struct {
TypeName string `json:"__typename"`
*BranchHistoryTargetTree
}{typename, v}
return json.Marshal(result)
case nil:
return []byte("null"), nil
default:
return nil, fmt.Errorf(
`unexpected concrete type for BranchHistoryTargetGitObject: "%T"`, v)
}
}
// BranchHistoryTargetTag includes the requested fields of the GraphQL type Tag.
// The GraphQL type's documentation follows.
//
// Represents a Git tag.
type BranchHistoryTargetTag struct {
Typename string `json:"__typename"`
}
// GetTypename returns BranchHistoryTargetTag.Typename, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetTag) GetTypename() string { return v.Typename }
// BranchHistoryTargetTree includes the requested fields of the GraphQL type Tree.
// The GraphQL type's documentation follows.
//
// Represents a Git tree.
type BranchHistoryTargetTree struct {
Typename string `json:"__typename"`
}
// GetTypename returns BranchHistoryTargetTree.Typename, and is useful for accessing the field via an interface.
func (v *BranchHistoryTargetTree) GetTypename() string { return v.Typename }
// BranchNode includes the requested fields of the GraphQL type Ref.
// The GraphQL type's documentation follows.
//
// Represents a Git reference.
type BranchNode struct {
// The ref name.
Name string `json:"name"`
// Compares the current ref as a base ref to another head ref, if the comparison can be made.
Compare BranchNodeCompareComparison `json:"compare"`
// The repository the ref belongs to.
Repository BranchNodeRepository `json:"repository"`
}
// GetName returns BranchNode.Name, and is useful for accessing the field via an interface.
func (v *BranchNode) GetName() string { return v.Name }
// GetCompare returns BranchNode.Compare, and is useful for accessing the field via an interface.
func (v *BranchNode) GetCompare() BranchNodeCompareComparison { return v.Compare }
// GetRepository returns BranchNode.Repository, and is useful for accessing the field via an interface.
func (v *BranchNode) GetRepository() BranchNodeRepository { return v.Repository }
// BranchNodeCompareComparison includes the requested fields of the GraphQL type Comparison.
// The GraphQL type's documentation follows.
//
// Represents a comparison between two commit revisions.
type BranchNodeCompareComparison struct {
// The number of commits ahead of the base branch.
AheadBy int `json:"aheadBy"`
// The number of commits behind the base branch.
BehindBy int `json:"behindBy"`
}
// GetAheadBy returns BranchNodeCompareComparison.AheadBy, and is useful for accessing the field via an interface.
func (v *BranchNodeCompareComparison) GetAheadBy() int { return v.AheadBy }
// GetBehindBy returns BranchNodeCompareComparison.BehindBy, and is useful for accessing the field via an interface.
func (v *BranchNodeCompareComparison) GetBehindBy() int { return v.BehindBy }
// BranchNodeRepository includes the requested fields of the GraphQL type Repository.
// The GraphQL type's documentation follows.
//
// A repository contains the content for a project.
type BranchNodeRepository struct {
// The name of the repository.
Name string `json:"name"`
// The Ref associated with the repository's default branch.
DefaultBranchRef BranchNodeRepositoryDefaultBranchRef `json:"defaultBranchRef"`
}
// GetName returns BranchNodeRepository.Name, and is useful for accessing the field via an interface.
func (v *BranchNodeRepository) GetName() string { return v.Name }
// GetDefaultBranchRef returns BranchNodeRepository.DefaultBranchRef, and is useful for accessing the field via an interface.
func (v *BranchNodeRepository) GetDefaultBranchRef() BranchNodeRepositoryDefaultBranchRef {
return v.DefaultBranchRef
}
// BranchNodeRepositoryDefaultBranchRef includes the requested fields of the GraphQL type Ref.
// The GraphQL type's documentation follows.
//
// Represents a Git reference.
type BranchNodeRepositoryDefaultBranchRef struct {
// The ref name.
Name string `json:"name"`
}
// GetName returns BranchNodeRepositoryDefaultBranchRef.Name, and is useful for accessing the field via an interface.
func (v *BranchNodeRepositoryDefaultBranchRef) GetName() string { return v.Name }
// CommitNode includes the requested fields of the GraphQL type Commit.
// The GraphQL type's documentation follows.
//
// Represents a Git commit.
type CommitNode struct {
// The datetime when this commit was committed.
CommittedDate time.Time `json:"committedDate"`
// The number of additions in this commit.
Additions int `json:"additions"`
// The number of deletions in this commit.
Deletions int `json:"deletions"`
}
// GetCommittedDate returns CommitNode.CommittedDate, and is useful for accessing the field via an interface.
func (v *CommitNode) GetCommittedDate() time.Time { return v.CommittedDate }
// GetAdditions returns CommitNode.Additions, and is useful for accessing the field via an interface.
func (v *CommitNode) GetAdditions() int { return v.Additions }
// GetDeletions returns CommitNode.Deletions, and is useful for accessing the field via an interface.
func (v *CommitNode) GetDeletions() int { return v.Deletions }
// PullRequestNode includes the requested fields of the GraphQL type PullRequest.
// The GraphQL type's documentation follows.
//
// A repository pull request.
type PullRequestNode struct {
// Identifies the date and time when the object was created.
CreatedAt time.Time `json:"createdAt"`
// Whether or not the pull request was merged.
Merged bool `json:"merged"`
// The date and time that the pull request was merged.
MergedAt time.Time `json:"mergedAt"`
// The commit that was created when this pull request was merged.
MergeCommit PullRequestNodeMergeCommit `json:"mergeCommit"`
// Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted.
HeadRefName string `json:"headRefName"`
// A list of reviews associated with the pull request.
Reviews PullRequestNodeReviewsPullRequestReviewConnection `json:"reviews"`
}
// GetCreatedAt returns PullRequestNode.CreatedAt, and is useful for accessing the field via an interface.
func (v *PullRequestNode) GetCreatedAt() time.Time { return v.CreatedAt }
// GetMerged returns PullRequestNode.Merged, and is useful for accessing the field via an interface.
func (v *PullRequestNode) GetMerged() bool { return v.Merged }
// GetMergedAt returns PullRequestNode.MergedAt, and is useful for accessing the field via an interface.
func (v *PullRequestNode) GetMergedAt() time.Time { return v.MergedAt }
// GetMergeCommit returns PullRequestNode.MergeCommit, and is useful for accessing the field via an interface.
func (v *PullRequestNode) GetMergeCommit() PullRequestNodeMergeCommit { return v.MergeCommit }
// GetHeadRefName returns PullRequestNode.HeadRefName, and is useful for accessing the field via an interface.
func (v *PullRequestNode) GetHeadRefName() string { return v.HeadRefName }
// GetReviews returns PullRequestNode.Reviews, and is useful for accessing the field via an interface.
func (v *PullRequestNode) GetReviews() PullRequestNodeReviewsPullRequestReviewConnection {
return v.Reviews
}
// PullRequestNodeMergeCommit includes the requested fields of the GraphQL type Commit.
// The GraphQL type's documentation follows.
//
// Represents a Git commit.
type PullRequestNodeMergeCommit struct {
// The deployments associated with a commit.
Deployments PullRequestNodeMergeCommitDeploymentsDeploymentConnection `json:"deployments"`
}
// GetDeployments returns PullRequestNodeMergeCommit.Deployments, and is useful for accessing the field via an interface.
func (v *PullRequestNodeMergeCommit) GetDeployments() PullRequestNodeMergeCommitDeploymentsDeploymentConnection {
return v.Deployments
}
// PullRequestNodeMergeCommitDeploymentsDeploymentConnection includes the requested fields of the GraphQL type DeploymentConnection.
// The GraphQL type's documentation follows.
//
// The connection type for Deployment.
type PullRequestNodeMergeCommitDeploymentsDeploymentConnection struct {
// A list of nodes.
Nodes []PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment `json:"nodes"`
// Identifies the total count of items in the connection.
TotalCount int `json:"totalCount"`
}
// GetNodes returns PullRequestNodeMergeCommitDeploymentsDeploymentConnection.Nodes, and is useful for accessing the field via an interface.
func (v *PullRequestNodeMergeCommitDeploymentsDeploymentConnection) GetNodes() []PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment {
return v.Nodes
}
// GetTotalCount returns PullRequestNodeMergeCommitDeploymentsDeploymentConnection.TotalCount, and is useful for accessing the field via an interface.
func (v *PullRequestNodeMergeCommitDeploymentsDeploymentConnection) GetTotalCount() int {
return v.TotalCount
}
// PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment includes the requested fields of the GraphQL type Deployment.
// The GraphQL type's documentation follows.
//
// Represents triggered deployment instance.
type PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment struct {
// Identifies the date and time when the object was created.
CreatedAt time.Time `json:"createdAt"`
}
// GetCreatedAt returns PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment.CreatedAt, and is useful for accessing the field via an interface.
func (v *PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment) GetCreatedAt() time.Time {
return v.CreatedAt
}
// PullRequestNodeReviewsPullRequestReviewConnection includes the requested fields of the GraphQL type PullRequestReviewConnection.
// The GraphQL type's documentation follows.
//
// The connection type for PullRequestReview.
type PullRequestNodeReviewsPullRequestReviewConnection struct {
// Identifies the total count of items in the connection.
TotalCount int `json:"totalCount"`
// A list of nodes.
Nodes []PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview `json:"nodes"`
}
// GetTotalCount returns PullRequestNodeReviewsPullRequestReviewConnection.TotalCount, and is useful for accessing the field via an interface.
func (v *PullRequestNodeReviewsPullRequestReviewConnection) GetTotalCount() int { return v.TotalCount }
// GetNodes returns PullRequestNodeReviewsPullRequestReviewConnection.Nodes, and is useful for accessing the field via an interface.
func (v *PullRequestNodeReviewsPullRequestReviewConnection) GetNodes() []PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview {
return v.Nodes
}
// PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview includes the requested fields of the GraphQL type PullRequestReview.
// The GraphQL type's documentation follows.
//
// A review object for a given pull request.
type PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview struct {
// Identifies the date and time when the object was created.
CreatedAt time.Time `json:"createdAt"`
}
// GetCreatedAt returns PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview.CreatedAt, and is useful for accessing the field via an interface.
func (v *PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview) GetCreatedAt() time.Time {
return v.CreatedAt
}
// The possible states of a pull request.
type PullRequestState string
const (
// A pull request that is still open.
PullRequestStateOpen PullRequestState = "OPEN"
// A pull request that has been closed without being merged.
PullRequestStateClosed PullRequestState = "CLOSED"
// A pull request that has been closed by being merged.
PullRequestStateMerged PullRequestState = "MERGED"
)
var AllPullRequestState = []PullRequestState{
PullRequestStateOpen,
PullRequestStateClosed,
PullRequestStateMerged,
}
// SearchNode includes the requested fields of the GraphQL interface SearchResultItem.
//
// SearchNode is implemented by the following types:
// SearchNodeApp
// SearchNodeDiscussion
// SearchNodeIssue
// SearchNodeMarketplaceListing
// SearchNodeOrganization
// SearchNodePullRequest
// SearchNodeRepository
// SearchNodeUser
// The GraphQL type's documentation follows.
//
// The results of a search.
type SearchNode interface {
implementsGraphQLInterfaceSearchNode()
// GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values).
GetTypename() string
}
func (v *SearchNodeApp) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodeDiscussion) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodeIssue) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodeMarketplaceListing) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodeOrganization) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodePullRequest) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodeRepository) implementsGraphQLInterfaceSearchNode() {}
func (v *SearchNodeUser) implementsGraphQLInterfaceSearchNode() {}
func __unmarshalSearchNode(b []byte, v *SearchNode) error {
if string(b) == "null" {
return nil
}
var tn struct {
TypeName string `json:"__typename"`
}
err := json.Unmarshal(b, &tn)
if err != nil {
return err
}
switch tn.TypeName {
case "App":
*v = new(SearchNodeApp)
return json.Unmarshal(b, *v)
case "Discussion":
*v = new(SearchNodeDiscussion)
return json.Unmarshal(b, *v)
case "Issue":
*v = new(SearchNodeIssue)
return json.Unmarshal(b, *v)
case "MarketplaceListing":
*v = new(SearchNodeMarketplaceListing)
return json.Unmarshal(b, *v)
case "Organization":
*v = new(SearchNodeOrganization)
return json.Unmarshal(b, *v)
case "PullRequest":
*v = new(SearchNodePullRequest)
return json.Unmarshal(b, *v)
case "Repository":
*v = new(SearchNodeRepository)
return json.Unmarshal(b, *v)
case "User":
*v = new(SearchNodeUser)
return json.Unmarshal(b, *v)
case "":
return fmt.Errorf(
"response was missing SearchResultItem.__typename")
default:
return fmt.Errorf(
`unexpected concrete type for SearchNode: "%v"`, tn.TypeName)
}
}
func __marshalSearchNode(v *SearchNode) ([]byte, error) {
var typename string
switch v := (*v).(type) {
case *SearchNodeApp:
typename = "App"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeApp
}{typename, v}
return json.Marshal(result)
case *SearchNodeDiscussion:
typename = "Discussion"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeDiscussion
}{typename, v}
return json.Marshal(result)
case *SearchNodeIssue:
typename = "Issue"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeIssue
}{typename, v}
return json.Marshal(result)
case *SearchNodeMarketplaceListing:
typename = "MarketplaceListing"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeMarketplaceListing
}{typename, v}
return json.Marshal(result)
case *SearchNodeOrganization:
typename = "Organization"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeOrganization
}{typename, v}
return json.Marshal(result)
case *SearchNodePullRequest:
typename = "PullRequest"
result := struct {
TypeName string `json:"__typename"`
*SearchNodePullRequest
}{typename, v}
return json.Marshal(result)
case *SearchNodeRepository:
typename = "Repository"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeRepository
}{typename, v}
return json.Marshal(result)
case *SearchNodeUser:
typename = "User"
result := struct {
TypeName string `json:"__typename"`
*SearchNodeUser
}{typename, v}
return json.Marshal(result)
case nil:
return []byte("null"), nil
default:
return nil, fmt.Errorf(
`unexpected concrete type for SearchNode: "%T"`, v)
}
}
// SearchNodeApp includes the requested fields of the GraphQL type App.
// The GraphQL type's documentation follows.
//
// A GitHub App.
type SearchNodeApp struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodeApp.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeApp) GetTypename() string { return v.Typename }
// SearchNodeDefaultBranchRef includes the requested fields of the GraphQL type Ref.
// The GraphQL type's documentation follows.
//
// Represents a Git reference.
type SearchNodeDefaultBranchRef struct {
// The ref name.
Name string `json:"name"`
}
// GetName returns SearchNodeDefaultBranchRef.Name, and is useful for accessing the field via an interface.
func (v *SearchNodeDefaultBranchRef) GetName() string { return v.Name }
// SearchNodeDiscussion includes the requested fields of the GraphQL type Discussion.
// The GraphQL type's documentation follows.
//
// A discussion in a repository.
type SearchNodeDiscussion struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodeDiscussion.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeDiscussion) GetTypename() string { return v.Typename }
// SearchNodeIssue includes the requested fields of the GraphQL type Issue.
// The GraphQL type's documentation follows.
//
// An Issue is a place to discuss ideas, enhancements, tasks, and bugs for a project.
type SearchNodeIssue struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodeIssue.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeIssue) GetTypename() string { return v.Typename }
// SearchNodeMarketplaceListing includes the requested fields of the GraphQL type MarketplaceListing.
// The GraphQL type's documentation follows.
//
// A listing in the GitHub integration marketplace.
type SearchNodeMarketplaceListing struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodeMarketplaceListing.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeMarketplaceListing) GetTypename() string { return v.Typename }
// SearchNodeOrganization includes the requested fields of the GraphQL type Organization.
// The GraphQL type's documentation follows.
//
// An account on GitHub, with one or more owners, that has repositories, members and teams.
type SearchNodeOrganization struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodeOrganization.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeOrganization) GetTypename() string { return v.Typename }
// SearchNodePullRequest includes the requested fields of the GraphQL type PullRequest.
// The GraphQL type's documentation follows.
//
// A repository pull request.
type SearchNodePullRequest struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodePullRequest.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodePullRequest) GetTypename() string { return v.Typename }
// SearchNodeRepository includes the requested fields of the GraphQL type Repository.
// The GraphQL type's documentation follows.
//
// A repository contains the content for a project.
type SearchNodeRepository struct {
Typename string `json:"__typename"`
Id string `json:"id"`
// The name of the repository.
Name string `json:"name"`
// The Ref associated with the repository's default branch.
DefaultBranchRef SearchNodeDefaultBranchRef `json:"defaultBranchRef"`
// The HTTP URL for this repository
Url string `json:"url"`
}
// GetTypename returns SearchNodeRepository.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeRepository) GetTypename() string { return v.Typename }
// GetId returns SearchNodeRepository.Id, and is useful for accessing the field via an interface.
func (v *SearchNodeRepository) GetId() string { return v.Id }
// GetName returns SearchNodeRepository.Name, and is useful for accessing the field via an interface.
func (v *SearchNodeRepository) GetName() string { return v.Name }
// GetDefaultBranchRef returns SearchNodeRepository.DefaultBranchRef, and is useful for accessing the field via an interface.
func (v *SearchNodeRepository) GetDefaultBranchRef() SearchNodeDefaultBranchRef {
return v.DefaultBranchRef
}
// GetUrl returns SearchNodeRepository.Url, and is useful for accessing the field via an interface.
func (v *SearchNodeRepository) GetUrl() string { return v.Url }
// SearchNodeUser includes the requested fields of the GraphQL type User.
// The GraphQL type's documentation follows.
//
// A user is an individual's account on GitHub that owns repositories and can make new content.
type SearchNodeUser struct {
Typename string `json:"__typename"`
}
// GetTypename returns SearchNodeUser.Typename, and is useful for accessing the field via an interface.
func (v *SearchNodeUser) GetTypename() string { return v.Typename }
// __checkLoginInput is used internally by genqlient
type __checkLoginInput struct {
Login string `json:"login"`
}
// GetLogin returns __checkLoginInput.Login, and is useful for accessing the field via an interface.
func (v *__checkLoginInput) GetLogin() string { return v.Login }
// __getBranchDataInput is used internally by genqlient
type __getBranchDataInput struct {
Name string `json:"name"`
Owner string `json:"owner"`
BranchFirst int `json:"branchFirst"`
TargetBranch string `json:"targetBranch"`
BranchCursor *string `json:"branchCursor"`
}
// GetName returns __getBranchDataInput.Name, and is useful for accessing the field via an interface.
func (v *__getBranchDataInput) GetName() string { return v.Name }
// GetOwner returns __getBranchDataInput.Owner, and is useful for accessing the field via an interface.
func (v *__getBranchDataInput) GetOwner() string { return v.Owner }
// GetBranchFirst returns __getBranchDataInput.BranchFirst, and is useful for accessing the field via an interface.
func (v *__getBranchDataInput) GetBranchFirst() int { return v.BranchFirst }
// GetTargetBranch returns __getBranchDataInput.TargetBranch, and is useful for accessing the field via an interface.
func (v *__getBranchDataInput) GetTargetBranch() string { return v.TargetBranch }
// GetBranchCursor returns __getBranchDataInput.BranchCursor, and is useful for accessing the field via an interface.
func (v *__getBranchDataInput) GetBranchCursor() *string { return v.BranchCursor }
// __getCommitDataInput is used internally by genqlient
type __getCommitDataInput struct {
Name string `json:"name"`
Owner string `json:"owner"`
BranchFirst int `json:"branchFirst"`
CommitFirst int `json:"commitFirst"`
CommitCursor *string `json:"commitCursor"`
BranchName string `json:"branchName"`
}
// GetName returns __getCommitDataInput.Name, and is useful for accessing the field via an interface.
func (v *__getCommitDataInput) GetName() string { return v.Name }
// GetOwner returns __getCommitDataInput.Owner, and is useful for accessing the field via an interface.
func (v *__getCommitDataInput) GetOwner() string { return v.Owner }
// GetBranchFirst returns __getCommitDataInput.BranchFirst, and is useful for accessing the field via an interface.
func (v *__getCommitDataInput) GetBranchFirst() int { return v.BranchFirst }
// GetCommitFirst returns __getCommitDataInput.CommitFirst, and is useful for accessing the field via an interface.
func (v *__getCommitDataInput) GetCommitFirst() int { return v.CommitFirst }
// GetCommitCursor returns __getCommitDataInput.CommitCursor, and is useful for accessing the field via an interface.
func (v *__getCommitDataInput) GetCommitCursor() *string { return v.CommitCursor }
// GetBranchName returns __getCommitDataInput.BranchName, and is useful for accessing the field via an interface.
func (v *__getCommitDataInput) GetBranchName() string { return v.BranchName }
// __getPullRequestDataInput is used internally by genqlient
type __getPullRequestDataInput struct {
Name string `json:"name"`
Owner string `json:"owner"`
PrFirst int `json:"prFirst"`
PrCursor *string `json:"prCursor"`
PrStates []PullRequestState `json:"prStates"`
}
// GetName returns __getPullRequestDataInput.Name, and is useful for accessing the field via an interface.
func (v *__getPullRequestDataInput) GetName() string { return v.Name }
// GetOwner returns __getPullRequestDataInput.Owner, and is useful for accessing the field via an interface.
func (v *__getPullRequestDataInput) GetOwner() string { return v.Owner }
// GetPrFirst returns __getPullRequestDataInput.PrFirst, and is useful for accessing the field via an interface.
func (v *__getPullRequestDataInput) GetPrFirst() int { return v.PrFirst }
// GetPrCursor returns __getPullRequestDataInput.PrCursor, and is useful for accessing the field via an interface.
func (v *__getPullRequestDataInput) GetPrCursor() *string { return v.PrCursor }
// GetPrStates returns __getPullRequestDataInput.PrStates, and is useful for accessing the field via an interface.
func (v *__getPullRequestDataInput) GetPrStates() []PullRequestState { return v.PrStates }
// __getRepoDataBySearchInput is used internally by genqlient
type __getRepoDataBySearchInput struct {
SearchQuery string `json:"searchQuery"`
RepoCursor *string `json:"repoCursor"`
}
// GetSearchQuery returns __getRepoDataBySearchInput.SearchQuery, and is useful for accessing the field via an interface.
func (v *__getRepoDataBySearchInput) GetSearchQuery() string { return v.SearchQuery }
// GetRepoCursor returns __getRepoDataBySearchInput.RepoCursor, and is useful for accessing the field via an interface.
func (v *__getRepoDataBySearchInput) GetRepoCursor() *string { return v.RepoCursor }
// checkLoginOrganization includes the requested fields of the GraphQL type Organization.
// The GraphQL type's documentation follows.
//
// An account on GitHub, with one or more owners, that has repositories, members and teams.
type checkLoginOrganization struct {
// The organization's login name.
Login string `json:"login"`
}
// GetLogin returns checkLoginOrganization.Login, and is useful for accessing the field via an interface.
func (v *checkLoginOrganization) GetLogin() string { return v.Login }
// checkLoginResponse is returned by checkLogin on success.
type checkLoginResponse struct {
// Lookup a user by login.
User checkLoginUser `json:"user"`
// Lookup a organization by login.
Organization checkLoginOrganization `json:"organization"`
}
// GetUser returns checkLoginResponse.User, and is useful for accessing the field via an interface.
func (v *checkLoginResponse) GetUser() checkLoginUser { return v.User }
// GetOrganization returns checkLoginResponse.Organization, and is useful for accessing the field via an interface.
func (v *checkLoginResponse) GetOrganization() checkLoginOrganization { return v.Organization }
// checkLoginUser includes the requested fields of the GraphQL type User.
// The GraphQL type's documentation follows.
//
// A user is an individual's account on GitHub that owns repositories and can make new content.
type checkLoginUser struct {
// The username used to login.
Login string `json:"login"`
}
// GetLogin returns checkLoginUser.Login, and is useful for accessing the field via an interface.
func (v *checkLoginUser) GetLogin() string { return v.Login }
// getBranchDataRepository includes the requested fields of the GraphQL type Repository.
// The GraphQL type's documentation follows.
//
// A repository contains the content for a project.
type getBranchDataRepository struct {
// Fetch a list of refs from the repository
Refs getBranchDataRepositoryRefsRefConnection `json:"refs"`
}
// GetRefs returns getBranchDataRepository.Refs, and is useful for accessing the field via an interface.
func (v *getBranchDataRepository) GetRefs() getBranchDataRepositoryRefsRefConnection { return v.Refs }
// getBranchDataRepositoryRefsRefConnection includes the requested fields of the GraphQL type RefConnection.
// The GraphQL type's documentation follows.
//
// The connection type for Ref.
type getBranchDataRepositoryRefsRefConnection struct {
// Identifies the total count of items in the connection.
TotalCount int `json:"totalCount"`
// A list of nodes.
Nodes []BranchNode `json:"nodes"`
// Information to aid in pagination.
PageInfo getBranchDataRepositoryRefsRefConnectionPageInfo `json:"pageInfo"`
}
// GetTotalCount returns getBranchDataRepositoryRefsRefConnection.TotalCount, and is useful for accessing the field via an interface.
func (v *getBranchDataRepositoryRefsRefConnection) GetTotalCount() int { return v.TotalCount }
// GetNodes returns getBranchDataRepositoryRefsRefConnection.Nodes, and is useful for accessing the field via an interface.
func (v *getBranchDataRepositoryRefsRefConnection) GetNodes() []BranchNode { return v.Nodes }
// GetPageInfo returns getBranchDataRepositoryRefsRefConnection.PageInfo, and is useful for accessing the field via an interface.
func (v *getBranchDataRepositoryRefsRefConnection) GetPageInfo() getBranchDataRepositoryRefsRefConnectionPageInfo {
return v.PageInfo
}
// getBranchDataRepositoryRefsRefConnectionPageInfo includes the requested fields of the GraphQL type PageInfo.
// The GraphQL type's documentation follows.
//
// Information about pagination in a connection.
type getBranchDataRepositoryRefsRefConnectionPageInfo struct {
// When paginating forwards, the cursor to continue.
EndCursor string `json:"endCursor"`
// When paginating forwards, are there more items?
HasNextPage bool `json:"hasNextPage"`
}
// GetEndCursor returns getBranchDataRepositoryRefsRefConnectionPageInfo.EndCursor, and is useful for accessing the field via an interface.
func (v *getBranchDataRepositoryRefsRefConnectionPageInfo) GetEndCursor() string { return v.EndCursor }
// GetHasNextPage returns getBranchDataRepositoryRefsRefConnectionPageInfo.HasNextPage, and is useful for accessing the field via an interface.
func (v *getBranchDataRepositoryRefsRefConnectionPageInfo) GetHasNextPage() bool {
return v.HasNextPage
}
// getBranchDataResponse is returned by getBranchData on success.
type getBranchDataResponse struct {
// Lookup a given repository by the owner and repository name.
Repository getBranchDataRepository `json:"repository"`
}
// GetRepository returns getBranchDataResponse.Repository, and is useful for accessing the field via an interface.
func (v *getBranchDataResponse) GetRepository() getBranchDataRepository { return v.Repository }
// getCommitDataRepository includes the requested fields of the GraphQL type Repository.
// The GraphQL type's documentation follows.
//
// A repository contains the content for a project.
type getCommitDataRepository struct {
// Fetch a list of refs from the repository
Refs getCommitDataRepositoryRefsRefConnection `json:"refs"`
}
// GetRefs returns getCommitDataRepository.Refs, and is useful for accessing the field via an interface.
func (v *getCommitDataRepository) GetRefs() getCommitDataRepositoryRefsRefConnection { return v.Refs }
// getCommitDataRepositoryRefsRefConnection includes the requested fields of the GraphQL type RefConnection.
// The GraphQL type's documentation follows.
//
// The connection type for Ref.
type getCommitDataRepositoryRefsRefConnection struct {
// A list of nodes.
Nodes []BranchHistory `json:"nodes"`
}
// GetNodes returns getCommitDataRepositoryRefsRefConnection.Nodes, and is useful for accessing the field via an interface.
func (v *getCommitDataRepositoryRefsRefConnection) GetNodes() []BranchHistory { return v.Nodes }
// getCommitDataResponse is returned by getCommitData on success.
type getCommitDataResponse struct {
// Lookup a given repository by the owner and repository name.
Repository getCommitDataRepository `json:"repository"`
}
// GetRepository returns getCommitDataResponse.Repository, and is useful for accessing the field via an interface.
func (v *getCommitDataResponse) GetRepository() getCommitDataRepository { return v.Repository }
// getPullRequestDataRepository includes the requested fields of the GraphQL type Repository.
// The GraphQL type's documentation follows.
//
// A repository contains the content for a project.
type getPullRequestDataRepository struct {
// A list of pull requests that have been opened in the repository.
PullRequests getPullRequestDataRepositoryPullRequestsPullRequestConnection `json:"pullRequests"`
}
// GetPullRequests returns getPullRequestDataRepository.PullRequests, and is useful for accessing the field via an interface.
func (v *getPullRequestDataRepository) GetPullRequests() getPullRequestDataRepositoryPullRequestsPullRequestConnection {
return v.PullRequests
}
// getPullRequestDataRepositoryPullRequestsPullRequestConnection includes the requested fields of the GraphQL type PullRequestConnection.
// The GraphQL type's documentation follows.
//
// The connection type for PullRequest.
type getPullRequestDataRepositoryPullRequestsPullRequestConnection struct {
// A list of nodes.
Nodes []PullRequestNode `json:"nodes"`
// Information to aid in pagination.
PageInfo getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo `json:"pageInfo"`
}
// GetNodes returns getPullRequestDataRepositoryPullRequestsPullRequestConnection.Nodes, and is useful for accessing the field via an interface.
func (v *getPullRequestDataRepositoryPullRequestsPullRequestConnection) GetNodes() []PullRequestNode {
return v.Nodes
}
// GetPageInfo returns getPullRequestDataRepositoryPullRequestsPullRequestConnection.PageInfo, and is useful for accessing the field via an interface.
func (v *getPullRequestDataRepositoryPullRequestsPullRequestConnection) GetPageInfo() getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo {
return v.PageInfo
}
// getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo includes the requested fields of the GraphQL type PageInfo.
// The GraphQL type's documentation follows.
//
// Information about pagination in a connection.
type getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo struct {
// When paginating forwards, are there more items?
HasNextPage bool `json:"hasNextPage"`
// When paginating forwards, the cursor to continue.
EndCursor string `json:"endCursor"`
}
// GetHasNextPage returns getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo.HasNextPage, and is useful for accessing the field via an interface.
func (v *getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo) GetHasNextPage() bool {
return v.HasNextPage
}
// GetEndCursor returns getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo.EndCursor, and is useful for accessing the field via an interface.
func (v *getPullRequestDataRepositoryPullRequestsPullRequestConnectionPageInfo) GetEndCursor() string {
return v.EndCursor
}
// getPullRequestDataResponse is returned by getPullRequestData on success.
type getPullRequestDataResponse struct {
// Lookup a given repository by the owner and repository name.
Repository getPullRequestDataRepository `json:"repository"`
}
// GetRepository returns getPullRequestDataResponse.Repository, and is useful for accessing the field via an interface.
func (v *getPullRequestDataResponse) GetRepository() getPullRequestDataRepository {
return v.Repository
}
// getRepoDataBySearchResponse is returned by getRepoDataBySearch on success.
type getRepoDataBySearchResponse struct {
// Perform a search across resources, returning a maximum of 1,000 results.
Search getRepoDataBySearchSearchSearchResultItemConnection `json:"search"`
}
// GetSearch returns getRepoDataBySearchResponse.Search, and is useful for accessing the field via an interface.
func (v *getRepoDataBySearchResponse) GetSearch() getRepoDataBySearchSearchSearchResultItemConnection {
return v.Search
}
// getRepoDataBySearchSearchSearchResultItemConnection includes the requested fields of the GraphQL type SearchResultItemConnection.
// The GraphQL type's documentation follows.
//
// A list of results that matched against a search query. Regardless of the number of matches, a maximum of 1,000 results will be available across all types, potentially split across many pages.
type getRepoDataBySearchSearchSearchResultItemConnection struct {
// The total number of repositories that matched the search query. Regardless of the total number of matches, a maximum of 1,000 results will be available across all types.
RepositoryCount int `json:"repositoryCount"`
// A list of nodes.
Nodes []SearchNode `json:"-"`
// Information to aid in pagination.
PageInfo getRepoDataBySearchSearchSearchResultItemConnectionPageInfo `json:"pageInfo"`
}
// GetRepositoryCount returns getRepoDataBySearchSearchSearchResultItemConnection.RepositoryCount, and is useful for accessing the field via an interface.
func (v *getRepoDataBySearchSearchSearchResultItemConnection) GetRepositoryCount() int {
return v.RepositoryCount
}
// GetNodes returns getRepoDataBySearchSearchSearchResultItemConnection.Nodes, and is useful for accessing the field via an interface.
func (v *getRepoDataBySearchSearchSearchResultItemConnection) GetNodes() []SearchNode { return v.Nodes }
// GetPageInfo returns getRepoDataBySearchSearchSearchResultItemConnection.PageInfo, and is useful for accessing the field via an interface.
func (v *getRepoDataBySearchSearchSearchResultItemConnection) GetPageInfo() getRepoDataBySearchSearchSearchResultItemConnectionPageInfo {
return v.PageInfo
}
func (v *getRepoDataBySearchSearchSearchResultItemConnection) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
return nil
}
var firstPass struct {
*getRepoDataBySearchSearchSearchResultItemConnection
Nodes []json.RawMessage `json:"nodes"`
graphql.NoUnmarshalJSON
}
firstPass.getRepoDataBySearchSearchSearchResultItemConnection = v
err := json.Unmarshal(b, &firstPass)
if err != nil {
return err
}
{
dst := &v.Nodes
src := firstPass.Nodes
*dst = make(
[]SearchNode,
len(src))
for i, src := range src {
dst := &(*dst)[i]
if len(src) != 0 && string(src) != "null" {
err = __unmarshalSearchNode(
src, dst)
if err != nil {
return fmt.Errorf(
"unable to unmarshal getRepoDataBySearchSearchSearchResultItemConnection.Nodes: %w", err)
}
}
}
}
return nil
}
type __premarshalgetRepoDataBySearchSearchSearchResultItemConnection struct {
RepositoryCount int `json:"repositoryCount"`
Nodes []json.RawMessage `json:"nodes"`
PageInfo getRepoDataBySearchSearchSearchResultItemConnectionPageInfo `json:"pageInfo"`
}
func (v *getRepoDataBySearchSearchSearchResultItemConnection) MarshalJSON() ([]byte, error) {
premarshaled, err := v.__premarshalJSON()
if err != nil {
return nil, err
}
return json.Marshal(premarshaled)
}
func (v *getRepoDataBySearchSearchSearchResultItemConnection) __premarshalJSON() (*__premarshalgetRepoDataBySearchSearchSearchResultItemConnection, error) {
var retval __premarshalgetRepoDataBySearchSearchSearchResultItemConnection
retval.RepositoryCount = v.RepositoryCount
{
dst := &retval.Nodes
src := v.Nodes
*dst = make(
[]json.RawMessage,
len(src))
for i, src := range src {
dst := &(*dst)[i]
var err error
*dst, err = __marshalSearchNode(
&src)
if err != nil {
return nil, fmt.Errorf(
"unable to marshal getRepoDataBySearchSearchSearchResultItemConnection.Nodes: %w", err)
}
}
}
retval.PageInfo = v.PageInfo
return &retval, nil
}
// getRepoDataBySearchSearchSearchResultItemConnectionPageInfo includes the requested fields of the GraphQL type PageInfo.
// The GraphQL type's documentation follows.
//
// Information about pagination in a connection.
type getRepoDataBySearchSearchSearchResultItemConnectionPageInfo struct {
// When paginating forwards, are there more items?
HasNextPage bool `json:"hasNextPage"`
// When paginating forwards, the cursor to continue.
EndCursor string `json:"endCursor"`
}
// GetHasNextPage returns getRepoDataBySearchSearchSearchResultItemConnectionPageInfo.HasNextPage, and is useful for accessing the field via an interface.
func (v *getRepoDataBySearchSearchSearchResultItemConnectionPageInfo) GetHasNextPage() bool {
return v.HasNextPage
}
// GetEndCursor returns getRepoDataBySearchSearchSearchResultItemConnectionPageInfo.EndCursor, and is useful for accessing the field via an interface.
func (v *getRepoDataBySearchSearchSearchResultItemConnectionPageInfo) GetEndCursor() string {
return v.EndCursor
}
// The query executed by checkLogin.
const checkLogin_Operation = `
query checkLogin ($login: String!) {
user(login: $login) {
login
}
organization(login: $login) {
login
}
}
`
func checkLogin(
ctx_ context.Context,
client_ graphql.Client,
login string,
) (data_ *checkLoginResponse, err_ error) {
req_ := &graphql.Request{
OpName: "checkLogin",
Query: checkLogin_Operation,
Variables: &__checkLoginInput{
Login: login,
},
}
data_ = &checkLoginResponse{}
resp_ := &graphql.Response{Data: data_}
err_ = client_.MakeRequest(
ctx_,
req_,
resp_,
)
return data_, err_
}
// The query executed by getBranchData.
const getBranchData_Operation = `
query getBranchData ($name: String!, $owner: String!, $branchFirst: Int!, $targetBranch: String!, $branchCursor: String) {
repository(name: $name, owner: $owner) {
refs(refPrefix: "refs/heads/", first: $branchFirst, after: $branchCursor) {
totalCount
nodes {
name
compare(headRef: $targetBranch) {
aheadBy
behindBy
}
repository {
name
defaultBranchRef {
name
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
`
func getBranchData(
ctx_ context.Context,
client_ graphql.Client,
name string,
owner string,
branchFirst int,
targetBranch string,
branchCursor *string,
) (data_ *getBranchDataResponse, err_ error) {
req_ := &graphql.Request{
OpName: "getBranchData",
Query: getBranchData_Operation,
Variables: &__getBranchDataInput{
Name: name,
Owner: owner,
BranchFirst: branchFirst,
TargetBranch: targetBranch,
BranchCursor: branchCursor,
},
}
data_ = &getBranchDataResponse{}
resp_ := &graphql.Response{Data: data_}
err_ = client_.MakeRequest(
ctx_,
req_,
resp_,
)
return data_, err_
}
// The query executed by getCommitData.
const getCommitData_Operation = `
query getCommitData ($name: String!, $owner: String!, $branchFirst: Int!, $commitFirst: Int!, $commitCursor: String, $branchName: String!) {
repository(name: $name, owner: $owner) {
refs(refPrefix: "refs/heads/", first: $branchFirst, query: $branchName) {
nodes {
target {
__typename
... on Commit {
id
history(first: $commitFirst, after: $commitCursor) {
nodes {
committedDate
additions
deletions
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
}
}
}
`
func getCommitData(
ctx_ context.Context,
client_ graphql.Client,
name string,
owner string,
branchFirst int,
commitFirst int,
commitCursor *string,
branchName string,
) (data_ *getCommitDataResponse, err_ error) {
req_ := &graphql.Request{
OpName: "getCommitData",
Query: getCommitData_Operation,
Variables: &__getCommitDataInput{
Name: name,
Owner: owner,
BranchFirst: branchFirst,
CommitFirst: commitFirst,
CommitCursor: commitCursor,
BranchName: branchName,
},
}
data_ = &getCommitDataResponse{}
resp_ := &graphql.Response{Data: data_}
err_ = client_.MakeRequest(
ctx_,
req_,
resp_,
)
return data_, err_
}
// The query executed by getPullRequestData.
const getPullRequestData_Operation = `
query getPullRequestData ($name: String!, $owner: String!, $prFirst: Int!, $prCursor: String, $prStates: [PullRequestState!]) {
repository(name: $name, owner: $owner) {
pullRequests(first: $prFirst, after: $prCursor, states: $prStates) {
nodes {
... on PullRequest {
createdAt
merged
mergedAt
mergeCommit {
deployments(last: 1, orderBy: {field:CREATED_AT,direction:ASC}) {
nodes {
createdAt
}
totalCount
}
}
}
headRefName
reviews(states: APPROVED, last: 1) {
totalCount
nodes {
... on PullRequestReview {
createdAt
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
`
func getPullRequestData(
ctx_ context.Context,
client_ graphql.Client,
name string,
owner string,
prFirst int,
prCursor *string,
prStates []PullRequestState,
) (data_ *getPullRequestDataResponse, err_ error) {
req_ := &graphql.Request{
OpName: "getPullRequestData",
Query: getPullRequestData_Operation,
Variables: &__getPullRequestDataInput{
Name: name,
Owner: owner,
PrFirst: prFirst,
PrCursor: prCursor,
PrStates: prStates,
},
}
data_ = &getPullRequestDataResponse{}
resp_ := &graphql.Response{Data: data_}
err_ = client_.MakeRequest(
ctx_,
req_,
resp_,
)
return data_, err_
}
// The query executed by getRepoDataBySearch.
const getRepoDataBySearch_Operation = `
query getRepoDataBySearch ($searchQuery: String!, $repoCursor: String) {
search(query: $searchQuery, type: REPOSITORY, first: 100, after: $repoCursor) {
repositoryCount
nodes {
__typename
... on Repository {
id
name
defaultBranchRef {
name
}
url
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`
func getRepoDataBySearch(
ctx_ context.Context,
client_ graphql.Client,
searchQuery string,
repoCursor *string,
) (data_ *getRepoDataBySearchResponse, err_ error) {
req_ := &graphql.Request{
OpName: "getRepoDataBySearch",
Query: getRepoDataBySearch_Operation,
Variables: &__getRepoDataBySearchInput{
SearchQuery: searchQuery,
RepoCursor: repoCursor,
},
}
data_ = &getRepoDataBySearchResponse{}
resp_ := &graphql.Response{Data: data_}
err_ = client_.MakeRequest(
ctx_,
req_,
resp_,
)
return data_, err_
}