forked from soft-stech/go-ews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recurrence.go
169 lines (136 loc) · 5.17 KB
/
recurrence.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package ewsxml
import (
"encoding/xml"
"time"
)
type Recurrence struct {
XMLName xml.Name `xml:"Recurrence"`
DailyRecurrence *DailyRecurrence
WeeklyRecurrence *WeeklyRecurrence
AbsoluteMonthlyRecurrence *AbsoluteMonthlyRecurrence
RelativeMonthlyRecurrence *RelativeMonthlyRecurrence
AbsoluteYearlyRecurrence *AbsoluteYearlyRecurrence
RelativeYearlyRecurrence *RelativeYearlyRecurrence
EndDateRecurrence *EndDateRecurrence
NoEndRecurrence *NoEndRecurrence
NumberedRecurrence *NumberedRecurrence
}
type DailyRecurrence struct {
XMLName xml.Name `xml:"DailyRecurrence"`
Interval int `xml:"Interval"`
}
type WeeklyRecurrence struct {
XMLName xml.Name `xml:"WeeklyRecurrence"`
Interval int `xml:"Interval"`
DaysOfWeek string `xml:"DaysOfWeek,omitempty"`
FirstDayOfWeek string `xml:"FirstDayOfWeek,omitempty"`
}
type AbsoluteMonthlyRecurrence struct {
XMLName xml.Name `xml:"AbsoluteMonthlyRecurrence"`
DayOfMonth int `xml:"DayOfMonth,omitempty"`
Interval int `xml:"Interval,omitempty"`
}
type RelativeMonthlyRecurrence struct {
XMLName xml.Name `xml:"RelativeMonthlyRecurrence"`
DaysOfWeek string `xml:"DaysOfWeek,omitempty"`
DayOfWeekIndex string `xml:"DayOfWeekIndex"`
Interval int `xml:"Interval,omitempty"`
}
type AbsoluteYearlyRecurrence struct {
XMLName xml.Name `xml:"AbsoluteYearlyRecurrence"`
DayOfMonth int `xml:"DayOfMonth,omitempty"`
Month string `xml:"Month,omitempty"`
}
type RelativeYearlyRecurrence struct {
XMLName xml.Name `xml:"RelativeYearlyRecurrence"`
DaysOfWeek string `xml:"DaysOfWeek,omitempty"`
DayOfWeekIndex string `xml:"DayOfWeekIndex"`
Month string `xml:"Month,omitempty"`
}
type EndDateRecurrence struct {
XMLName xml.Name `xml:"EndDateRecurrence"`
StartDate string `xml:"StartDate"`
EndDate string `xml:"EndDate"`
}
type NoEndRecurrence struct {
XMLName xml.Name `xml:"NoEndRecurrence"`
StartDate string `xml:"StartDate"`
}
type NumberedRecurrence struct {
XMLName xml.Name `xml:"NumberedRecurrence"`
StartDate string `xml:"StartDate"`
NumberOfOccurrences int `xml:"NumberOfOccurrences"`
}
type SendRecurrence struct {
XMLName xml.Name `xml:"t:Recurrence"`
DailyRecurrence *SendDailyRecurrence
WeeklyRecurrence *SendWeeklyRecurrence
AbsoluteMonthlyRecurrence *SendAbsoluteMonthlyRecurrence
RelativeMonthlyRecurrence *SendRelativeMonthlyRecurrence
AbsoluteYearlyRecurrence *SendAbsoluteYearlyRecurrence
RelativeYearlyRecurrence *SendRelativeYearlyRecurrence
EndDateRecurrence *SendEndDateRecurrence
NoEndRecurrence *SendNoEndRecurrence
NumberedRecurrence *SendNumberedRecurrence
}
type SendDailyRecurrence struct {
XMLName xml.Name `xml:"t:DailyRecurrence"`
Interval int `xml:"t:Interval"`
}
type SendWeeklyRecurrence struct {
XMLName xml.Name `xml:"t:WeeklyRecurrence"`
Interval int `xml:"t:Interval"`
DaysOfWeek string `xml:"t:DaysOfWeek,omitempty"`
FirstDayOfWeek string `xml:"t:FirstDayOfWeek,omitempty"`
}
type SendAbsoluteMonthlyRecurrence struct {
XMLName xml.Name `xml:"t:AbsoluteMonthlyRecurrence"`
DayOfMonth int `xml:"t:DayOfMonth,omitempty"`
Interval int `xml:"t:Interval,omitempty"`
}
type SendRelativeMonthlyRecurrence struct {
XMLName xml.Name `xml:"t:RelativeMonthlyRecurrence"`
DaysOfWeek string `xml:"t:DaysOfWeek,omitempty"`
DayOfWeekIndex string `xml:"t:DayOfWeekIndex"`
Interval int `xml:"t:Interval,omitempty"`
}
type SendAbsoluteYearlyRecurrence struct {
XMLName xml.Name `xml:"t:AbsoluteYearlyRecurrence"`
DayOfMonth int `xml:"t:DayOfMonth,omitempty"`
Month string `xml:"t:Month,omitempty"`
}
type SendRelativeYearlyRecurrence struct {
XMLName xml.Name `xml:"t:RelativeYearlyRecurrence"`
DaysOfWeek string `xml:"t:DaysOfWeek,omitempty"`
DayOfWeekIndex string `xml:"t:DayOfWeekIndex"`
Month string `xml:"t:Month,omitempty"`
}
type SendEndDateRecurrence struct {
XMLName xml.Name `xml:"t:EndDateRecurrence"`
StartDate time.Time `xml:"t:StartDate"`
EndDate time.Time `xml:"t:EndDate"`
}
type SendNoEndRecurrence struct {
XMLName xml.Name `xml:"t:NoEndRecurrence"`
StartDate time.Time `xml:"t:StartDate"`
}
type SendNumberedRecurrence struct {
XMLName xml.Name `xml:"t:NumberedRecurrence"`
StartDate time.Time `xml:"t:StartDate"`
NumberOfOccurrences int `xml:"t:NumberOfOccurrences"`
}
// The Ranges element specifies an array of recurrence ranges.
// https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/ranges
type Ranges struct {
XMLName xml.Name `xml:"t:Ranges"`
Range []Range
}
// The Range element specifies a range of calendar item occurrences for a repeating calendar item.const
// https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/range
type Range struct {
XMLName xml.Name `xml:"t:Range"`
Start time.Time `xml:"Start,attr"`
End time.Time `xml:"End,attr"`
Count int `xml:"Count,attr"`
CompareOriginalStartTime bool `xml:"CompareOriginalStartTime,attr"`
}