// Code generated by github.com/Khan/genqlient, DO NOT EDIT. package github import ( "context" "encoding/json" "fmt" "github.com/Khan/genqlient/graphql" ) // AddIssueCommentAddCommentAddCommentPayload includes the requested fields of the GraphQL type AddCommentPayload. // The GraphQL type's documentation follows. // // Autogenerated return type of AddComment. type AddIssueCommentAddCommentAddCommentPayload struct { // The edge from the subject's comment connection. CommentEdge AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdge `json:"commentEdge"` } // GetCommentEdge returns AddIssueCommentAddCommentAddCommentPayload.CommentEdge, and is useful for accessing the field via an interface. func (v *AddIssueCommentAddCommentAddCommentPayload) GetCommentEdge() AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdge { return v.CommentEdge } // AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdge includes the requested fields of the GraphQL type IssueCommentEdge. // The GraphQL type's documentation follows. // // An edge in a connection. type AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdge struct { // The item at the end of the edge. Node AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment `json:"node"` } // GetNode returns AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdge.Node, and is useful for accessing the field via an interface. func (v *AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdge) GetNode() AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment { return v.Node } // AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment includes the requested fields of the GraphQL type IssueComment. // The GraphQL type's documentation follows. // // Represents a comment on an Issue. type AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment struct { // The Node ID of the IssueComment object Id string `json:"id"` // The HTTP URL for this issue comment Url string `json:"url"` } // GetId returns AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment.Id, and is useful for accessing the field via an interface. func (v *AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment) GetId() string { return v.Id } // GetUrl returns AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment.Url, and is useful for accessing the field via an interface. func (v *AddIssueCommentAddCommentAddCommentPayloadCommentEdgeIssueCommentEdgeNodeIssueComment) GetUrl() string { return v.Url } // AddIssueCommentResponse is returned by AddIssueComment on success. type AddIssueCommentResponse struct { // Adds a comment to an Issue or Pull Request. AddComment AddIssueCommentAddCommentAddCommentPayload `json:"addComment"` } // GetAddComment returns AddIssueCommentResponse.AddComment, and is useful for accessing the field via an interface. func (v *AddIssueCommentResponse) GetAddComment() AddIssueCommentAddCommentAddCommentPayload { return v.AddComment } // AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayload includes the requested fields of the GraphQL type AddProjectV2ItemByIdPayload. // The GraphQL type's documentation follows. // // Autogenerated return type of AddProjectV2ItemById. type AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayload struct { // The item added to the project. Item AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayloadItemProjectV2Item `json:"item"` } // GetItem returns AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayload.Item, and is useful for accessing the field via an interface. func (v *AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayload) GetItem() AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayloadItemProjectV2Item { return v.Item } // AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayloadItemProjectV2Item includes the requested fields of the GraphQL type ProjectV2Item. // The GraphQL type's documentation follows. // // An item within a Project. type AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayloadItemProjectV2Item struct { // The Node ID of the ProjectV2Item object Id string `json:"id"` } // GetId returns AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayloadItemProjectV2Item.Id, and is useful for accessing the field via an interface. func (v *AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayloadItemProjectV2Item) GetId() string { return v.Id } // AddProjectItemResponse is returned by AddProjectItem on success. type AddProjectItemResponse struct { // Links an existing content instance to a Project. AddProjectV2ItemById AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayload `json:"addProjectV2ItemById"` } // GetAddProjectV2ItemById returns AddProjectItemResponse.AddProjectV2ItemById, and is useful for accessing the field via an interface. func (v *AddProjectItemResponse) GetAddProjectV2ItemById() AddProjectItemAddProjectV2ItemByIdAddProjectV2ItemByIdPayload { return v.AddProjectV2ItemById } // IssueByNumberRepository includes the requested fields of the GraphQL type Repository. // The GraphQL type's documentation follows. // // A repository contains the content for a project. type IssueByNumberRepository struct { // Returns a single issue from the current repository by number. Issue IssueByNumberRepositoryIssue `json:"issue"` } // GetIssue returns IssueByNumberRepository.Issue, and is useful for accessing the field via an interface. func (v *IssueByNumberRepository) GetIssue() IssueByNumberRepositoryIssue { return v.Issue } // IssueByNumberRepositoryIssue 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 IssueByNumberRepositoryIssue struct { // The Node ID of the Issue object Id string `json:"id"` // Identifies the issue number. Number int `json:"number"` // Identifies the issue title. Title string `json:"title"` // Identifies the body of the issue. Body string `json:"body"` // The HTTP URL for this issue Url string `json:"url"` // Identifies the state of the issue. State IssueState `json:"state"` } // GetId returns IssueByNumberRepositoryIssue.Id, and is useful for accessing the field via an interface. func (v *IssueByNumberRepositoryIssue) GetId() string { return v.Id } // GetNumber returns IssueByNumberRepositoryIssue.Number, and is useful for accessing the field via an interface. func (v *IssueByNumberRepositoryIssue) GetNumber() int { return v.Number } // GetTitle returns IssueByNumberRepositoryIssue.Title, and is useful for accessing the field via an interface. func (v *IssueByNumberRepositoryIssue) GetTitle() string { return v.Title } // GetBody returns IssueByNumberRepositoryIssue.Body, and is useful for accessing the field via an interface. func (v *IssueByNumberRepositoryIssue) GetBody() string { return v.Body } // GetUrl returns IssueByNumberRepositoryIssue.Url, and is useful for accessing the field via an interface. func (v *IssueByNumberRepositoryIssue) GetUrl() string { return v.Url } // GetState returns IssueByNumberRepositoryIssue.State, and is useful for accessing the field via an interface. func (v *IssueByNumberRepositoryIssue) GetState() IssueState { return v.State } // IssueByNumberResponse is returned by IssueByNumber on success. type IssueByNumberResponse struct { // Lookup a given repository by the owner and repository name. Repository IssueByNumberRepository `json:"repository"` } // GetRepository returns IssueByNumberResponse.Repository, and is useful for accessing the field via an interface. func (v *IssueByNumberResponse) GetRepository() IssueByNumberRepository { return v.Repository } // IssueCommentsRepository includes the requested fields of the GraphQL type Repository. // The GraphQL type's documentation follows. // // A repository contains the content for a project. type IssueCommentsRepository struct { // Returns a single issue from the current repository by number. Issue IssueCommentsRepositoryIssue `json:"issue"` } // GetIssue returns IssueCommentsRepository.Issue, and is useful for accessing the field via an interface. func (v *IssueCommentsRepository) GetIssue() IssueCommentsRepositoryIssue { return v.Issue } // IssueCommentsRepositoryIssue 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 IssueCommentsRepositoryIssue struct { // A list of comments associated with the Issue. Comments IssueCommentsRepositoryIssueCommentsIssueCommentConnection `json:"comments"` } // GetComments returns IssueCommentsRepositoryIssue.Comments, and is useful for accessing the field via an interface. func (v *IssueCommentsRepositoryIssue) GetComments() IssueCommentsRepositoryIssueCommentsIssueCommentConnection { return v.Comments } // IssueCommentsRepositoryIssueCommentsIssueCommentConnection includes the requested fields of the GraphQL type IssueCommentConnection. // The GraphQL type's documentation follows. // // The connection type for IssueComment. type IssueCommentsRepositoryIssueCommentsIssueCommentConnection struct { // A list of nodes. Nodes []IssueCommentsRepositoryIssueCommentsIssueCommentConnectionNodesIssueComment `json:"nodes"` // Information to aid in pagination. PageInfo IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo `json:"pageInfo"` } // GetNodes returns IssueCommentsRepositoryIssueCommentsIssueCommentConnection.Nodes, and is useful for accessing the field via an interface. func (v *IssueCommentsRepositoryIssueCommentsIssueCommentConnection) GetNodes() []IssueCommentsRepositoryIssueCommentsIssueCommentConnectionNodesIssueComment { return v.Nodes } // GetPageInfo returns IssueCommentsRepositoryIssueCommentsIssueCommentConnection.PageInfo, and is useful for accessing the field via an interface. func (v *IssueCommentsRepositoryIssueCommentsIssueCommentConnection) GetPageInfo() IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo { return v.PageInfo } // IssueCommentsRepositoryIssueCommentsIssueCommentConnectionNodesIssueComment includes the requested fields of the GraphQL type IssueComment. // The GraphQL type's documentation follows. // // Represents a comment on an Issue. type IssueCommentsRepositoryIssueCommentsIssueCommentConnectionNodesIssueComment struct { // The body as Markdown. Body string `json:"body"` } // GetBody returns IssueCommentsRepositoryIssueCommentsIssueCommentConnectionNodesIssueComment.Body, and is useful for accessing the field via an interface. func (v *IssueCommentsRepositoryIssueCommentsIssueCommentConnectionNodesIssueComment) GetBody() string { return v.Body } // IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo includes the requested fields of the GraphQL type PageInfo. // The GraphQL type's documentation follows. // // Information about pagination in a connection. type IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo 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 IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo.HasNextPage, and is useful for accessing the field via an interface. func (v *IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo) GetHasNextPage() bool { return v.HasNextPage } // GetEndCursor returns IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo.EndCursor, and is useful for accessing the field via an interface. func (v *IssueCommentsRepositoryIssueCommentsIssueCommentConnectionPageInfo) GetEndCursor() string { return v.EndCursor } // IssueCommentsResponse is returned by IssueComments on success. type IssueCommentsResponse struct { // Lookup a given repository by the owner and repository name. Repository IssueCommentsRepository `json:"repository"` } // GetRepository returns IssueCommentsResponse.Repository, and is useful for accessing the field via an interface. func (v *IssueCommentsResponse) GetRepository() IssueCommentsRepository { return v.Repository } // The possible states of an issue. type IssueState string const ( // An issue that has been closed IssueStateClosed IssueState = "CLOSED" // An issue that is still open IssueStateOpen IssueState = "OPEN" ) var AllIssueState = []IssueState{ IssueStateClosed, IssueStateOpen, } // ProjectSingleSelectFieldOrganization 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 ProjectSingleSelectFieldOrganization struct { // Find a project by number. ProjectV2 ProjectSingleSelectFieldOrganizationProjectV2 `json:"projectV2"` } // GetProjectV2 returns ProjectSingleSelectFieldOrganization.ProjectV2, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganization) GetProjectV2() ProjectSingleSelectFieldOrganizationProjectV2 { return v.ProjectV2 } // ProjectSingleSelectFieldOrganizationProjectV2 includes the requested fields of the GraphQL type ProjectV2. // The GraphQL type's documentation follows. // // New projects that manage issues, pull requests and drafts using tables and boards. type ProjectSingleSelectFieldOrganizationProjectV2 struct { // The Node ID of the ProjectV2 object Id string `json:"id"` // A field of the project Field ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration `json:"-"` } // GetId returns ProjectSingleSelectFieldOrganizationProjectV2.Id, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2) GetId() string { return v.Id } // GetField returns ProjectSingleSelectFieldOrganizationProjectV2.Field, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2) GetField() ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration { return v.Field } func (v *ProjectSingleSelectFieldOrganizationProjectV2) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { *ProjectSingleSelectFieldOrganizationProjectV2 Field json.RawMessage `json:"field"` graphql.NoUnmarshalJSON } firstPass.ProjectSingleSelectFieldOrganizationProjectV2 = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } { dst := &v.Field src := firstPass.Field if len(src) != 0 && string(src) != "null" { err = __unmarshalProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration( src, dst) if err != nil { return fmt.Errorf( "unable to unmarshal ProjectSingleSelectFieldOrganizationProjectV2.Field: %w", err) } } } return nil } type __premarshalProjectSingleSelectFieldOrganizationProjectV2 struct { Id string `json:"id"` Field json.RawMessage `json:"field"` } func (v *ProjectSingleSelectFieldOrganizationProjectV2) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err } return json.Marshal(premarshaled) } func (v *ProjectSingleSelectFieldOrganizationProjectV2) __premarshalJSON() (*__premarshalProjectSingleSelectFieldOrganizationProjectV2, error) { var retval __premarshalProjectSingleSelectFieldOrganizationProjectV2 retval.Id = v.Id { dst := &retval.Field src := v.Field var err error *dst, err = __marshalProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration( &src) if err != nil { return nil, fmt.Errorf( "unable to marshal ProjectSingleSelectFieldOrganizationProjectV2.Field: %w", err) } } return &retval, nil } // ProjectSingleSelectFieldOrganizationProjectV2Field includes the requested fields of the GraphQL type ProjectV2Field. // The GraphQL type's documentation follows. // // A field inside a project. type ProjectSingleSelectFieldOrganizationProjectV2Field struct { Typename string `json:"__typename"` } // GetTypename returns ProjectSingleSelectFieldOrganizationProjectV2Field.Typename, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2Field) GetTypename() string { return v.Typename } // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration includes the requested fields of the GraphQL interface ProjectV2FieldConfiguration. // // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration is implemented by the following types: // ProjectSingleSelectFieldOrganizationProjectV2Field // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField // The GraphQL type's documentation follows. // // Configurations for project fields. type ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration interface { implementsGraphQLInterfaceProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration() // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). GetTypename() string } func (v *ProjectSingleSelectFieldOrganizationProjectV2Field) implementsGraphQLInterfaceProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration() { } func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField) implementsGraphQLInterfaceProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration() { } func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField) implementsGraphQLInterfaceProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration() { } func __unmarshalProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration(b []byte, v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration) 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 "ProjectV2Field": *v = new(ProjectSingleSelectFieldOrganizationProjectV2Field) return json.Unmarshal(b, *v) case "ProjectV2IterationField": *v = new(ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField) return json.Unmarshal(b, *v) case "ProjectV2SingleSelectField": *v = new(ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField) return json.Unmarshal(b, *v) case "": return fmt.Errorf( "response was missing ProjectV2FieldConfiguration.__typename") default: return fmt.Errorf( `unexpected concrete type for ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration: "%v"`, tn.TypeName) } } func __marshalProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration(v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration) ([]byte, error) { var typename string switch v := (*v).(type) { case *ProjectSingleSelectFieldOrganizationProjectV2Field: typename = "ProjectV2Field" result := struct { TypeName string `json:"__typename"` *ProjectSingleSelectFieldOrganizationProjectV2Field }{typename, v} return json.Marshal(result) case *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField: typename = "ProjectV2IterationField" result := struct { TypeName string `json:"__typename"` *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField }{typename, v} return json.Marshal(result) case *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField: typename = "ProjectV2SingleSelectField" result := struct { TypeName string `json:"__typename"` *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField }{typename, v} return json.Marshal(result) case nil: return []byte("null"), nil default: return nil, fmt.Errorf( `unexpected concrete type for ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2FieldConfiguration: "%T"`, v) } } // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField includes the requested fields of the GraphQL type ProjectV2IterationField. // The GraphQL type's documentation follows. // // An iteration field inside a project. type ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField struct { Typename string `json:"__typename"` } // GetTypename returns ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField.Typename, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2IterationField) GetTypename() string { return v.Typename } // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField includes the requested fields of the GraphQL type ProjectV2SingleSelectField. // The GraphQL type's documentation follows. // // A single select field inside a project. type ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField struct { Typename string `json:"__typename"` // The Node ID of the ProjectV2SingleSelectField object Id string `json:"id"` // Options for the single select field Options []ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption `json:"options"` } // GetTypename returns ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField.Typename, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField) GetTypename() string { return v.Typename } // GetId returns ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField.Id, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField) GetId() string { return v.Id } // GetOptions returns ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField.Options, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectField) GetOptions() []ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption { return v.Options } // ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption includes the requested fields of the GraphQL type ProjectV2SingleSelectFieldOption. // The GraphQL type's documentation follows. // // Single select field option for a configuration for a project. type ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption struct { // The option's ID. Id string `json:"id"` // The option's name. Name string `json:"name"` } // GetId returns ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption.Id, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption) GetId() string { return v.Id } // GetName returns ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption.Name, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldOrganizationProjectV2FieldProjectV2SingleSelectFieldOptionsProjectV2SingleSelectFieldOption) GetName() string { return v.Name } // ProjectSingleSelectFieldResponse is returned by ProjectSingleSelectField on success. type ProjectSingleSelectFieldResponse struct { // Lookup a organization by login. Organization ProjectSingleSelectFieldOrganization `json:"organization"` } // GetOrganization returns ProjectSingleSelectFieldResponse.Organization, and is useful for accessing the field via an interface. func (v *ProjectSingleSelectFieldResponse) GetOrganization() ProjectSingleSelectFieldOrganization { return v.Organization } // The values that can be used to update a field of an item inside a Project. Only 1 value can be updated at a time. type ProjectV2FieldValue struct { // The ISO 8601 date to set on the field. Date string `json:"date"` // The id of the iteration to set on the field. IterationId string `json:"iterationId"` // The number to set on the field. Number float64 `json:"number"` // The id of the single select option to set on the field. SingleSelectOptionId string `json:"singleSelectOptionId"` // The text to set on the field. Text string `json:"text"` } // GetDate returns ProjectV2FieldValue.Date, and is useful for accessing the field via an interface. func (v *ProjectV2FieldValue) GetDate() string { return v.Date } // GetIterationId returns ProjectV2FieldValue.IterationId, and is useful for accessing the field via an interface. func (v *ProjectV2FieldValue) GetIterationId() string { return v.IterationId } // GetNumber returns ProjectV2FieldValue.Number, and is useful for accessing the field via an interface. func (v *ProjectV2FieldValue) GetNumber() float64 { return v.Number } // GetSingleSelectOptionId returns ProjectV2FieldValue.SingleSelectOptionId, and is useful for accessing the field via an interface. func (v *ProjectV2FieldValue) GetSingleSelectOptionId() string { return v.SingleSelectOptionId } // GetText returns ProjectV2FieldValue.Text, and is useful for accessing the field via an interface. func (v *ProjectV2FieldValue) GetText() string { return v.Text } // SetProjectFieldValueResponse is returned by SetProjectFieldValue on success. type SetProjectFieldValueResponse struct { // This mutation updates the value of a field for an item in a Project. Currently // only single-select, text, number, date, and iteration fields are supported. UpdateProjectV2ItemFieldValue SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayload `json:"updateProjectV2ItemFieldValue"` } // GetUpdateProjectV2ItemFieldValue returns SetProjectFieldValueResponse.UpdateProjectV2ItemFieldValue, and is useful for accessing the field via an interface. func (v *SetProjectFieldValueResponse) GetUpdateProjectV2ItemFieldValue() SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayload { return v.UpdateProjectV2ItemFieldValue } // SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayload includes the requested fields of the GraphQL type UpdateProjectV2ItemFieldValuePayload. // The GraphQL type's documentation follows. // // Autogenerated return type of UpdateProjectV2ItemFieldValue. type SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayload struct { // The updated item. ProjectV2Item SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayloadProjectV2Item `json:"projectV2Item"` } // GetProjectV2Item returns SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayload.ProjectV2Item, and is useful for accessing the field via an interface. func (v *SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayload) GetProjectV2Item() SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayloadProjectV2Item { return v.ProjectV2Item } // SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayloadProjectV2Item includes the requested fields of the GraphQL type ProjectV2Item. // The GraphQL type's documentation follows. // // An item within a Project. type SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayloadProjectV2Item struct { // The Node ID of the ProjectV2Item object Id string `json:"id"` } // GetId returns SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayloadProjectV2Item.Id, and is useful for accessing the field via an interface. func (v *SetProjectFieldValueUpdateProjectV2ItemFieldValueUpdateProjectV2ItemFieldValuePayloadProjectV2Item) GetId() string { return v.Id } // UpdateIssueResponse is returned by UpdateIssue on success. type UpdateIssueResponse struct { // Updates an Issue. UpdateIssue UpdateIssueUpdateIssueUpdateIssuePayload `json:"updateIssue"` } // GetUpdateIssue returns UpdateIssueResponse.UpdateIssue, and is useful for accessing the field via an interface. func (v *UpdateIssueResponse) GetUpdateIssue() UpdateIssueUpdateIssueUpdateIssuePayload { return v.UpdateIssue } // UpdateIssueUpdateIssueUpdateIssuePayload includes the requested fields of the GraphQL type UpdateIssuePayload. // The GraphQL type's documentation follows. // // Autogenerated return type of UpdateIssue. type UpdateIssueUpdateIssueUpdateIssuePayload struct { // The issue. Issue UpdateIssueUpdateIssueUpdateIssuePayloadIssue `json:"issue"` } // GetIssue returns UpdateIssueUpdateIssueUpdateIssuePayload.Issue, and is useful for accessing the field via an interface. func (v *UpdateIssueUpdateIssueUpdateIssuePayload) GetIssue() UpdateIssueUpdateIssueUpdateIssuePayloadIssue { return v.Issue } // UpdateIssueUpdateIssueUpdateIssuePayloadIssue 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 UpdateIssueUpdateIssueUpdateIssuePayloadIssue struct { // Identifies the issue number. Number int `json:"number"` // Identifies the issue title. Title string `json:"title"` // Identifies the state of the issue. State IssueState `json:"state"` // The HTTP URL for this issue Url string `json:"url"` } // GetNumber returns UpdateIssueUpdateIssueUpdateIssuePayloadIssue.Number, and is useful for accessing the field via an interface. func (v *UpdateIssueUpdateIssueUpdateIssuePayloadIssue) GetNumber() int { return v.Number } // GetTitle returns UpdateIssueUpdateIssueUpdateIssuePayloadIssue.Title, and is useful for accessing the field via an interface. func (v *UpdateIssueUpdateIssueUpdateIssuePayloadIssue) GetTitle() string { return v.Title } // GetState returns UpdateIssueUpdateIssueUpdateIssuePayloadIssue.State, and is useful for accessing the field via an interface. func (v *UpdateIssueUpdateIssueUpdateIssuePayloadIssue) GetState() IssueState { return v.State } // GetUrl returns UpdateIssueUpdateIssueUpdateIssuePayloadIssue.Url, and is useful for accessing the field via an interface. func (v *UpdateIssueUpdateIssueUpdateIssuePayloadIssue) GetUrl() string { return v.Url } // __AddIssueCommentInput is used internally by genqlient type __AddIssueCommentInput struct { SubjectId string `json:"subjectId"` Body string `json:"body"` } // GetSubjectId returns __AddIssueCommentInput.SubjectId, and is useful for accessing the field via an interface. func (v *__AddIssueCommentInput) GetSubjectId() string { return v.SubjectId } // GetBody returns __AddIssueCommentInput.Body, and is useful for accessing the field via an interface. func (v *__AddIssueCommentInput) GetBody() string { return v.Body } // __AddProjectItemInput is used internally by genqlient type __AddProjectItemInput struct { ProjectId string `json:"projectId"` ContentId string `json:"contentId"` } // GetProjectId returns __AddProjectItemInput.ProjectId, and is useful for accessing the field via an interface. func (v *__AddProjectItemInput) GetProjectId() string { return v.ProjectId } // GetContentId returns __AddProjectItemInput.ContentId, and is useful for accessing the field via an interface. func (v *__AddProjectItemInput) GetContentId() string { return v.ContentId } // __IssueByNumberInput is used internally by genqlient type __IssueByNumberInput struct { Owner string `json:"owner"` Repo string `json:"repo"` Number int `json:"number"` } // GetOwner returns __IssueByNumberInput.Owner, and is useful for accessing the field via an interface. func (v *__IssueByNumberInput) GetOwner() string { return v.Owner } // GetRepo returns __IssueByNumberInput.Repo, and is useful for accessing the field via an interface. func (v *__IssueByNumberInput) GetRepo() string { return v.Repo } // GetNumber returns __IssueByNumberInput.Number, and is useful for accessing the field via an interface. func (v *__IssueByNumberInput) GetNumber() int { return v.Number } // __IssueCommentsInput is used internally by genqlient type __IssueCommentsInput struct { Owner string `json:"owner"` Repo string `json:"repo"` Number int `json:"number"` After *string `json:"after,omitempty"` } // GetOwner returns __IssueCommentsInput.Owner, and is useful for accessing the field via an interface. func (v *__IssueCommentsInput) GetOwner() string { return v.Owner } // GetRepo returns __IssueCommentsInput.Repo, and is useful for accessing the field via an interface. func (v *__IssueCommentsInput) GetRepo() string { return v.Repo } // GetNumber returns __IssueCommentsInput.Number, and is useful for accessing the field via an interface. func (v *__IssueCommentsInput) GetNumber() int { return v.Number } // GetAfter returns __IssueCommentsInput.After, and is useful for accessing the field via an interface. func (v *__IssueCommentsInput) GetAfter() *string { return v.After } // __ProjectSingleSelectFieldInput is used internally by genqlient type __ProjectSingleSelectFieldInput struct { Org string `json:"org"` Number int `json:"number"` Field string `json:"field"` } // GetOrg returns __ProjectSingleSelectFieldInput.Org, and is useful for accessing the field via an interface. func (v *__ProjectSingleSelectFieldInput) GetOrg() string { return v.Org } // GetNumber returns __ProjectSingleSelectFieldInput.Number, and is useful for accessing the field via an interface. func (v *__ProjectSingleSelectFieldInput) GetNumber() int { return v.Number } // GetField returns __ProjectSingleSelectFieldInput.Field, and is useful for accessing the field via an interface. func (v *__ProjectSingleSelectFieldInput) GetField() string { return v.Field } // __SetProjectFieldValueInput is used internally by genqlient type __SetProjectFieldValueInput struct { ProjectId string `json:"projectId"` ItemId string `json:"itemId"` FieldId string `json:"fieldId"` Value ProjectV2FieldValue `json:"value"` } // GetProjectId returns __SetProjectFieldValueInput.ProjectId, and is useful for accessing the field via an interface. func (v *__SetProjectFieldValueInput) GetProjectId() string { return v.ProjectId } // GetItemId returns __SetProjectFieldValueInput.ItemId, and is useful for accessing the field via an interface. func (v *__SetProjectFieldValueInput) GetItemId() string { return v.ItemId } // GetFieldId returns __SetProjectFieldValueInput.FieldId, and is useful for accessing the field via an interface. func (v *__SetProjectFieldValueInput) GetFieldId() string { return v.FieldId } // GetValue returns __SetProjectFieldValueInput.Value, and is useful for accessing the field via an interface. func (v *__SetProjectFieldValueInput) GetValue() ProjectV2FieldValue { return v.Value } // __UpdateIssueInput is used internally by genqlient type __UpdateIssueInput struct { Id string `json:"id"` Title *string `json:"title,omitempty"` Body *string `json:"body,omitempty"` State *IssueState `json:"state,omitempty"` } // GetId returns __UpdateIssueInput.Id, and is useful for accessing the field via an interface. func (v *__UpdateIssueInput) GetId() string { return v.Id } // GetTitle returns __UpdateIssueInput.Title, and is useful for accessing the field via an interface. func (v *__UpdateIssueInput) GetTitle() *string { return v.Title } // GetBody returns __UpdateIssueInput.Body, and is useful for accessing the field via an interface. func (v *__UpdateIssueInput) GetBody() *string { return v.Body } // GetState returns __UpdateIssueInput.State, and is useful for accessing the field via an interface. func (v *__UpdateIssueInput) GetState() *IssueState { return v.State } // The mutation executed by AddIssueComment. const AddIssueComment_Operation = ` mutation AddIssueComment ($subjectId: ID!, $body: String!) { addComment(input: {subjectId:$subjectId,body:$body}) { commentEdge { node { id url } } } } ` // AddIssueComment posts a comment on an issue (subjectId is the issue node id). func AddIssueComment( ctx_ context.Context, client_ graphql.Client, subjectId string, body string, ) (data_ *AddIssueCommentResponse, err_ error) { req_ := &graphql.Request{ OpName: "AddIssueComment", Query: AddIssueComment_Operation, Variables: &__AddIssueCommentInput{ SubjectId: subjectId, Body: body, }, } data_ = &AddIssueCommentResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ } // The mutation executed by AddProjectItem. const AddProjectItem_Operation = ` mutation AddProjectItem ($projectId: ID!, $contentId: ID!) { addProjectV2ItemById(input: {projectId:$projectId,contentId:$contentId}) { item { id } } } ` // AddProjectItem adds an issue or pull request (by node id) to a project. func AddProjectItem( ctx_ context.Context, client_ graphql.Client, projectId string, contentId string, ) (data_ *AddProjectItemResponse, err_ error) { req_ := &graphql.Request{ OpName: "AddProjectItem", Query: AddProjectItem_Operation, Variables: &__AddProjectItemInput{ ProjectId: projectId, ContentId: contentId, }, } data_ = &AddProjectItemResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ } // The query executed by IssueByNumber. const IssueByNumber_Operation = ` query IssueByNumber ($owner: String!, $repo: String!, $number: Int!) { repository(owner: $owner, name: $repo) { issue(number: $number) { id number title body url state } } } ` // IssueByNumber fetches everything the pipeline needs in one round-trip: // the node id (required as a mutation subjectId / id), title, body, url and state. func IssueByNumber( ctx_ context.Context, client_ graphql.Client, owner string, repo string, number int, ) (data_ *IssueByNumberResponse, err_ error) { req_ := &graphql.Request{ OpName: "IssueByNumber", Query: IssueByNumber_Operation, Variables: &__IssueByNumberInput{ Owner: owner, Repo: repo, Number: number, }, } data_ = &IssueByNumberResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ } // The query executed by IssueComments. const IssueComments_Operation = ` query IssueComments ($owner: String!, $repo: String!, $number: Int!, $after: String) { repository(owner: $owner, name: $repo) { issue(number: $number) { comments(first: 100, after: $after) { nodes { body } pageInfo { hasNextPage endCursor } } } } } ` // IssueComments pages an issue's comments so the sync adapter can scan for its // idempotency marker before posting. Pass a nil $after for the first page, then // pageInfo.endCursor while pageInfo.hasNextPage. func IssueComments( ctx_ context.Context, client_ graphql.Client, owner string, repo string, number int, after *string, ) (data_ *IssueCommentsResponse, err_ error) { req_ := &graphql.Request{ OpName: "IssueComments", Query: IssueComments_Operation, Variables: &__IssueCommentsInput{ Owner: owner, Repo: repo, Number: number, After: after, }, } data_ = &IssueCommentsResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ } // The query executed by ProjectSingleSelectField. const ProjectSingleSelectField_Operation = ` query ProjectSingleSelectField ($org: String!, $number: Int!, $field: String!) { organization(login: $org) { projectV2(number: $number) { id field(name: $field) { __typename ... on ProjectV2SingleSelectField { id options { id name } } } } } } ` // ProjectSingleSelectField resolves a project's node id plus a single-select // field's id and its option ids, which SetProjectFieldValue requires. func ProjectSingleSelectField( ctx_ context.Context, client_ graphql.Client, org string, number int, field string, ) (data_ *ProjectSingleSelectFieldResponse, err_ error) { req_ := &graphql.Request{ OpName: "ProjectSingleSelectField", Query: ProjectSingleSelectField_Operation, Variables: &__ProjectSingleSelectFieldInput{ Org: org, Number: number, Field: field, }, } data_ = &ProjectSingleSelectFieldResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ } // The mutation executed by SetProjectFieldValue. const SetProjectFieldValue_Operation = ` mutation SetProjectFieldValue ($projectId: ID!, $itemId: ID!, $fieldId: ID!, $value: ProjectV2FieldValue!) { updateProjectV2ItemFieldValue(input: {projectId:$projectId,itemId:$itemId,fieldId:$fieldId,value:$value}) { projectV2Item { id } } } ` // SetProjectFieldValue sets one field on a project item. Populate exactly one // member of $value (text, number, date, singleSelectOptionId or iterationId). func SetProjectFieldValue( ctx_ context.Context, client_ graphql.Client, projectId string, itemId string, fieldId string, value ProjectV2FieldValue, ) (data_ *SetProjectFieldValueResponse, err_ error) { req_ := &graphql.Request{ OpName: "SetProjectFieldValue", Query: SetProjectFieldValue_Operation, Variables: &__SetProjectFieldValueInput{ ProjectId: projectId, ItemId: itemId, FieldId: fieldId, Value: value, }, } data_ = &SetProjectFieldValueResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ } // The mutation executed by UpdateIssue. const UpdateIssue_Operation = ` mutation UpdateIssue ($id: ID!, $title: String, $body: String, $state: IssueState) { updateIssue(input: {id:$id,title:$title,body:$body,state:$state}) { issue { number title state url } } } ` // UpdateIssue edits an issue's title/body/state. The optional inputs are // pointers with omitempty so a nil leaves that field untouched server-side; a // non-nil value (including "") is sent and applied. func UpdateIssue( ctx_ context.Context, client_ graphql.Client, id string, title *string, body *string, state *IssueState, ) (data_ *UpdateIssueResponse, err_ error) { req_ := &graphql.Request{ OpName: "UpdateIssue", Query: UpdateIssue_Operation, Variables: &__UpdateIssueInput{ Id: id, Title: title, Body: body, State: state, }, } data_ = &UpdateIssueResponse{} resp_ := &graphql.Response{Data: data_} err_ = client_.MakeRequest( ctx_, req_, resp_, ) return data_, err_ }