forked from joaoh82/aircall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
72 lines (64 loc) · 2.03 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
package aircall
const (
CallStatusInitial = "initial"
CallStatusAnswered = "answered"
CallStatusDone = "done"
CallDirectionInbound = "inbound"
CallDirectionOutbound = "outbound"
)
type Company struct {
Name string `json:"name"`
UsersCount int `json:"users_count"`
NumbersCount int `json:"numbers_count"`
}
type User struct {
ID int `json:"id"`
DirectLink string `json:"direct_link"`
Name string `json:"name"`
Email string `json:"email"`
Available bool `json:"availaible"`
Numbers []Number `json:"numbers,omitempty"`
}
type Number struct {
ID int `json:"id"`
DirectLink string `json:"direct_link"`
Name string `json:"name"`
Digits string `json:"digits"`
Country string `json:"country"`
TimeZone string `json:"time_zone"`
Open bool `json:"open"`
}
type Contact struct {
ID int `json:"id"`
DirectLink string `json:"direct_link"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
CompanyName string `json:"company_name"`
Information string `json:"information"`
PhoneNumbers []ContactInfo `json:"phone_numbers"`
Emails []ContactInfo `json:"emails"`
}
type ContactInfo struct {
Label string `json:"label"`
Value string `json:"value"`
}
type Call struct {
ID int `json:"id"`
DirectLink string `json:"direct_link"`
Status string `json:"status"`
Direction string `json:"direction"`
StartedAt int `json:"started_at"`
AnsweredAt int `json:"answered_at"`
EndedAt int `json:"ended_at"`
Duration int `json:"duration"`
RawDigits string `json:"raw_digits"`
Voicemail string `json:"voicemail"`
Recording string `json:"recording"`
Archived bool `json:"archived"`
Number Number `json:"number"`
User User `json:"user"`
Contact Contact `json:"contact"`
AssignedTo User `json:"assigned_to"`
Comments []string `json:"comments"`
Tags []string `json:"tags"`
}