-
Notifications
You must be signed in to change notification settings - Fork 0
/
objects.go
54 lines (45 loc) · 1.48 KB
/
objects.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
package morganfield
/*
Legal types for JSON objects:
bool, for JSON booleans
float64, for JSON numbers
string, for JSON strings
[]interface{}, for JSON arrays
map[string]interface{}, for JSON objects
nil for JSON null
int, for JSON numbers
The "string" option signals that a field is stored as JSON inside a
JSON-encoded string. It applies only to fields of string, floating point,
or integer types.
Int64String int64 `json:",string"`
*/
// Example JSON objects as per https://docs.atlassian.com/jira/REST/latest/#d2e1869
type Auth_1_Session_Post_Request struct {
Username string `json:"username"`
Password string `json:"password"`
}
type Auth_1_Session_Post_Response struct {
Session struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"session"`
LoginInfo struct {
FailedLoginCount int `json:"failedLoginCount"`
LoginCount int `json:"loginCount"`
LastFailedLoginTime string `json:"lastFailedLoginTime"`
PreviousLoginTime string `json:"previousLoginTime"`
} `json:"loginInfo"`
}
type Auth_1_Session_Get_Response struct {
Self string `json:"self"`
Name string `json:"name"`
LoginInfo struct {
FailedLoginCount int `json:"failedLoginCount"`
LoginCount int `json:"loginCount"`
LastFailedLoginTime string `json:"lastFailedLoginTime"`
PreviousLoginTime string `json:"previousLoginTime"`
} `json:"loginInfo"`
}
func (a *Auth_1_Session_Post_Request) Validate() {
// Extra validation!
}