aboutsummaryrefslogtreecommitdiff
path: root/lib/models/guild
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-02-04 13:59:23 -0700
committerAdelyn Breelove <[email protected]>2019-02-04 13:59:23 -0700
commit23cc7c6ea03ac6ad92c8da3101eb878daeb3bc2e (patch)
tree42441f45c99e8bfaeabf4cd2083d4e375c41d92e /lib/models/guild
parentUpdate yojson to 1.6.0 (diff)
downloaddisml-23cc7c6ea03ac6ad92c8da3101eb878daeb3bc2e.tar.xz
disml-23cc7c6ea03ac6ad92c8da3101eb878daeb3bc2e.zip
Update to latest master on ppx_deriving_yojson
Diffstat (limited to 'lib/models/guild')
-rw-r--r--lib/models/guild/ban_t.ml2
-rw-r--r--lib/models/guild/ban_t.mli2
-rw-r--r--lib/models/guild/guild_t.ml6
-rw-r--r--lib/models/guild/guild_t.mli6
-rw-r--r--lib/models/guild/member_t.ml10
-rw-r--r--lib/models/guild/member_t.mli10
-rw-r--r--lib/models/guild/role_t.ml4
-rw-r--r--lib/models/guild/role_t.mli4
8 files changed, 22 insertions, 22 deletions
diff --git a/lib/models/guild/ban_t.ml b/lib/models/guild/ban_t.ml
index 7923b58..2ebc91d 100644
--- a/lib/models/guild/ban_t.ml
+++ b/lib/models/guild/ban_t.ml
@@ -3,4 +3,4 @@ open Core
type t = {
reason: string option [@default None];
user: User_t.t;
-} [@@deriving sexp, yojson { strict = false}] \ No newline at end of file
+} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
diff --git a/lib/models/guild/ban_t.mli b/lib/models/guild/ban_t.mli
index 37e5cfa..63d8ca8 100644
--- a/lib/models/guild/ban_t.mli
+++ b/lib/models/guild/ban_t.mli
@@ -1,4 +1,4 @@
type t = {
reason: string option; (** The reason for the ban. *)
user: User_t.t; (** The banned user. *)
-} [@@deriving sexp, yojson] \ No newline at end of file
+} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file
diff --git a/lib/models/guild/guild_t.ml b/lib/models/guild/guild_t.ml
index 9ad7cb9..fa9673a 100644
--- a/lib/models/guild/guild_t.ml
+++ b/lib/models/guild/guild_t.ml
@@ -2,7 +2,7 @@ open Core
type unavailable = {
id: Guild_id_t.t;
-} [@@deriving sexp, yojson { strict = false }]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type pre = {
id: Guild_id_t.t;
@@ -31,7 +31,7 @@ type pre = {
member_count: int option [@default None];
members: Member_t.member list;
channels: Channel_t.channel_wrapper list;
-} [@@deriving sexp, yojson { strict = false }]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type t = {
id: Guild_id_t.t;
@@ -60,7 +60,7 @@ type t = {
member_count: int option [@default None];
members: Member_t.t list;
channels: Channel_t.t list;
-} [@@deriving sexp, yojson { strict = false }]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
let wrap ({id;name;icon;splash;owner_id;region;afk_channel_id;afk_timeout;embed_enabled;embed_channel_id;verification_level;default_message_notifications;explicit_content_filter;roles;emojis;features;mfa_level;application_id;widget_enabled;widget_channel_id;system_channel_id;large;unavailable;member_count;members;channels}:pre) =
let `Guild_id id = id in
diff --git a/lib/models/guild/guild_t.mli b/lib/models/guild/guild_t.mli
index 7296372..89cf9a2 100644
--- a/lib/models/guild/guild_t.mli
+++ b/lib/models/guild/guild_t.mli
@@ -1,6 +1,6 @@
type unavailable = {
id: Guild_id_t.t;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** Used internally. *)
type pre = {
@@ -30,7 +30,7 @@ type pre = {
member_count: int option;
members: Member_t.member list;
channels: Channel_t.channel_wrapper list;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** A Guild object *)
type t = {
@@ -60,7 +60,7 @@ type t = {
member_count: int option; (** Total number of members in the guild. *)
members: Member_t.t list; (** List of guild members. *)
channels: Channel_t.t list; (** List of guild channels. *)
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
val wrap : pre -> t
val get_id : t -> Snowflake.t \ No newline at end of file
diff --git a/lib/models/guild/member_t.ml b/lib/models/guild/member_t.ml
index ae6b894..4e01b9a 100644
--- a/lib/models/guild/member_t.ml
+++ b/lib/models/guild/member_t.ml
@@ -6,7 +6,7 @@ type partial_member = {
joined_at: string;
deaf: bool;
mute: bool;
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type member = {
nick: string option [@default None];
@@ -15,19 +15,19 @@ type member = {
deaf: bool;
mute: bool;
user: User_t.t;
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type member_wrapper = {
guild_id: Guild_id_t.t;
user: User_t.t;
-} [@@deriving sexp, yojson { strict = false }]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type member_update = {
guild_id: Guild_id_t.t;
roles: Role_id.t list [@default []];
user: User_t.t;
nick: string option [@default None];
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type t = {
nick: string option [@default None];
@@ -37,7 +37,7 @@ type t = {
mute: bool;
user: User_t.t;
guild_id: Guild_id_t.t;
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
let wrap ~guild_id ({nick;roles;joined_at;deaf;mute;user}:member) =
{nick;roles;joined_at;deaf;mute;user;guild_id = `Guild_id guild_id} \ No newline at end of file
diff --git a/lib/models/guild/member_t.mli b/lib/models/guild/member_t.mli
index 170504f..abfc1af 100644
--- a/lib/models/guild/member_t.mli
+++ b/lib/models/guild/member_t.mli
@@ -4,7 +4,7 @@ type partial_member = {
joined_at: string;
deaf: bool;
mute: bool;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type member = {
nick: string option;
@@ -13,19 +13,19 @@ type member = {
deaf: bool;
mute: bool;
user: User_t.t;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type member_wrapper = {
guild_id: Guild_id_t.t;
user: User_t.t;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type member_update = {
guild_id: Guild_id_t.t;
roles: Role_id.t list;
user: User_t.t;
nick: string option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** A member object. *)
type t = {
@@ -36,6 +36,6 @@ type t = {
mute: bool; (** Whether the user is muted. *)
user: User_t.t; (** The underlying user object for the member. *)
guild_id: Guild_id_t.t; (** The guild ID in which the member exists. *)
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
val wrap : guild_id:Snowflake.t -> member -> t \ No newline at end of file
diff --git a/lib/models/guild/role_t.ml b/lib/models/guild/role_t.ml
index cc461f3..d518b13 100644
--- a/lib/models/guild/role_t.ml
+++ b/lib/models/guild/role_t.ml
@@ -9,7 +9,7 @@ type role = {
permissions: int;
managed: bool;
mentionable: bool;
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type t = {
id: Role_id.t;
@@ -21,7 +21,7 @@ type t = {
managed: bool;
mentionable: bool;
guild_id: Guild_id_t.t;
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
let wrap ~guild_id ({id;name;colour;hoist;position;permissions;managed;mentionable}:role) =
{id;name;colour;hoist;position;permissions;managed;mentionable;guild_id = `Guild_id guild_id} \ No newline at end of file
diff --git a/lib/models/guild/role_t.mli b/lib/models/guild/role_t.mli
index 1b69e25..d9caf7a 100644
--- a/lib/models/guild/role_t.mli
+++ b/lib/models/guild/role_t.mli
@@ -8,7 +8,7 @@ type role = {
permissions: int;
managed: bool;
mentionable: bool;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** A role object. *)
type t = {
@@ -21,7 +21,7 @@ type t = {
managed: bool; (** Whether the guild is managed by an integration. *)
mentionable: bool; (** Whether the role can be mentioned. *)
guild_id: Guild_id_t.t; (** The guild ID this role belongs to. *)
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** Convenience method to produce {!t} from {!role} and a snowflake. *)
val wrap : guild_id:Snowflake.t -> role -> t \ No newline at end of file