-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcal_api.mli
284 lines (245 loc) · 6.67 KB
/
gcal_api.mli
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
(*
Google Calendar API.
Implementation notes: this library should eventually become standalone.
*)
type http_response = Util_http_client.response
type with_token =
((string -> http_response Lwt.t) -> http_response Lwt.t)
(*
Type of the user-provided function that takes care of obtaining
and storing an access token and then trying the given HTTP calls
until successful.
A good function that performs retries with exponential backoff
as advised by Google is Google_http.request.
*)
val compare_access_role :
Gcal_api_t.access_role -> Gcal_api_t.access_role -> int
val calendar_list :
?minAccessRole:Gcal_api_t.access_role ->
?maxResults:int ->
?pageToken:string ->
?showHidden:bool ->
with_token ->
Gcal_api_t.calendar_list_response option Lwt.t
val calendar_list_unpaged :
?minAccessRole:Gcal_api_t.access_role ->
?maxResults:int ->
?showHidden:bool ->
with_token ->
Gcal_api_t.calendar_list_item list option Lwt.t
val calendar_list_get :
Gcalid.t ->
with_token ->
Gcal_api_t.calendar_list_item option Lwt.t
val update_calendar_list_item :
?colorRgbFormat:bool ->
Gcalid.t ->
Gcal_api_t.calendar_list_item_edit ->
with_token ->
Gcal_api_t.calendar_list_item option Lwt.t
val freebusy :
?timeZone:string ->
?groupExpansionMax:int ->
?calendarExpansionMax:int ->
timeMin:Gcal_api_t.timestamp ->
timeMax:Gcal_api_t.timestamp ->
Gcal_api_t.gcalid list ->
with_token ->
Gcal_api_t.freebusy_response option Lwt.t
type events_list_result =
[ `Gone | `Not_found | `OK of Gcal_api_t.events_list_response ]
val events_list :
?alwaysIncludeEmail:bool ->
?iCalUID:string ->
?maxAttendees:int ->
?maxResults:int ->
?orderBy:Gcal_api_t.event_order_by ->
?pageToken:string ->
?privateExtendedProperties:(string * string) list ->
?q:string ->
?sanitizeHtml:bool ->
?sharedExtendedProperties:(string * string) list ->
?showDeleted:bool ->
?showHiddenInvitations:bool ->
?singleEvents:bool ->
?syncToken:string ->
?timeMax:Util_time.t ->
?timeMin:Util_time.t ->
?timeZone:string ->
?updatedMin:Util_time.t ->
Gcalid.t ->
with_token ->
events_list_result Lwt.t
type events_list_unpaged_result =
[ `Gone
| `Not_found
| `OK of string * Gcalid.t * Gcal_api_t.event list * string option ]
val events_list_unpaged :
?alwaysIncludeEmail:bool ->
?iCalUID:string ->
?maxAttendees:int ->
?maxResults:int ->
?orderBy:Gcal_api_t.event_order_by ->
?privateExtendedProperties:(string * string) list ->
?q:string ->
?sanitizeHtml:bool ->
?sharedExtendedProperties:(string * string) list ->
?showDeleted:bool ->
?showHiddenInvitations:bool ->
?singleEvents:bool ->
?syncToken:string ->
?timeMax:Util_time.t ->
?timeMin:Util_time.t ->
?timeZone:string ->
?updatedMin:Util_time.t ->
Gcalid.t ->
with_token ->
events_list_unpaged_result Lwt.t
(* Errors occurring when fetching data from within events_stream *)
type stream_error = [ `Gone | `Not_found ]
type stream_item = [ `Event of Gcal_api_t.event
| `Error of stream_error ]
(*
Get a stream of events, originally paged.
The result is (stream, get_last_response) where get_last_response
returns the last page that was fetched. It provides timezone information
and other fields not included in event items.
*)
val events_stream :
?alwaysIncludeEmail:bool ->
?iCalUID:string ->
?maxAttendees:int ->
?maxResults:int ->
?orderBy:Gcal_api_t.event_order_by ->
?privateExtendedProperties:(string * string) list ->
?q:string ->
?sanitizeHtml:bool ->
?sharedExtendedProperties:(string * string) list ->
?showDeleted:bool ->
?showHiddenInvitations:bool ->
?singleEvents:bool ->
?syncToken:string ->
?timeMax:Util_time.t ->
?timeMin:Util_time.t ->
?timeZone:string ->
?updatedMin:Util_time.t ->
Gcalid.t ->
with_token ->
stream_item Lwt_stream.t * (unit -> Gcal_api_t.events_list_response)
val get_calendar_metadata :
Gcalid.t ->
with_token ->
Gcal_api_t.calendar_metadata option Lwt.t
val get_event :
?alwaysIncludeEmail:bool ->
?maxAttendees:int ->
?sanitizeHtml:bool ->
?timeZone:string ->
Gcalid.t ->
Geventid.t ->
with_token ->
Gcal_api_t.event option Lwt.t
val delete_event :
?sendNotifications:bool ->
Gcalid.t ->
Geventid.t ->
with_token ->
bool Lwt.t
val insert_empty_event :
?sanitizeHtml:bool ->
?sendNotifications:bool ->
Gcalid.t ->
string ->
with_token ->
Gcal_api_t.event option Lwt.t
val move_event :
?sendNotifications:bool ->
source:Gcalid.t ->
destination:Gcalid.t ->
Geventid.t ->
with_token ->
Gcal_api_t.event option Lwt.t
val insert_event :
?maxAttendees:int ->
?sanitizeHtml:'a ->
?sendNotifications:bool ->
Gcalid.t ->
Gcal_api_t.event_edit ->
((string -> http_response Lwt.t) ->
(Cohttp.Code.status_code * 'b * string) Lwt.t) ->
Gcal_api_t.event option Lwt.t
val event_edit_of_event : Gcal_api_t.event -> Gcal_api_t.event_edit option
type update_event_result =
[ `OK of Gcal_api_t.event | `Not_found | `Invalid_sequence_value ]
val update_event :
?alwaysIncludeEmail:bool ->
?maxAttendees:int ->
?sanitizeHtml:bool ->
?sendNotifications:bool ->
Gcalid.t ->
Geventid.t ->
Gcal_api_t.event_edit ->
with_token ->
update_event_result Lwt.t
val patch_event :
?alwaysIncludeEmail:bool ->
?maxAttendees:int ->
?sendNotifications:bool ->
?supportsAttachments:bool ->
Gcalid.t ->
Geventid.t ->
Gcal_api_t.event_patch ->
with_token ->
update_event_result Lwt.t
val insert_calendar :
summary:string ->
?timeZone:string ->
with_token ->
Gcal_api_t.calendar_list_item Lwt.t
val list_acl_rules :
Gcalid.t ->
with_token ->
Gcal_api_t.acl_list_response option Lwt.t
val insert_acl_rule :
Gcalid.t ->
Gcal_api_t.access_role ->
Email.t ->
with_token ->
Gcal_api_t.acl_rule Lwt.t
val update_acl_rule :
Gcalid.t ->
string ->
Gcal_api_t.access_role ->
with_token ->
Gcal_api_t.acl_rule Lwt.t
val delete_acl_rule :
Gcalid.t ->
string ->
((string -> http_response Lwt.t) ->
(Cohttp.Code.status_code * 'b * string) Lwt.t) ->
unit Lwt.t
val watch_events :
?channel_token:string ->
?ttl_seconds:float ->
Gcalid.t ->
channel_id:string ->
receiving_url:string ->
with_token ->
Gcal_api_t.watch_response option Lwt.t
val watch_calendar_list :
?channel_token:string ->
?ttl_seconds:float ->
channel_id:string ->
receiving_url:string ->
with_token ->
Gcal_api_t.watch_response Lwt.t
val unwatch :
?channel_token:string ->
channel_id:string ->
resource_id:string ->
with_token ->
unit Lwt.t
val parse_notification : (string -> string list) -> Gcal_api_t.notification
val get_colors :
with_token ->
Gcal_api_v.colors_response Lwt.t