Testing a Gemini codegen run
1(** JMAP Mailbox.
2 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)
3
4open Jmap_types
5open Jmap_methods
6
7(** Mailbox access rights.
8 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)
9type mailbox_rights = {
10 may_read_items : bool;
11 may_add_items : bool;
12 may_remove_items : bool;
13 may_set_seen : bool;
14 may_set_keywords : bool;
15 may_create_child : bool;
16 may_rename : bool;
17 may_delete : bool;
18 may_submit : bool;
19}
20
21(** Mailbox object.
22 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)
23type mailbox = {
24 mailbox_id : id; (** immutable, server-set *)
25 name : string;
26 parent_id : id option;
27 role : string option;
28 sort_order : uint; (* default: 0 *)
29 total_emails : uint; (** server-set *)
30 unread_emails : uint; (** server-set *)
31 total_threads : uint; (** server-set *)
32 unread_threads : uint; (** server-set *)
33 my_rights : mailbox_rights; (** server-set *)
34 is_subscribed : bool;
35}
36
37(** Mailbox object for creation.
38 Excludes server-set fields.
39 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)
40type mailbox_create = {
41 mailbox_create_name : string;
42 mailbox_create_parent_id : id option;
43 mailbox_create_role : string option;
44 mailbox_create_sort_order : uint option;
45 mailbox_create_is_subscribed : bool option;
46}
47
48(** Mailbox object for update.
49 Patch object, specific structure not enforced here.
50 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5> RFC 8621, Section 2.5 *)
51type mailbox_update = patch_object
52
53(** Server-set info for created mailbox.
54 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5> RFC 8621, Section 2.5 *)
55type mailbox_created_info = {
56 mailbox_created_id : id;
57 mailbox_created_role : string option; (** If default used *)
58 mailbox_created_sort_order : uint; (** If default used *)
59 mailbox_created_total_emails : uint;
60 mailbox_created_unread_emails : uint;
61 mailbox_created_total_threads : uint;
62 mailbox_created_unread_threads : uint;
63 mailbox_created_my_rights : mailbox_rights;
64 mailbox_created_is_subscribed : bool; (** If default used *)
65}
66
67(** Server-set/computed info for updated mailbox.
68 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5> RFC 8621, Section 2.5 *)
69type mailbox_updated_info = mailbox (* Contains only changed server-set props *)
70
71(** FilterCondition for Mailbox/query.
72 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.3> RFC 8621, Section 2.3 *)
73type mailbox_filter_condition = {
74 filter_parent_id : id option option; (* Use option option for explicit null *)
75 filter_name : string option;
76 filter_role : string option option; (* Use option option for explicit null *)
77 filter_has_any_role : bool option;
78 filter_is_subscribed : bool option;
79}
80
81(** Mailbox/get: Args type (specialized from ['record Get_args.t]). *)
82module Mailbox_get_args : sig
83 type t = mailbox Get_args.t
84end
85
86(** Mailbox/get: Response type (specialized from ['record Get_response.t]). *)
87module Mailbox_get_response : sig
88 type t = mailbox Get_response.t
89end
90
91(** Mailbox/changes: Args type (specialized from [Changes_args.t]). *)
92module Mailbox_changes_args : sig
93 type t = Changes_args.t
94end
95
96(** Mailbox/changes: Response type (specialized from [Changes_response.t]). *)
97module Mailbox_changes_response : sig
98 type t = Changes_response.t
99end
100
101(** Mailbox/query: Args type (specialized from [Query_args.t]). *)
102module Mailbox_query_args : sig
103 type t = Query_args.t
104end
105
106(** Mailbox/query: Response type (specialized from [Query_response.t]). *)
107module Mailbox_query_response : sig
108 type t = Query_response.t
109end
110
111(** Mailbox/queryChanges: Args type (specialized from [Query_changes_args.t]). *)
112module Mailbox_query_changes_args : sig
113 type t = Query_changes_args.t
114end
115
116(** Mailbox/queryChanges: Response type (specialized from [Query_changes_response.t]). *)
117module Mailbox_query_changes_response : sig
118 type t = Query_changes_response.t
119end
120
121(** Mailbox/set: Args type (specialized from [('c, 'u) Set_args.t]). *)
122module Mailbox_set_args : sig
123 type t = (mailbox_create, mailbox_update) Set_args.t
124end
125
126(** Mailbox/set: Response type (specialized from [('c, 'u) Set_response.t]). *)
127module Mailbox_set_response : sig
128 type t = (mailbox_created_info, mailbox_updated_info) Set_response.t
129end