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