gen_models.go

 1// Code generated by github.com/vektah/gqlgen, DO NOT EDIT.
 2
 3package models
 4
 5import (
 6	fmt "fmt"
 7	io "io"
 8	strconv "strconv"
 9
10	bug "github.com/MichaelMure/git-bug/bug"
11)
12
13type Authored interface{}
14type BugConnection struct {
15	Edges      []BugEdge      `json:"edges"`
16	Nodes      []bug.Snapshot `json:"nodes"`
17	PageInfo   PageInfo       `json:"pageInfo"`
18	TotalCount int            `json:"totalCount"`
19}
20type BugEdge struct {
21	Cursor string       `json:"cursor"`
22	Node   bug.Snapshot `json:"node"`
23}
24type CommentConnection struct {
25	Edges      []CommentEdge `json:"edges"`
26	Nodes      []bug.Comment `json:"nodes"`
27	PageInfo   PageInfo      `json:"pageInfo"`
28	TotalCount int           `json:"totalCount"`
29}
30type CommentEdge struct {
31	Cursor string      `json:"cursor"`
32	Node   bug.Comment `json:"node"`
33}
34type OperationConnection struct {
35	Edges      []OperationEdge `json:"edges"`
36	Nodes      []bug.Operation `json:"nodes"`
37	PageInfo   PageInfo        `json:"pageInfo"`
38	TotalCount int             `json:"totalCount"`
39}
40type OperationEdge struct {
41	Cursor string        `json:"cursor"`
42	Node   bug.Operation `json:"node"`
43}
44type PageInfo struct {
45	HasNextPage     bool `json:"hasNextPage"`
46	HasPreviousPage bool `json:"hasPreviousPage"`
47}
48
49type Status string
50
51const (
52	StatusOpen   Status = "OPEN"
53	StatusClosed Status = "CLOSED"
54)
55
56func (e Status) IsValid() bool {
57	switch e {
58	case StatusOpen, StatusClosed:
59		return true
60	}
61	return false
62}
63
64func (e Status) String() string {
65	return string(e)
66}
67
68func (e *Status) UnmarshalGQL(v interface{}) error {
69	str, ok := v.(string)
70	if !ok {
71		return fmt.Errorf("enums must be strings")
72	}
73
74	*e = Status(str)
75	if !e.IsValid() {
76		return fmt.Errorf("%s is not a valid Status", str)
77	}
78	return nil
79}
80
81func (e Status) MarshalGQL(w io.Writer) {
82	fmt.Fprint(w, strconv.Quote(e.String()))
83}