From 73d115ce6260e97f5f7ee47f743d842ffd292662 Mon Sep 17 00:00:00 2001 From: Adelyn Breelove Date: Thu, 13 Dec 2018 14:11:54 -0700 Subject: Working on deriving types from json --- lib/models/user_j.mli | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lib/models/user_j.mli (limited to 'lib/models/user_j.mli') diff --git a/lib/models/user_j.mli b/lib/models/user_j.mli new file mode 100644 index 0000000..0a1c6e1 --- /dev/null +++ b/lib/models/user_j.mli @@ -0,0 +1,53 @@ +(* Auto-generated from "user.atd" *) +[@@@ocaml.warning "-27-32-35-39"] + +type snowflake = Snowflake_t.t + +type t = User_t.t = { + id: snowflake; + username: string; + discriminator: string; + avatar: string option; + bot: bool +} + +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}. *) + -- cgit v1.2.3 From 179d9598fe62e2966471b312fd438e98ff3a272a Mon Sep 17 00:00:00 2001 From: Adelyn Breelove Date: Thu, 13 Dec 2018 15:50:37 -0700 Subject: Fix more dispatch issues --- lib/models/user_j.mli | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/models/user_j.mli') diff --git a/lib/models/user_j.mli b/lib/models/user_j.mli index 0a1c6e1..576768e 100644 --- a/lib/models/user_j.mli +++ b/lib/models/user_j.mli @@ -11,6 +11,8 @@ type t = User_t.t = { bot: bool } +type partial_user = User_t.partial_user = { id: snowflake } + val write_snowflake : Bi_outbuf.t -> snowflake -> unit (** Output a JSON value of type {!snowflake}. *) @@ -51,3 +53,23 @@ val t_of_string : string -> t (** Deserialize JSON data of type {!t}. *) +val write_partial_user : + Bi_outbuf.t -> partial_user -> unit + (** Output a JSON value of type {!partial_user}. *) + +val string_of_partial_user : + ?len:int -> partial_user -> string + (** Serialize a value of type {!partial_user} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_partial_user : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> partial_user + (** Input JSON data of type {!partial_user}. *) + +val partial_user_of_string : + string -> partial_user + (** Deserialize JSON data of type {!partial_user}. *) + -- cgit v1.2.3