Testing a Gemini codegen run
at main 2.1 kB view raw
1(** JMAP Wire Protocol Structures (Request/Response). *) 2 3open Jmap_types 4open Jmap_error 5 6(** An invocation tuple within a request or response. 7 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.2> RFC 8620, Section 3.2 *) 8module Invocation : sig 9 type t 10 11 val method_name : t -> string 12 val arguments : t -> Yojson.Safe.t 13 val method_call_id : t -> string 14 15 val v : 16 ?arguments:Yojson.Safe.t -> 17 method_name:string -> 18 method_call_id:string -> 19 unit -> 20 t 21end 22 23(** A response invocation part, which can be a standard response or an error. 24 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.4> RFC 8620, Section 3.4 25 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *) 26type response_invocation = 27 | Response of Invocation.t 28 | Error of Method_error.t * string (* string is the method_call_id *) 29 30(** A reference to a previous method call's result. 31 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.7> RFC 8620, Section 3.7 *) 32module Result_reference : sig 33 type t 34 35 val result_of : t -> string 36 val name : t -> string 37 val path : t -> json_pointer 38 39 val v : 40 result_of:string -> 41 name:string -> 42 path:json_pointer -> 43 unit -> 44 t 45end 46 47(** The Request object. 48 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.3> RFC 8620, Section 3.3 *) 49module Request : sig 50 type t 51 52 val using : t -> string list 53 val method_calls : t -> Invocation.t list 54 val created_ids : t -> id id_map option 55 56 val v : 57 using:string list -> 58 method_calls:Invocation.t list -> 59 ?created_ids:id id_map -> 60 unit -> 61 t 62end 63 64(** The Response object. 65 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.4> RFC 8620, Section 3.4 *) 66module Response : sig 67 type t 68 69 val method_responses : t -> response_invocation list 70 val created_ids : t -> id id_map option 71 val session_state : t -> string 72 73 val v : 74 method_responses:response_invocation list -> 75 ?created_ids:id id_map -> 76 session_state:string -> 77 unit -> 78 t 79end