(** JMAP Standard Method Types *) (** Standard /get method (RFC 8620 Section 5.1) *) module Get : sig type 'a request = { account_id : Jmap_id.t; ids : Jmap_id.t list option; properties : string list option; } type 'a response = { account_id : Jmap_id.t; state : string; list : 'a list; not_found : Jmap_id.t list; } (** Accessors for request *) val account_id : 'a request -> Jmap_id.t val ids : 'a request -> Jmap_id.t list option val properties : 'a request -> string list option (** Constructor for request *) val v : account_id:Jmap_id.t -> ?ids:Jmap_id.t list -> ?properties:string list -> unit -> 'a request (** Accessors for response *) val response_account_id : 'a response -> Jmap_id.t val state : 'a response -> string val list : 'a response -> 'a list val not_found : 'a response -> Jmap_id.t list (** Constructor for response *) val response_v : account_id:Jmap_id.t -> state:string -> list:'a list -> not_found:Jmap_id.t list -> 'a response (** Convert request to JSON *) val request_to_json : 'a request -> Ezjsonm.value (** Parse request from JSON *) val request_of_json : (Ezjsonm.value -> 'a) -> Ezjsonm.value -> 'a request (** Parse response from JSON *) val response_of_json : (Ezjsonm.value -> 'a) -> Ezjsonm.value -> 'a response end (** Standard /changes method (RFC 8620 Section 5.2) *) module Changes : sig type request = { account_id : Jmap_id.t; since_state : string; max_changes : Jmap_primitives.UnsignedInt.t option; } type response = { account_id : Jmap_id.t; old_state : string; new_state : string; has_more_changes : bool; created : Jmap_id.t list; updated : Jmap_id.t list; destroyed : Jmap_id.t list; } (** Accessors for request *) val account_id : request -> Jmap_id.t val since_state : request -> string val max_changes : request -> Jmap_primitives.UnsignedInt.t option (** Constructor for request *) val v : account_id:Jmap_id.t -> since_state:string -> ?max_changes:Jmap_primitives.UnsignedInt.t -> unit -> request (** Accessors for response *) val response_account_id : response -> Jmap_id.t val old_state : response -> string val new_state : response -> string val has_more_changes : response -> bool val created : response -> Jmap_id.t list val updated : response -> Jmap_id.t list val destroyed : response -> Jmap_id.t list (** Constructor for response *) val response_v : account_id:Jmap_id.t -> old_state:string -> new_state:string -> has_more_changes:bool -> created:Jmap_id.t list -> updated:Jmap_id.t list -> destroyed:Jmap_id.t list -> response (** Parse request from JSON *) val request_of_json : Ezjsonm.value -> request (** Parse response from JSON *) val response_of_json : Ezjsonm.value -> response end (** Standard /set method (RFC 8620 Section 5.3) *) module Set : sig (** PatchObject - JSON Pointer paths to values *) type patch_object = (string * Ezjsonm.value option) list type 'a request = { account_id : Jmap_id.t; if_in_state : string option; create : (Jmap_id.t * 'a) list option; update : (Jmap_id.t * patch_object) list option; destroy : Jmap_id.t list option; } type 'a response = { account_id : Jmap_id.t; old_state : string option; new_state : string; created : (Jmap_id.t * 'a) list option; updated : (Jmap_id.t * 'a option) list option; destroyed : Jmap_id.t list option; not_created : (Jmap_id.t * Jmap_error.set_error_detail) list option; not_updated : (Jmap_id.t * Jmap_error.set_error_detail) list option; not_destroyed : (Jmap_id.t * Jmap_error.set_error_detail) list option; } (** Accessors for request *) val account_id : 'a request -> Jmap_id.t val if_in_state : 'a request -> string option val create : 'a request -> (Jmap_id.t * 'a) list option val update : 'a request -> (Jmap_id.t * patch_object) list option val destroy : 'a request -> Jmap_id.t list option (** Constructor for request *) val v : account_id:Jmap_id.t -> ?if_in_state:string -> ?create:(Jmap_id.t * 'a) list -> ?update:(Jmap_id.t * patch_object) list -> ?destroy:Jmap_id.t list -> unit -> 'a request (** Accessors for response *) val response_account_id : 'a response -> Jmap_id.t val old_state : 'a response -> string option val new_state : 'a response -> string val created : 'a response -> (Jmap_id.t * 'a) list option val updated : 'a response -> (Jmap_id.t * 'a option) list option val destroyed : 'a response -> Jmap_id.t list option val not_created : 'a response -> (Jmap_id.t * Jmap_error.set_error_detail) list option val not_updated : 'a response -> (Jmap_id.t * Jmap_error.set_error_detail) list option val not_destroyed : 'a response -> (Jmap_id.t * Jmap_error.set_error_detail) list option (** Constructor for response *) val response_v : account_id:Jmap_id.t -> ?old_state:string -> new_state:string -> ?created:(Jmap_id.t * 'a) list -> ?updated:(Jmap_id.t * 'a option) list -> ?destroyed:Jmap_id.t list -> ?not_created:(Jmap_id.t * Jmap_error.set_error_detail) list -> ?not_updated:(Jmap_id.t * Jmap_error.set_error_detail) list -> ?not_destroyed:(Jmap_id.t * Jmap_error.set_error_detail) list -> unit -> 'a response (** Parse request from JSON *) val request_of_json : (Ezjsonm.value -> 'a) -> Ezjsonm.value -> 'a request (** Parse response from JSON *) val response_of_json : (Ezjsonm.value -> 'a) -> Ezjsonm.value -> 'a response end (** Standard /copy method (RFC 8620 Section 5.4) *) module Copy : sig type 'a request = { from_account_id : Jmap_id.t; if_from_in_state : string option; account_id : Jmap_id.t; if_in_state : string option; create : (Jmap_id.t * 'a) list; on_success_destroy_original : bool option; destroy_from_if_in_state : string option; } type 'a response = { from_account_id : Jmap_id.t; account_id : Jmap_id.t; old_state : string option; new_state : string; created : (Jmap_id.t * 'a) list option; not_created : (Jmap_id.t * Jmap_error.set_error_detail) list option; } (** Accessors for request *) val from_account_id : 'a request -> Jmap_id.t val if_from_in_state : 'a request -> string option val account_id : 'a request -> Jmap_id.t val if_in_state : 'a request -> string option val create : 'a request -> (Jmap_id.t * 'a) list val on_success_destroy_original : 'a request -> bool option val destroy_from_if_in_state : 'a request -> string option (** Constructor for request *) val v : from_account_id:Jmap_id.t -> ?if_from_in_state:string -> account_id:Jmap_id.t -> ?if_in_state:string -> create:(Jmap_id.t * 'a) list -> ?on_success_destroy_original:bool -> ?destroy_from_if_in_state:string -> unit -> 'a request (** Accessors for response *) val response_from_account_id : 'a response -> Jmap_id.t val response_account_id : 'a response -> Jmap_id.t val old_state : 'a response -> string option val new_state : 'a response -> string val created : 'a response -> (Jmap_id.t * 'a) list option val not_created : 'a response -> (Jmap_id.t * Jmap_error.set_error_detail) list option (** Constructor for response *) val response_v : from_account_id:Jmap_id.t -> account_id:Jmap_id.t -> ?old_state:string -> new_state:string -> ?created:(Jmap_id.t * 'a) list -> ?not_created:(Jmap_id.t * Jmap_error.set_error_detail) list -> unit -> 'a response (** Parse request from JSON *) val request_of_json : (Ezjsonm.value -> 'a) -> Ezjsonm.value -> 'a request (** Parse response from JSON *) val response_of_json : (Ezjsonm.value -> 'a) -> Ezjsonm.value -> 'a response end (** Standard /query method (RFC 8620 Section 5.5) *) module Query : sig type 'filter request = { account_id : Jmap_id.t; filter : 'filter Jmap_filter.t option; sort : Jmap_comparator.t list option; position : Jmap_primitives.Int53.t option; anchor : Jmap_id.t option; anchor_offset : Jmap_primitives.Int53.t option; limit : Jmap_primitives.UnsignedInt.t option; calculate_total : bool option; } type response = { account_id : Jmap_id.t; query_state : string; can_calculate_changes : bool; position : Jmap_primitives.UnsignedInt.t; ids : Jmap_id.t list; total : Jmap_primitives.UnsignedInt.t option; limit : Jmap_primitives.UnsignedInt.t option; } (** Accessors for request *) val account_id : 'filter request -> Jmap_id.t val filter : 'filter request -> 'filter Jmap_filter.t option val sort : 'filter request -> Jmap_comparator.t list option val position : 'filter request -> Jmap_primitives.Int53.t option val anchor : 'filter request -> Jmap_id.t option val anchor_offset : 'filter request -> Jmap_primitives.Int53.t option val limit : 'filter request -> Jmap_primitives.UnsignedInt.t option val calculate_total : 'filter request -> bool option (** Constructor for request *) val v : account_id:Jmap_id.t -> ?filter:'filter Jmap_filter.t -> ?sort:Jmap_comparator.t list -> ?position:Jmap_primitives.Int53.t -> ?anchor:Jmap_id.t -> ?anchor_offset:Jmap_primitives.Int53.t -> ?limit:Jmap_primitives.UnsignedInt.t -> ?calculate_total:bool -> unit -> 'filter request (** Accessors for response *) val response_account_id : response -> Jmap_id.t val query_state : response -> string val can_calculate_changes : response -> bool val response_position : response -> Jmap_primitives.UnsignedInt.t val ids : response -> Jmap_id.t list val total : response -> Jmap_primitives.UnsignedInt.t option val response_limit : response -> Jmap_primitives.UnsignedInt.t option (** Constructor for response *) val response_v : account_id:Jmap_id.t -> query_state:string -> can_calculate_changes:bool -> position:Jmap_primitives.UnsignedInt.t -> ids:Jmap_id.t list -> ?total:Jmap_primitives.UnsignedInt.t -> ?limit:Jmap_primitives.UnsignedInt.t -> unit -> response (** Parse request from JSON *) val request_of_json : (Ezjsonm.value -> 'filter) -> Ezjsonm.value -> 'filter request (** Parse response from JSON *) val response_of_json : Ezjsonm.value -> response end (** Standard /queryChanges method (RFC 8620 Section 5.6) *) module QueryChanges : sig (** Item added to query results *) type added_item = { id : Jmap_id.t; index : Jmap_primitives.UnsignedInt.t; } type 'filter request = { account_id : Jmap_id.t; filter : 'filter Jmap_filter.t option; sort : Jmap_comparator.t list option; since_query_state : string; max_changes : Jmap_primitives.UnsignedInt.t option; up_to_id : Jmap_id.t option; calculate_total : bool option; } type response = { account_id : Jmap_id.t; old_query_state : string; new_query_state : string; total : Jmap_primitives.UnsignedInt.t option; removed : Jmap_id.t list; added : added_item list; } (** Accessors for added_item *) val added_item_id : added_item -> Jmap_id.t val added_item_index : added_item -> Jmap_primitives.UnsignedInt.t (** Constructor for added_item *) val added_item_v : id:Jmap_id.t -> index:Jmap_primitives.UnsignedInt.t -> added_item (** Accessors for request *) val account_id : 'filter request -> Jmap_id.t val filter : 'filter request -> 'filter Jmap_filter.t option val sort : 'filter request -> Jmap_comparator.t list option val since_query_state : 'filter request -> string val max_changes : 'filter request -> Jmap_primitives.UnsignedInt.t option val up_to_id : 'filter request -> Jmap_id.t option val calculate_total : 'filter request -> bool option (** Constructor for request *) val v : account_id:Jmap_id.t -> ?filter:'filter Jmap_filter.t -> ?sort:Jmap_comparator.t list -> since_query_state:string -> ?max_changes:Jmap_primitives.UnsignedInt.t -> ?up_to_id:Jmap_id.t -> ?calculate_total:bool -> unit -> 'filter request (** Accessors for response *) val response_account_id : response -> Jmap_id.t val old_query_state : response -> string val new_query_state : response -> string val total : response -> Jmap_primitives.UnsignedInt.t option val removed : response -> Jmap_id.t list val added : response -> added_item list (** Constructor for response *) val response_v : account_id:Jmap_id.t -> old_query_state:string -> new_query_state:string -> ?total:Jmap_primitives.UnsignedInt.t -> removed:Jmap_id.t list -> added:added_item list -> unit -> response (** Parse request from JSON *) val request_of_json : (Ezjsonm.value -> 'filter) -> Ezjsonm.value -> 'filter request (** Parse response from JSON *) val response_of_json : Ezjsonm.value -> response end (** Core/echo method (RFC 8620 Section 7.3) *) module Echo : sig (** Echo simply returns the arguments unchanged *) type t = Ezjsonm.value val of_json : Ezjsonm.value -> t val to_json : t -> Ezjsonm.value end