-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiFeed.ml
42 lines (37 loc) · 1.61 KB
/
apiFeed.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
(* ************************************************************************** *)
(* Project: Life - the game, Official OCaml SDK *)
(* Author: db0 ([email protected], http://db0.fr/) *)
(* Latest Version is on GitHub: https://github.com/Life-the-game/SDK-OCaml *)
(* ************************************************************************** *)
open ApiTypes
(* ************************************************************************** *)
(* API Methods *)
(* ************************************************************************** *)
(* ************************************************************************** *)
(* Get feed *)
(* ************************************************************************** *)
let get ~auth ?(page = Page.default_parameters) ?(activity_type = [])
(* PRIVATE *)
?(user = None)
(* /PRIVATE *)
() =
Api.go
~path:(
(* PRIVATE *)
(match user with
| Some user_id -> ["users"; user_id]
| None -> ["users"; "self"]) @
(* /PRIVATE *)
["feed"])
~req:(Some (Auth auth))
~page:(Some page)
~get:(Network.empty_filter
[("type", Network.list_parameter activity_type)])
(Page.from_json (ApiPlayground.from_json ~req:(Auth auth)))
let global ?(auth = None) ?(page = Page.default_parameters) () =
let req = Auto (auth, Lang.default) in
Api.go
~path:["feed"]
~req:(Some req)
~page:(Some page)
(Page.from_json (ApiPlayground.from_json ~req:req))