package otoggl

  1. Overview
  2. Docs

Source file toggl_v.ml

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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
(* Auto-generated from "toggl.atd" *)
[@@@ocaml.warning "-27-32-33-35-39"]

(** Helper types *)

(** Response types *)
type datetime = Toggl_t.datetime

(** Represents a time entry as we send to Toggl when updating one *)
type time_entry_update_request = Toggl_t.time_entry_update_request = {
  description: string option;
  wid: int option;
  pid: int option option;
  start: datetime option;
  stop: datetime option option;
  duration: int option;
  tags: string list option;
  duronly: bool option;
  billable: bool option
}

type wrapped_time_entry_update_request =
  Toggl_t.wrapped_time_entry_update_request = {
  time_entry: time_entry_update_request
}

(**
  Represents a time entry as we send to Toggl when starting or creating one
*)
type time_entry_request = Toggl_t.time_entry_request = {
  description: string;
  wid: int option;
  pid: int option;
  start: datetime option;
  stop: datetime option option;
  duration: int;
  created_with: string;
  tags: string list;
  duronly: bool;
  billable: bool
}

type wrapped_time_entry = Toggl_t.wrapped_time_entry = {
  time_entry: time_entry_request
}

type wid = Toggl_t.wid

(** Represents a project as we send to Toggl when creating one *)
type project_request = Toggl_t.project_request = {
  wid: wid;
  name: string;
  billable: bool;
  is_private: bool;
  active: bool;
  auto_estimates: bool;
  estimated_hours: bool;
  actual_hours: int;
  template: bool;
  template_id: int option;
  cid: int option;
  color: string option;
  hex_color: string option
}

type wrapped_project_request = Toggl_t.wrapped_project_request = {
  project: project_request
}

(** Represents a workspace in Toggl *)
type workspace = Toggl_t.workspace = {
  id: wid;
  name: string;
  default_currency: string;
  at: datetime;
  premium: bool;
  admin: bool;
  default_hourly_rate: float;
  only_admins_may_create_projects: bool;
  only_admins_see_billable_rates: bool;
  only_admins_see_team_dashboard: bool;
  projects_billable_by_default: bool;
  rounding: int;
  rounding_minutes: int;
  ical_enabled: bool;
  api_token: string option;
  profile: int option;
  logo_url: string option
}

type workspace_list = Toggl_t.workspace_list

type uid = Toggl_t.uid

type tid = Toggl_t.tid

type pid = Toggl_t.pid

(** Represents a time enty as will be returned from the Toggl API *)
type time_entry = Toggl_t.time_entry = {
  id: tid;
  wid: wid;
  uid: uid;
  description: string;
  at: datetime;
  pid: pid option;
  start: datetime;
  stop: datetime option;
  duration: int;
  tags: string list;
  duronly: bool;
  billable: bool
}

type time_entry_list = Toggl_t.time_entry_list

type tid_list = Toggl_t.tid_list

(** Represents a project in Toggl *)
type project = Toggl_t.project = {
  id: pid;
  wid: wid;
  name: string;
  at: datetime;
  created_at: datetime option;
  billable: bool;
  is_private: bool;
  active: bool;
  auto_estimates: bool;
  estimated_hours: bool;
  actual_hours: int;
  template: bool;
  template_id: int option;
  color: string option;
  hex_color: string option
}

type project_list = Toggl_t.project_list

type pid_list = Toggl_t.pid_list

type data_time_entry = Toggl_t.data_time_entry = { data: time_entry }

(** Request types *)
type data_project = Toggl_t.data_project = { data: project }

let validate__x_ac63a5d = (
  fun _ _ -> None
)
let validate_datetime = (
  validate__x_ac63a5d
)
let validate__string_option = (
  fun _ _ -> None
)
let validate__string_list = (
  fun _ _ -> None
)
let validate__string_list_option = (
  fun _ _ -> None
)
let validate__int_option = (
  fun _ _ -> None
)
let validate__int_nullable = (
  fun _ _ -> None
)
let validate__int_nullable_option = (
  fun _ _ -> None
)
let validate__datetime_option = (
  fun _ _ -> None
)
let validate__datetime_nullable = (
  fun _ _ -> None
)
let validate__datetime_nullable_option = (
  fun _ _ -> None
)
let validate__bool_option = (
  fun _ _ -> None
)
let validate_time_entry_update_request : _ -> time_entry_update_request -> _ = (
  fun _ _ -> None
)
let validate_wrapped_time_entry_update_request : _ -> wrapped_time_entry_update_request -> _ = (
  fun _ _ -> None
)
let validate_time_entry_request : _ -> time_entry_request -> _ = (
  fun _ _ -> None
)
let validate_wrapped_time_entry : _ -> wrapped_time_entry -> _ = (
  fun _ _ -> None
)
let validate_wid = (
  (fun _ _ -> None)
)
let validate_project_request : _ -> project_request -> _ = (
  fun _ _ -> None
)
let validate_wrapped_project_request : _ -> wrapped_project_request -> _ = (
  fun _ _ -> None
)
let validate_workspace : _ -> workspace -> _ = (
  fun _ _ -> None
)
let validate__workspace_list = (
  fun _ _ -> None
)
let validate_workspace_list = (
  validate__workspace_list
)
let validate_uid = (
  (fun _ _ -> None)
)
let validate_tid = (
  (fun _ _ -> None)
)
let validate_pid = (
  (fun _ _ -> None)
)
let validate__pid_option = (
  fun _ _ -> None
)
let validate_time_entry : _ -> time_entry -> _ = (
  fun _ _ -> None
)
let validate__time_entry_list = (
  fun _ _ -> None
)
let validate_time_entry_list = (
  validate__time_entry_list
)
let validate__tid_list = (
  fun _ _ -> None
)
let validate_tid_list = (
  validate__tid_list
)
let validate_project : _ -> project -> _ = (
  fun _ _ -> None
)
let validate__project_list = (
  fun _ _ -> None
)
let validate_project_list = (
  validate__project_list
)
let validate__pid_list = (
  fun _ _ -> None
)
let validate_pid_list = (
  validate__pid_list
)
let validate_data_time_entry : _ -> data_time_entry -> _ = (
  fun _ _ -> None
)
let validate_data_project : _ -> data_project -> _ = (
  fun _ _ -> None
)
let create_time_entry_update_request 
  ?description
  ?wid
  ?pid
  ?start
  ?stop
  ?duration
  ?tags
  ?duronly
  ?billable
  () : time_entry_update_request =
  {
    description = description;
    wid = wid;
    pid = pid;
    start = start;
    stop = stop;
    duration = duration;
    tags = tags;
    duronly = duronly;
    billable = billable;
  }
let create_wrapped_time_entry_update_request 
  ~time_entry
  () : wrapped_time_entry_update_request =
  {
    time_entry = time_entry;
  }
let create_time_entry_request 
  ~description
  ?wid
  ?pid
  ?start
  ?stop
  ?(duration = 0)
  ~created_with
  ?(tags = [])
  ?(duronly = false)
  ?(billable = false)
  () : time_entry_request =
  {
    description = description;
    wid = wid;
    pid = pid;
    start = start;
    stop = stop;
    duration = duration;
    created_with = created_with;
    tags = tags;
    duronly = duronly;
    billable = billable;
  }
let create_wrapped_time_entry 
  ~time_entry
  () : wrapped_time_entry =
  {
    time_entry = time_entry;
  }
let create_project_request 
  ~wid
  ~name
  ?(billable = false)
  ?(is_private = false)
  ?(active = false)
  ?(auto_estimates = false)
  ?(estimated_hours = false)
  ?(actual_hours = 0)
  ?(template = false)
  ?template_id
  ?cid
  ?color
  ?hex_color
  () : project_request =
  {
    wid = wid;
    name = name;
    billable = billable;
    is_private = is_private;
    active = active;
    auto_estimates = auto_estimates;
    estimated_hours = estimated_hours;
    actual_hours = actual_hours;
    template = template;
    template_id = template_id;
    cid = cid;
    color = color;
    hex_color = hex_color;
  }
let create_wrapped_project_request 
  ~project
  () : wrapped_project_request =
  {
    project = project;
  }
let create_workspace 
  ~id
  ~name
  ~default_currency
  ~at
  ?(premium = false)
  ?(admin = false)
  ?(default_hourly_rate = 0.0)
  ?(only_admins_may_create_projects = false)
  ?(only_admins_see_billable_rates = false)
  ?(only_admins_see_team_dashboard = false)
  ?(projects_billable_by_default = false)
  ?(rounding = 0)
  ?(rounding_minutes = 0)
  ?(ical_enabled = false)
  ?api_token
  ?profile
  ?logo_url
  () : workspace =
  {
    id = id;
    name = name;
    default_currency = default_currency;
    at = at;
    premium = premium;
    admin = admin;
    default_hourly_rate = default_hourly_rate;
    only_admins_may_create_projects = only_admins_may_create_projects;
    only_admins_see_billable_rates = only_admins_see_billable_rates;
    only_admins_see_team_dashboard = only_admins_see_team_dashboard;
    projects_billable_by_default = projects_billable_by_default;
    rounding = rounding;
    rounding_minutes = rounding_minutes;
    ical_enabled = ical_enabled;
    api_token = api_token;
    profile = profile;
    logo_url = logo_url;
  }
let create_time_entry 
  ~id
  ~wid
  ~uid
  ~description
  ~at
  ?pid
  ~start
  ?stop
  ~duration
  ?(tags = [])
  ?(duronly = false)
  ?(billable = false)
  () : time_entry =
  {
    id = id;
    wid = wid;
    uid = uid;
    description = description;
    at = at;
    pid = pid;
    start = start;
    stop = stop;
    duration = duration;
    tags = tags;
    duronly = duronly;
    billable = billable;
  }
let create_project 
  ~id
  ~wid
  ~name
  ~at
  ?created_at
  ?(billable = false)
  ?(is_private = false)
  ?(active = false)
  ?(auto_estimates = false)
  ?(estimated_hours = false)
  ?(actual_hours = 0)
  ?(template = false)
  ?template_id
  ?color
  ?hex_color
  () : project =
  {
    id = id;
    wid = wid;
    name = name;
    at = at;
    created_at = created_at;
    billable = billable;
    is_private = is_private;
    active = active;
    auto_estimates = auto_estimates;
    estimated_hours = estimated_hours;
    actual_hours = actual_hours;
    template = template;
    template_id = template_id;
    color = color;
    hex_color = hex_color;
  }
let create_data_time_entry 
  ~data
  () : data_time_entry =
  {
    data = data;
  }
let create_data_project 
  ~data
  () : data_project =
  {
    data = data;
  }
OCaml

Innovation. Community. Security.