forked from MDr164/swp-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.go
More file actions
73 lines (63 loc) · 1.69 KB
/
structs.go
File metadata and controls
73 lines (63 loc) · 1.69 KB
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
package main
import (
"net/http"
"net/url"
)
// API is the main api data structure
type API struct {
endPoint *url.URL
client *http.Client
token string
tokenType int
}
// Response defines the information sent via the REST-API
type Response struct {
Size int `json:"size"`
Limit int `json:"limit"`
Start int `json:"start"`
IsLastPage bool `json:"isLastPage"`
Values []Values `json:"values"`
}
// Values defines all relevant values inside the response
type Values struct {
Open bool `json:"open"`
CreatedDate int64 `json:"createdDate"`
Author Author `json:"author"`
UpdatedDate int64 `json:"updatedDate"`
ClosedDate int64 `json:"closedDate"`
Description string `json:"description"`
Properties Properties `json:"properties"`
Reviewers []Reviewer `json:"reviewers"`
Title string `json:"title"`
Links Links `json:"links"`
ID int `json:"id"`
}
// Author defines author information
type Author struct {
User User `json:"user"`
Approved bool `json:"approved"`
}
// Reviewer defines reviewer information
type Reviewer struct {
User User `json:"user"`
Approved bool `json:"approved"`
Status string `json:"status"`
}
// User defines user information
type User struct {
Type string `json:"type"`
Name string `json:"name"`
Mail string `json:"emailAddress"`
DisplayName string `json:"displayName"`
Links Links `json:"links"`
}
type Properties struct {
CommentCount int `json:"commentCount"`
}
// Links defines hyperlink information
type Links struct {
Self []Self `json:"self"`
}
type Self struct {
Href string `json:"href"`
}