(** JMAP Email/parse method implementation as defined in RFC 8621 Section 4.9. The Email/parse method allows parsing blobs as messages (RFC 5322) to get Email objects. This can be used to parse and display attached messages without importing them as top-level Email objects. Note: The following metadata properties will be null if requested: - id, mailboxIds, keywords, receivedAt @see RFC 8621, Section 4.9 *) (** {1 Email/parse Arguments} *) (** Arguments for Email/parse method calls. @see RFC 8621, Section 4.9 *) module Parse_args : sig type t (** Create Email/parse arguments. @param account_id The account ID to use @param blob_ids Array of blob IDs to parse @param ?properties Optional list of properties to return for each Email (defaults to standard set) @param ?body_properties Optional list of properties to fetch for each EmailBodyPart @param ?fetch_text_body_values Whether to include text/* parts in bodyValues (default: false) @param ?fetch_html_body_values Whether to include HTML parts in bodyValues (default: false) @param ?fetch_all_body_values Whether to include all text/* parts in bodyValues (default: false) @param ?max_body_value_bytes Maximum bytes for bodyValues (0 = no limit, default: 0) @return Email/parse arguments object *) val create : account_id:string -> blob_ids:Jmap.Id.t list -> ?properties:string list -> ?body_properties:string list -> ?fetch_text_body_values:bool -> ?fetch_html_body_values:bool -> ?fetch_all_body_values:bool -> ?max_body_value_bytes:int -> unit -> t (** Get the account ID. @return The account ID for this request *) val account_id : t -> string (** Get the blob IDs to parse. @return List of blob IDs to parse *) val blob_ids : t -> Jmap.Id.t list (** Get the properties list. @return List of properties to return, or None for default *) val properties : t -> string list option (** Get the body properties list. @return List of body properties to fetch, or None for default *) val body_properties : t -> string list option (** Get fetch text body values flag. @return Whether to include text body values *) val fetch_text_body_values : t -> bool (** Get fetch HTML body values flag. @return Whether to include HTML body values *) val fetch_html_body_values : t -> bool (** Get fetch all body values flag. @return Whether to include all body values *) val fetch_all_body_values : t -> bool (** Get max body value bytes limit. @return Maximum bytes for body values (0 = no limit) *) val max_body_value_bytes : t -> int (** JSON serialization for Email/parse arguments *) include Jmap_sigs.JSONABLE with type t := t end (** {1 Email/parse Response} *) (** Response for Email/parse method calls. @see RFC 8621, Section 4.9 *) module Parse_response : sig type response (** Create an Email/parse response. @param account_id The account ID used for the call @param ?parsed Optional map of blob IDs to successfully parsed Email objects @param ?not_parsable Optional list of blob IDs that could not be parsed @param ?not_found Optional list of blob IDs that could not be found @return Email/parse response object *) val create : account_id:string -> ?parsed:(Jmap.Id.t * Yojson.Safe.t) list -> (* Using Yojson.Safe.t for Email objects for now *) ?not_parsable:Jmap.Id.t list -> ?not_found:Jmap.Id.t list -> unit -> response (** Get the account ID. @return The account ID used for the call *) val account_id : response -> string (** Get the parsed emails. @return Map of blob IDs to successfully parsed Email objects, or empty list if none *) val parsed : response -> (Jmap.Id.t * Yojson.Safe.t) list (** Get the not parsable blob IDs. @return List of blob IDs that could not be parsed, or empty list if none *) val not_parsable : response -> Jmap.Id.t list (** Get the not found blob IDs. @return List of blob IDs that could not be found, or empty list if none *) val not_found : response -> Jmap.Id.t list (** JSON serialization for Email/parse responses *) include Jmap_sigs.JSONABLE with type t := response end