This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
110 lines (80 loc) · 1.96 KB
/
types.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package travisci
// https://developer.travis-ci.com/explore/#explorer
// https://developer.travis-ci.com/format
type APIObject struct {
Type string `json:"@type"`
HREF string `json:"@href"`
Representation string `json:"@representation"`
Pagination *Pagination `json:"@pagination"`
Permissions map[string]bool `json:"@permissions"`
}
type Page struct {
HREF string `json:"@href"`
Offset int
Limit int
}
type Pagination struct {
Count int // overall number of entries in the collection
Limit int // maximum number of entries included in the current subset
Offset int // number of entries preceding the first entry of the subset
IsFirst bool `json:"is_first"`
IsLast bool `json:"is_last"`
First *Page
Next *Page
Last *Page
}
type Repository struct {
APIObject
ID int
Name string
Slug string
Description string
// TODO: Always seems to be `null`
// GithubLanguage string `json:"github_language"`
Active bool
Starred bool
Private bool
DefaultBranch Branch `json:"default_branch"`
}
type Repositories struct {
APIObject
Repositories []Repository
}
type Build struct {
APIObject
ID int
Number string
State string
Duration int // seconds
EventType string `json:"event_type"`
PreviousState string `json:"previous_state"`
PullRequestTitle string `json:"pull_request_title"`
PullRequestNumber int `json:"pull_request_number"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at"`
}
type Branch struct {
APIObject
Name string
}
type EnvVar struct {
APIObject
ID string
Name string
Value string
Public bool
}
type EnvVars struct {
APIObject
EnvVars []EnvVar `json:"env_vars"`
}
type User struct {
APIObject
ID int
Login string
Name string
GitHubID int `json:"github_id"`
AvatarURL string `json:"avatar_url"`
IsSyncing bool `json:"is_syncing"`
SyncedAt string `json:"synced_at"`
}