~sungo/ghch

ghch/response.go -rw-r--r-- 854 bytes
18942019 — sungo include the license in the readme 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Original code by sungo ( https://sungo.io ).
// Licensed under the 0BSD License. See the included LICENSE file.

package main

import (
	"time"
)

type GqlLabel struct {
	Name string `json:"name"`
}
type GqlUser struct {
	Login string `json:"login"`
}

type GqlPR struct {
	Number int    `json:"number"`
	Title  string `json:"title"`
	Body   string `json:"bodyText"`
	Labels struct {
		Nodes []GqlLabel `json:"nodes"`
	} `json:"labels"`
	Author    GqlUser   `json:"author"`
	MergedBy  GqlUser   `json:"mergedBy"`
	CreatedAt time.Time `json:"createdAt"`
	MergedAt  time.Time `json:"mergedAt"`
	Merged    bool      `json:"merged"`
	URL       string    `json:"url"`
}

type GqlResponse struct {
	Data struct {
		Repo struct {
			PullRequests struct {
				Nodes []GqlPR `json:"nodes"`
			} `json:"pullRequests"`
		} `json:"repository"`
	} `json:"data"`
}