gen_models.go

  1// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
  2
  3package models
  4
  5import (
  6	"fmt"
  7	"io"
  8	"strconv"
  9
 10	"github.com/MichaelMure/git-bug/bug"
 11	"github.com/MichaelMure/git-bug/repository"
 12)
 13
 14// An object that has an author.
 15type Authored interface {
 16	IsAuthored()
 17}
 18
 19type AddCommentAndCloseBugInput struct {
 20	// A unique identifier for the client performing the mutation.
 21	ClientMutationID *string `json:"clientMutationId"`
 22	// The name of the repository. If not set, the default repository is used.
 23	RepoRef *string `json:"repoRef"`
 24	// The bug ID's prefix.
 25	Prefix string `json:"prefix"`
 26	// The message to be added to the bug.
 27	Message string `json:"message"`
 28	// The collection of file's hash required for the first message.
 29	Files []repository.Hash `json:"files"`
 30}
 31
 32type AddCommentAndCloseBugPayload struct {
 33	// A unique identifier for the client performing the mutation.
 34	ClientMutationID *string `json:"clientMutationId"`
 35	// The affected bug.
 36	Bug BugWrapper `json:"bug"`
 37	// The resulting AddComment operation.
 38	CommentOperation *bug.AddCommentOperation `json:"commentOperation"`
 39	// The resulting SetStatusOperation.
 40	StatusOperation *bug.SetStatusOperation `json:"statusOperation"`
 41}
 42
 43type AddCommentAndReopenBugInput struct {
 44	// A unique identifier for the client performing the mutation.
 45	ClientMutationID *string `json:"clientMutationId"`
 46	// The name of the repository. If not set, the default repository is used.
 47	RepoRef *string `json:"repoRef"`
 48	// The bug ID's prefix.
 49	Prefix string `json:"prefix"`
 50	// The message to be added to the bug.
 51	Message string `json:"message"`
 52	// The collection of file's hash required for the first message.
 53	Files []repository.Hash `json:"files"`
 54}
 55
 56type AddCommentAndReopenBugPayload struct {
 57	// A unique identifier for the client performing the mutation.
 58	ClientMutationID *string `json:"clientMutationId"`
 59	// The affected bug.
 60	Bug BugWrapper `json:"bug"`
 61	// The resulting AddComment operation.
 62	CommentOperation *bug.AddCommentOperation `json:"commentOperation"`
 63	// The resulting SetStatusOperation.
 64	StatusOperation *bug.SetStatusOperation `json:"statusOperation"`
 65}
 66
 67type AddCommentInput struct {
 68	// A unique identifier for the client performing the mutation.
 69	ClientMutationID *string `json:"clientMutationId"`
 70	// The name of the repository. If not set, the default repository is used.
 71	RepoRef *string `json:"repoRef"`
 72	// The bug ID's prefix.
 73	Prefix string `json:"prefix"`
 74	// The message to be added to the bug.
 75	Message string `json:"message"`
 76	// The collection of file's hash required for the first message.
 77	Files []repository.Hash `json:"files"`
 78}
 79
 80type AddCommentPayload struct {
 81	// A unique identifier for the client performing the mutation.
 82	ClientMutationID *string `json:"clientMutationId"`
 83	// The affected bug.
 84	Bug BugWrapper `json:"bug"`
 85	// The resulting operation.
 86	Operation *bug.AddCommentOperation `json:"operation"`
 87}
 88
 89// The connection type for Bug.
 90type BugConnection struct {
 91	// A list of edges.
 92	Edges []*BugEdge   `json:"edges"`
 93	Nodes []BugWrapper `json:"nodes"`
 94	// Information to aid in pagination.
 95	PageInfo *PageInfo `json:"pageInfo"`
 96	// Identifies the total count of items in the connection.
 97	TotalCount int `json:"totalCount"`
 98}
 99
100// An edge in a connection.
101type BugEdge struct {
102	// A cursor for use in pagination.
103	Cursor string `json:"cursor"`
104	// The item at the end of the edge.
105	Node BugWrapper `json:"node"`
106}
107
108type ChangeLabelInput struct {
109	// A unique identifier for the client performing the mutation.
110	ClientMutationID *string `json:"clientMutationId"`
111	// The name of the repository. If not set, the default repository is used.
112	RepoRef *string `json:"repoRef"`
113	// The bug ID's prefix.
114	Prefix string `json:"prefix"`
115	// The list of label to add.
116	Added []string `json:"added"`
117	// The list of label to remove.
118	Removed []string `json:"Removed"`
119}
120
121type ChangeLabelPayload struct {
122	// A unique identifier for the client performing the mutation.
123	ClientMutationID *string `json:"clientMutationId"`
124	// The affected bug.
125	Bug BugWrapper `json:"bug"`
126	// The resulting operation.
127	Operation *bug.LabelChangeOperation `json:"operation"`
128	// The effect each source label had.
129	Results []*bug.LabelChangeResult `json:"results"`
130}
131
132type CloseBugInput struct {
133	// A unique identifier for the client performing the mutation.
134	ClientMutationID *string `json:"clientMutationId"`
135	// The name of the repository. If not set, the default repository is used.
136	RepoRef *string `json:"repoRef"`
137	// The bug ID's prefix.
138	Prefix string `json:"prefix"`
139}
140
141type CloseBugPayload struct {
142	// A unique identifier for the client performing the mutation.
143	ClientMutationID *string `json:"clientMutationId"`
144	// The affected bug.
145	Bug BugWrapper `json:"bug"`
146	// The resulting operation.
147	Operation *bug.SetStatusOperation `json:"operation"`
148}
149
150type CommentConnection struct {
151	Edges      []*CommentEdge `json:"edges"`
152	Nodes      []*bug.Comment `json:"nodes"`
153	PageInfo   *PageInfo      `json:"pageInfo"`
154	TotalCount int            `json:"totalCount"`
155}
156
157type CommentEdge struct {
158	Cursor string       `json:"cursor"`
159	Node   *bug.Comment `json:"node"`
160}
161
162type EditCommentInput struct {
163	// A unique identifier for the client performing the mutation.
164	ClientMutationID *string `json:"clientMutationId"`
165	// The name of the repository. If not set, the default repository is used.
166	RepoRef *string `json:"repoRef"`
167	// The bug ID's prefix.
168	Prefix string `json:"prefix"`
169	// The ID of the comment to be changed.
170	Target string `json:"target"`
171	// The new message to be set.
172	Message string `json:"message"`
173	// The collection of file's hash required for the first message.
174	Files []repository.Hash `json:"files"`
175}
176
177type EditCommentPayload struct {
178	// A unique identifier for the client performing the mutation.
179	ClientMutationID *string `json:"clientMutationId"`
180	// The affected bug.
181	Bug BugWrapper `json:"bug"`
182	// The resulting operation.
183	Operation *bug.EditCommentOperation `json:"operation"`
184}
185
186type IdentityConnection struct {
187	Edges      []*IdentityEdge   `json:"edges"`
188	Nodes      []IdentityWrapper `json:"nodes"`
189	PageInfo   *PageInfo         `json:"pageInfo"`
190	TotalCount int               `json:"totalCount"`
191}
192
193type IdentityEdge struct {
194	Cursor string          `json:"cursor"`
195	Node   IdentityWrapper `json:"node"`
196}
197
198type LabelConnection struct {
199	Edges      []*LabelEdge `json:"edges"`
200	Nodes      []bug.Label  `json:"nodes"`
201	PageInfo   *PageInfo    `json:"pageInfo"`
202	TotalCount int          `json:"totalCount"`
203}
204
205type LabelEdge struct {
206	Cursor string    `json:"cursor"`
207	Node   bug.Label `json:"node"`
208}
209
210type NewBugInput struct {
211	// A unique identifier for the client performing the mutation.
212	ClientMutationID *string `json:"clientMutationId"`
213	// The name of the repository. If not set, the default repository is used.
214	RepoRef *string `json:"repoRef"`
215	// The title of the new bug.
216	Title string `json:"title"`
217	// The first message of the new bug.
218	Message string `json:"message"`
219	// The collection of file's hash required for the first message.
220	Files []repository.Hash `json:"files"`
221}
222
223type NewBugPayload struct {
224	// A unique identifier for the client performing the mutation.
225	ClientMutationID *string `json:"clientMutationId"`
226	// The created bug.
227	Bug BugWrapper `json:"bug"`
228	// The resulting operation.
229	Operation *bug.CreateOperation `json:"operation"`
230}
231
232type OpenBugInput struct {
233	// A unique identifier for the client performing the mutation.
234	ClientMutationID *string `json:"clientMutationId"`
235	// The name of the repository. If not set, the default repository is used.
236	RepoRef *string `json:"repoRef"`
237	// The bug ID's prefix.
238	Prefix string `json:"prefix"`
239}
240
241type OpenBugPayload struct {
242	// A unique identifier for the client performing the mutation.
243	ClientMutationID *string `json:"clientMutationId"`
244	// The affected bug.
245	Bug BugWrapper `json:"bug"`
246	// The resulting operation.
247	Operation *bug.SetStatusOperation `json:"operation"`
248}
249
250// The connection type for an Operation
251type OperationConnection struct {
252	Edges      []*OperationEdge `json:"edges"`
253	Nodes      []bug.Operation  `json:"nodes"`
254	PageInfo   *PageInfo        `json:"pageInfo"`
255	TotalCount int              `json:"totalCount"`
256}
257
258// Represent an Operation
259type OperationEdge struct {
260	Cursor string        `json:"cursor"`
261	Node   bug.Operation `json:"node"`
262}
263
264// Information about pagination in a connection.
265type PageInfo struct {
266	// When paginating forwards, are there more items?
267	HasNextPage bool `json:"hasNextPage"`
268	// When paginating backwards, are there more items?
269	HasPreviousPage bool `json:"hasPreviousPage"`
270	// When paginating backwards, the cursor to continue.
271	StartCursor string `json:"startCursor"`
272	// When paginating forwards, the cursor to continue.
273	EndCursor string `json:"endCursor"`
274}
275
276type SetTitleInput struct {
277	// A unique identifier for the client performing the mutation.
278	ClientMutationID *string `json:"clientMutationId"`
279	// The name of the repository. If not set, the default repository is used.
280	RepoRef *string `json:"repoRef"`
281	// The bug ID's prefix.
282	Prefix string `json:"prefix"`
283	// The new title.
284	Title string `json:"title"`
285}
286
287type SetTitlePayload struct {
288	// A unique identifier for the client performing the mutation.
289	ClientMutationID *string `json:"clientMutationId"`
290	// The affected bug.
291	Bug BugWrapper `json:"bug"`
292	// The resulting operation
293	Operation *bug.SetTitleOperation `json:"operation"`
294}
295
296// The connection type for TimelineItem
297type TimelineItemConnection struct {
298	Edges      []*TimelineItemEdge `json:"edges"`
299	Nodes      []bug.TimelineItem  `json:"nodes"`
300	PageInfo   *PageInfo           `json:"pageInfo"`
301	TotalCount int                 `json:"totalCount"`
302}
303
304// Represent a TimelineItem
305type TimelineItemEdge struct {
306	Cursor string           `json:"cursor"`
307	Node   bug.TimelineItem `json:"node"`
308}
309
310type LabelChangeStatus string
311
312const (
313	LabelChangeStatusAdded         LabelChangeStatus = "ADDED"
314	LabelChangeStatusRemoved       LabelChangeStatus = "REMOVED"
315	LabelChangeStatusDuplicateInOp LabelChangeStatus = "DUPLICATE_IN_OP"
316	LabelChangeStatusAlreadyExist  LabelChangeStatus = "ALREADY_EXIST"
317	LabelChangeStatusDoesntExist   LabelChangeStatus = "DOESNT_EXIST"
318)
319
320var AllLabelChangeStatus = []LabelChangeStatus{
321	LabelChangeStatusAdded,
322	LabelChangeStatusRemoved,
323	LabelChangeStatusDuplicateInOp,
324	LabelChangeStatusAlreadyExist,
325	LabelChangeStatusDoesntExist,
326}
327
328func (e LabelChangeStatus) IsValid() bool {
329	switch e {
330	case LabelChangeStatusAdded, LabelChangeStatusRemoved, LabelChangeStatusDuplicateInOp, LabelChangeStatusAlreadyExist, LabelChangeStatusDoesntExist:
331		return true
332	}
333	return false
334}
335
336func (e LabelChangeStatus) String() string {
337	return string(e)
338}
339
340func (e *LabelChangeStatus) UnmarshalGQL(v interface{}) error {
341	str, ok := v.(string)
342	if !ok {
343		return fmt.Errorf("enums must be strings")
344	}
345
346	*e = LabelChangeStatus(str)
347	if !e.IsValid() {
348		return fmt.Errorf("%s is not a valid LabelChangeStatus", str)
349	}
350	return nil
351}
352
353func (e LabelChangeStatus) MarshalGQL(w io.Writer) {
354	fmt.Fprint(w, strconv.Quote(e.String()))
355}
356
357type Status string
358
359const (
360	StatusOpen   Status = "OPEN"
361	StatusClosed Status = "CLOSED"
362)
363
364var AllStatus = []Status{
365	StatusOpen,
366	StatusClosed,
367}
368
369func (e Status) IsValid() bool {
370	switch e {
371	case StatusOpen, StatusClosed:
372		return true
373	}
374	return false
375}
376
377func (e Status) String() string {
378	return string(e)
379}
380
381func (e *Status) UnmarshalGQL(v interface{}) error {
382	str, ok := v.(string)
383	if !ok {
384		return fmt.Errorf("enums must be strings")
385	}
386
387	*e = Status(str)
388	if !e.IsValid() {
389		return fmt.Errorf("%s is not a valid Status", str)
390	}
391	return nil
392}
393
394func (e Status) MarshalGQL(w io.Writer) {
395	fmt.Fprint(w, strconv.Quote(e.String()))
396}