2018-09-14 13:40:31 +03:00
|
|
|
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
2018-07-27 20:48:45 +03:00
|
|
|
|
2018-07-29 20:37:06 +03:00
|
|
|
package models
|
2018-07-27 20:48:45 +03:00
|
|
|
|
|
|
|
import (
|
2018-12-23 19:11:37 +03:00
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"strconv"
|
2018-07-27 20:48:45 +03:00
|
|
|
|
2018-12-23 19:11:37 +03:00
|
|
|
"github.com/MichaelMure/git-bug/bug"
|
2019-03-31 22:44:14 +03:00
|
|
|
"github.com/MichaelMure/git-bug/identity"
|
2018-07-27 20:48:45 +03:00
|
|
|
)
|
|
|
|
|
2018-09-14 13:40:31 +03:00
|
|
|
// An object that has an author.
|
2018-12-23 19:11:37 +03:00
|
|
|
type Authored interface {
|
|
|
|
IsAuthored()
|
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
|
|
|
// The connection type for Bug.
|
2018-07-27 20:48:45 +03:00
|
|
|
type BugConnection struct {
|
2019-04-09 18:43:17 +03:00
|
|
|
// A list of edges.
|
2019-05-15 17:57:30 +03:00
|
|
|
Edges []*BugEdge `json:"edges"`
|
|
|
|
Nodes []*bug.Snapshot `json:"nodes"`
|
2019-04-09 18:43:17 +03:00
|
|
|
// Information to aid in pagination.
|
2019-05-15 17:57:30 +03:00
|
|
|
PageInfo *PageInfo `json:"pageInfo"`
|
2019-04-09 18:43:17 +03:00
|
|
|
// Identifies the total count of items in the connection.
|
|
|
|
TotalCount int `json:"totalCount"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
|
|
|
// An edge in a connection.
|
2018-07-27 20:48:45 +03:00
|
|
|
type BugEdge struct {
|
2019-04-09 18:43:17 +03:00
|
|
|
// A cursor for use in pagination.
|
|
|
|
Cursor string `json:"cursor"`
|
|
|
|
// The item at the end of the edge.
|
2019-05-15 17:57:30 +03:00
|
|
|
Node *bug.Snapshot `json:"node"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
2018-07-27 20:48:45 +03:00
|
|
|
type CommentConnection struct {
|
2019-05-15 17:57:30 +03:00
|
|
|
Edges []*CommentEdge `json:"edges"`
|
|
|
|
Nodes []*bug.Comment `json:"nodes"`
|
|
|
|
PageInfo *PageInfo `json:"pageInfo"`
|
|
|
|
TotalCount int `json:"totalCount"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
2018-07-27 20:48:45 +03:00
|
|
|
type CommentEdge struct {
|
2019-05-15 17:57:30 +03:00
|
|
|
Cursor string `json:"cursor"`
|
|
|
|
Node *bug.Comment `json:"node"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
2019-03-31 22:44:14 +03:00
|
|
|
type IdentityConnection struct {
|
2019-05-15 17:57:30 +03:00
|
|
|
Edges []*IdentityEdge `json:"edges"`
|
2019-03-31 22:44:14 +03:00
|
|
|
Nodes []identity.Interface `json:"nodes"`
|
2019-05-15 17:57:30 +03:00
|
|
|
PageInfo *PageInfo `json:"pageInfo"`
|
2019-03-31 22:44:14 +03:00
|
|
|
TotalCount int `json:"totalCount"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type IdentityEdge struct {
|
|
|
|
Cursor string `json:"cursor"`
|
|
|
|
Node identity.Interface `json:"node"`
|
|
|
|
}
|
|
|
|
|
2018-12-23 19:55:41 +03:00
|
|
|
// The connection type for an Operation
|
2018-07-27 20:48:45 +03:00
|
|
|
type OperationConnection struct {
|
2019-05-15 17:57:30 +03:00
|
|
|
Edges []*OperationEdge `json:"edges"`
|
|
|
|
Nodes []bug.Operation `json:"nodes"`
|
|
|
|
PageInfo *PageInfo `json:"pageInfo"`
|
|
|
|
TotalCount int `json:"totalCount"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
2018-12-23 19:55:41 +03:00
|
|
|
// Represent an Operation
|
2018-07-27 20:48:45 +03:00
|
|
|
type OperationEdge struct {
|
2018-08-01 20:24:19 +03:00
|
|
|
Cursor string `json:"cursor"`
|
|
|
|
Node bug.Operation `json:"node"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
2018-09-14 13:40:31 +03:00
|
|
|
|
|
|
|
// Information about pagination in a connection.
|
2018-07-27 20:48:45 +03:00
|
|
|
type PageInfo struct {
|
2019-04-09 18:43:17 +03:00
|
|
|
// When paginating forwards, are there more items?
|
|
|
|
HasNextPage bool `json:"hasNextPage"`
|
|
|
|
// When paginating backwards, are there more items?
|
|
|
|
HasPreviousPage bool `json:"hasPreviousPage"`
|
|
|
|
// When paginating backwards, the cursor to continue.
|
|
|
|
StartCursor string `json:"startCursor"`
|
|
|
|
// When paginating forwards, the cursor to continue.
|
|
|
|
EndCursor string `json:"endCursor"`
|
2018-07-27 20:48:45 +03:00
|
|
|
}
|
|
|
|
|
2018-12-23 19:55:41 +03:00
|
|
|
// The connection type for TimelineItem
|
2018-09-29 21:58:25 +03:00
|
|
|
type TimelineItemConnection struct {
|
2019-05-15 17:57:30 +03:00
|
|
|
Edges []*TimelineItemEdge `json:"edges"`
|
|
|
|
Nodes []bug.TimelineItem `json:"nodes"`
|
|
|
|
PageInfo *PageInfo `json:"pageInfo"`
|
|
|
|
TotalCount int `json:"totalCount"`
|
2018-09-29 21:58:25 +03:00
|
|
|
}
|
|
|
|
|
2018-12-23 19:55:41 +03:00
|
|
|
// Represent a TimelineItem
|
2018-09-29 21:58:25 +03:00
|
|
|
type TimelineItemEdge struct {
|
|
|
|
Cursor string `json:"cursor"`
|
|
|
|
Node bug.TimelineItem `json:"node"`
|
|
|
|
}
|
|
|
|
|
2018-07-27 20:48:45 +03:00
|
|
|
type Status string
|
|
|
|
|
|
|
|
const (
|
|
|
|
StatusOpen Status = "OPEN"
|
|
|
|
StatusClosed Status = "CLOSED"
|
|
|
|
)
|
|
|
|
|
2019-04-09 18:43:17 +03:00
|
|
|
var AllStatus = []Status{
|
|
|
|
StatusOpen,
|
|
|
|
StatusClosed,
|
|
|
|
}
|
|
|
|
|
2018-07-27 20:48:45 +03:00
|
|
|
func (e Status) IsValid() bool {
|
|
|
|
switch e {
|
|
|
|
case StatusOpen, StatusClosed:
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e Status) String() string {
|
|
|
|
return string(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Status) UnmarshalGQL(v interface{}) error {
|
|
|
|
str, ok := v.(string)
|
|
|
|
if !ok {
|
|
|
|
return fmt.Errorf("enums must be strings")
|
|
|
|
}
|
|
|
|
|
|
|
|
*e = Status(str)
|
|
|
|
if !e.IsValid() {
|
|
|
|
return fmt.Errorf("%s is not a valid Status", str)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e Status) MarshalGQL(w io.Writer) {
|
|
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
|
|
}
|