aboutsummaryrefslogtreecommitdiff
path: root/lib/models/role_t.ml
diff options
context:
space:
mode:
authorAdelyn Breedlove <[email protected]>2019-01-13 23:52:45 +0000
committerAdelyn Breedlove <[email protected]>2019-01-13 23:52:45 +0000
commitd95f0342f9cf2280b5d9794ab638c16a59c02a69 (patch)
tree191164d198c07cf388d9aae8a54013e5613c272c /lib/models/role_t.ml
parentMerge branch 'dev' into 'master' (diff)
parentAdd deriving sexp to models (diff)
downloaddisml-d95f0342f9cf2280b5d9794ab638c16a59c02a69.tar.xz
disml-d95f0342f9cf2280b5d9794ab638c16a59c02a69.zip
Merge branch 'switch-to-deriving_yojson' into 'master'
Switch to deriving yojson See merge request Mishio595/disml!12
Diffstat (limited to 'lib/models/role_t.ml')
-rw-r--r--lib/models/role_t.ml32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/models/role_t.ml b/lib/models/role_t.ml
new file mode 100644
index 0000000..e41f31d
--- /dev/null
+++ b/lib/models/role_t.ml
@@ -0,0 +1,32 @@
+open Core
+
+type role = {
+ id: Snowflake.t;
+ name: string;
+ colour: int [@key "color"];
+ hoist: bool;
+ position: int;
+ permissions: int;
+ managed: bool;
+ mentionable: bool;
+} [@@deriving sexp, yojson { strict = false}]
+
+type role_update = {
+ role: role;
+ guild_id: Snowflake.t;
+} [@@deriving sexp, yojson { strict = false}]
+
+type t = {
+ id: Snowflake.t;
+ name: string;
+ colour: int [@key "color"];
+ hoist: bool;
+ position: int;
+ permissions: int;
+ managed: bool;
+ mentionable: bool;
+ guild_id: Snowflake.t;
+} [@@deriving sexp, yojson { strict = false}]
+
+let wrap ~guild_id ({id;name;colour;hoist;position;permissions;managed;mentionable}:role) =
+ {id;name;colour;hoist;position;permissions;managed;mentionable;guild_id} \ No newline at end of file