From 57df76de6441899b659e30c6a8e9d7572b85f7a0 Mon Sep 17 00:00:00 2001 From: Adelyn Breelove Date: Mon, 17 Dec 2018 13:13:10 -0700 Subject: Some abstractions --- lib/models/gen/role_j.mli | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'lib/models/gen/role_j.mli') diff --git a/lib/models/gen/role_j.mli b/lib/models/gen/role_j.mli index b4ea78c..f908204 100644 --- a/lib/models/gen/role_j.mli +++ b/lib/models/gen/role_j.mli @@ -4,6 +4,18 @@ type snowflake = Snowflake_t.t type t = Role_t.t = { + id: snowflake; + name: string; + colour: int; + hoist: bool; + position: int; + permissions: int; + managed: bool; + mentionable: bool; + guild_id: snowflake +} + +type role = Role_t.role = { id: snowflake; name: string; colour: int; @@ -14,6 +26,8 @@ type t = Role_t.t = { mentionable: bool } +type role_update = Role_t.role_update = { role: role; id: snowflake } + val write_snowflake : Bi_outbuf.t -> snowflake -> unit (** Output a JSON value of type {!snowflake}. *) @@ -54,3 +68,43 @@ val t_of_string : string -> t (** Deserialize JSON data of type {!t}. *) +val write_role : + Bi_outbuf.t -> role -> unit + (** Output a JSON value of type {!role}. *) + +val string_of_role : + ?len:int -> role -> string + (** Serialize a value of type {!role} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_role : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> role + (** Input JSON data of type {!role}. *) + +val role_of_string : + string -> role + (** Deserialize JSON data of type {!role}. *) + +val write_role_update : + Bi_outbuf.t -> role_update -> unit + (** Output a JSON value of type {!role_update}. *) + +val string_of_role_update : + ?len:int -> role_update -> string + (** Serialize a value of type {!role_update} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_role_update : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> role_update + (** Input JSON data of type {!role_update}. *) + +val role_update_of_string : + string -> role_update + (** Deserialize JSON data of type {!role_update}. *) + -- cgit v1.2.3 From 1a73007b3aaa17940173eaff1eb4f6703fd9ec0c Mon Sep 17 00:00:00 2001 From: Adelyn Breelove Date: Wed, 19 Dec 2018 13:44:04 -0700 Subject: Re-arrange autogen serialization files and incorporate into dune file --- lib/models/gen/role_j.mli | 110 ---------------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 lib/models/gen/role_j.mli (limited to 'lib/models/gen/role_j.mli') diff --git a/lib/models/gen/role_j.mli b/lib/models/gen/role_j.mli deleted file mode 100644 index f908204..0000000 --- a/lib/models/gen/role_j.mli +++ /dev/null @@ -1,110 +0,0 @@ -(* Auto-generated from "role.atd" *) -[@@@ocaml.warning "-27-32-35-39"] - -type snowflake = Snowflake_t.t - -type t = Role_t.t = { - id: snowflake; - name: string; - colour: int; - hoist: bool; - position: int; - permissions: int; - managed: bool; - mentionable: bool; - guild_id: snowflake -} - -type role = Role_t.role = { - id: snowflake; - name: string; - colour: int; - hoist: bool; - position: int; - permissions: int; - managed: bool; - mentionable: bool -} - -type role_update = Role_t.role_update = { role: role; id: snowflake } - -val write_snowflake : - Bi_outbuf.t -> snowflake -> unit - (** Output a JSON value of type {!snowflake}. *) - -val string_of_snowflake : - ?len:int -> snowflake -> string - (** Serialize a value of type {!snowflake} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) - -val read_snowflake : - Yojson.Safe.lexer_state -> Lexing.lexbuf -> snowflake - (** Input JSON data of type {!snowflake}. *) - -val snowflake_of_string : - string -> snowflake - (** Deserialize JSON data of type {!snowflake}. *) - -val write_t : - Bi_outbuf.t -> t -> unit - (** Output a JSON value of type {!t}. *) - -val string_of_t : - ?len:int -> t -> string - (** Serialize a value of type {!t} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) - -val read_t : - Yojson.Safe.lexer_state -> Lexing.lexbuf -> t - (** Input JSON data of type {!t}. *) - -val t_of_string : - string -> t - (** Deserialize JSON data of type {!t}. *) - -val write_role : - Bi_outbuf.t -> role -> unit - (** Output a JSON value of type {!role}. *) - -val string_of_role : - ?len:int -> role -> string - (** Serialize a value of type {!role} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) - -val read_role : - Yojson.Safe.lexer_state -> Lexing.lexbuf -> role - (** Input JSON data of type {!role}. *) - -val role_of_string : - string -> role - (** Deserialize JSON data of type {!role}. *) - -val write_role_update : - Bi_outbuf.t -> role_update -> unit - (** Output a JSON value of type {!role_update}. *) - -val string_of_role_update : - ?len:int -> role_update -> string - (** Serialize a value of type {!role_update} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) - -val read_role_update : - Yojson.Safe.lexer_state -> Lexing.lexbuf -> role_update - (** Input JSON data of type {!role_update}. *) - -val role_update_of_string : - string -> role_update - (** Deserialize JSON data of type {!role_update}. *) - -- cgit v1.2.3