This repository has no description
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6(** Identity type as defined in RFC 8621 Section 6
7
8 @canonical Jmap.Proto.Identity *)
9
10(** {1 Identity Properties}
11
12 Polymorphic variants for type-safe property selection in Identity/get requests.
13 These correspond to the properties defined in RFC 8621 Section 6. *)
14
15(** All Identity properties that can be requested. *)
16type property = [
17 | `Id
18 | `Name
19 | `Email
20 | `Reply_to
21 | `Bcc
22 | `Text_signature
23 | `Html_signature
24 | `May_delete
25]
26
27val property_to_string : [< property ] -> string
28(** Convert a property to its wire name (e.g., [`Text_signature] -> "textSignature"). *)
29
30val property_of_string : string -> property option
31(** Parse a property name, case-sensitive. *)
32
33(** {1 Identity Object} *)
34
35type t = {
36 id : Proto_id.t option;
37 (** Server-assigned identity id. *)
38 name : string option;
39 (** Display name for sent emails. *)
40 email : string option;
41 (** The email address to use. *)
42 reply_to : Mail_address.t list option;
43 (** Default Reply-To addresses. *)
44 bcc : Mail_address.t list option;
45 (** Default BCC addresses. *)
46 text_signature : string option;
47 (** Plain text signature. *)
48 html_signature : string option;
49 (** HTML signature. *)
50 may_delete : bool option;
51 (** Whether the user may delete this identity. *)
52}
53
54val id : t -> Proto_id.t option
55val name : t -> string option
56val email : t -> string option
57val reply_to : t -> Mail_address.t list option
58val bcc : t -> Mail_address.t list option
59val text_signature : t -> string option
60val html_signature : t -> string option
61val may_delete : t -> bool option
62
63val jsont : t Jsont.t