-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiRoles.mli
65 lines (54 loc) · 2.15 KB
/
apiRoles.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
(* ************************************************************************** *)
(* Project: Life - the game, Official OCaml SDK *)
(* Author: nox *)
(* Latest Version is on GitHub: https://github.com/Life-the-game/SDK-OCaml *)
(* ************************************************************************** *)
(** Roles API methods *)
open ApiTypes
(* PRIVATE *)
(* ************************************************************************** *)
(** {3 Type} *)
(* ************************************************************************** *)
module type ROLE =
sig
type t =
| Ambassador
| Admin
| Translator
| Designer
| Newser
val to_string : t -> string
val of_string : string -> t
end
module Role : ROLE
type t =
{
info : Info.t;
role : Role.t;
achievements : ApiAchievement.t list;
lang : string list;
}
(* ************************************************************************** *)
(** {3 API Methods} *)
(* ************************************************************************** *)
(** Get roles *)
val get :
auth : auth
-> id -> t Page.t Api.t
(** Add a role *)
val add :
auth:auth
-> role:Role.t
-> ?achievements:id
-> ?lang:string
-> id -> t Api.t
(** Delete a role *)
val delete :
auth:auth
-> id
-> unit Api.t
(* ************************************************************************** *)
(** {3 Tools} *)
(* ************************************************************************** *)
val from_json : Yojson.Basic.json -> t
(* /PRIVATE *)