/
models.go
67 lines (56 loc) · 2.13 KB
/
models.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
package outlook_http
import (
"github.com/inovex/CalendarSync/internal/models"
)
// https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0
type EventList struct {
NextLink string `json:"@odata.nextLink"`
Events []Event `json:"value"`
}
type Event struct {
ID string `json:"id"`
UID string `json:"iCalUId"`
ChangeKey string `json:"changeKey"`
HtmlLink string `json:"webLink"`
Subject string `json:"subject"`
Start Time `json:"start"`
End Time `json:"end"`
Body Body `json:"body,omitempty"`
Attendees []Attendee `json:"attendees,omitempty"`
Location Location `json:"location"`
IsReminderOn bool `json:"isReminderOn"`
ReminderMinutesBeforeStart int `json:"reminderMinutesBeforeStart"`
Extensions []Extensions `json:"extensions"`
IsAllDay bool `json:"isAllDay"`
OnlineMeetingUrl string `json:"onlineMeetingUrl"`
ResponseStatus ResponseStatus `json:"responseStatus,omitempty"`
}
type Extensions struct {
OdataType string `json:"@odata.type"`
ExtensionName string `json:"extensionName"`
// needs to be embedded, Microsoft returns a 500 on an non-embedded object
models.Metadata
}
type ResponseStatus struct {
Response string `json:"response,omitempty"`
// there's an additional field called `time` which returns date and time when the response was returned
// but we don't need that
}
type Body struct {
ContentType string `json:"contentType,omitempty"`
Content string `json:"content,omitempty"`
}
type Time struct {
DateTime string `json:"dateTime"`
TimeZone string `json:"timeZone"`
}
type Attendee struct {
EmailAdress EmailAddress `json:"emailAddress,omitempty"`
}
type EmailAddress struct {
Name string `json:"name"`
Address string `json:"address"`
}
type Location struct {
Name string `json:"displayName"`
}