···
(** Arguments for /get methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.1> RFC 8620, Section 5.1 *)
+
val account_id : 'record t -> id
+
val ids : 'record t -> id list option
+
val properties : 'record t -> string list option
+
?properties:string list ->
(** Response for /get methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.1> RFC 8620, Section 5.1 *)
+
module Get_response : sig
+
val account_id : 'record t -> id
+
val state : 'record t -> string
+
val list : 'record t -> 'record list
+
val not_found : 'record t -> id list
(** Arguments for /changes methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.2> RFC 8620, Section 5.2 *)
+
module Changes_args : sig
+
val account_id : t -> id
+
val since_state : t -> string
+
val max_changes : t -> uint option
(** Response for /changes methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.2> RFC 8620, Section 5.2 *)
+
module Changes_response : sig
+
val account_id : t -> id
+
val old_state : t -> string
+
val new_state : t -> string
+
val has_more_changes : t -> bool
+
val created : t -> id list
+
val updated : t -> id list
+
val destroyed : t -> id list
+
val updated_properties : t -> string list option
+
has_more_changes:bool ->
+
?updated_properties:string list ->
(** Patch object for /set update.
A list of (JSON Pointer path, value) pairs.
···
['create_record] is the record type without server-set/immutable fields.
['update_record] is the patch object type (usually [patch_object]).
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)
+
type ('create_record, 'update_record) t
+
val account_id : ('a, 'b) t -> id
+
val if_in_state : ('a, 'b) t -> string option
+
val create : ('a, 'b) t -> 'a id_map option
+
val update : ('a, 'b) t -> 'b id_map option
+
val destroy : ('a, 'b) t -> id list option
+
val on_success_destroy_original : ('a, 'b) t -> bool option
+
val destroy_from_if_in_state : ('a, 'b) t -> string option
+
val on_destroy_remove_emails : ('a, 'b) t -> bool option
+
?on_success_destroy_original:bool ->
+
?destroy_from_if_in_state:string ->
+
?on_destroy_remove_emails:bool ->
(** Response for /set methods.
['created_record_info] is the server-set info for created records.
['updated_record_info] is the server-set/computed info for updated records.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)
+
module Set_response : sig
+
type ('created_record_info, 'updated_record_info) t
+
val account_id : ('a, 'b) t -> id
+
val old_state : ('a, 'b) t -> string option
+
val new_state : ('a, 'b) t -> string
+
val created : ('a, 'b) t -> 'a id_map option
+
val updated : ('a, 'b) t -> 'b option id_map option
+
val destroyed : ('a, 'b) t -> id list option
+
val not_created : ('a, 'b) t -> Set_error.t id_map option
+
val not_updated : ('a, 'b) t -> Set_error.t id_map option
+
val not_destroyed : ('a, 'b) t -> Set_error.t id_map option
+
?updated:'b option id_map ->
+
?not_created:Set_error.t id_map ->
+
?not_updated:Set_error.t id_map ->
+
?not_destroyed:Set_error.t id_map ->
(** Arguments for /copy methods.
['copy_record_override] contains the record id and override properties.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.4> RFC 8620, Section 5.4 *)
+
type 'copy_record_override t
+
val from_account_id : 'a t -> id
+
val if_from_in_state : 'a t -> string option
+
val account_id : 'a t -> id
+
val if_in_state : 'a t -> string option
+
val create : 'a t -> 'a id_map
+
val on_success_destroy_original : 'a t -> bool
+
val destroy_from_if_in_state : 'a t -> string option
+
?if_from_in_state:string ->
+
?on_success_destroy_original:bool ->
+
?destroy_from_if_in_state:string ->
(** Response for /copy methods.
['created_record_info] is the server-set info for the created copy.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.4> RFC 8620, Section 5.4 *)
+
module Copy_response : sig
+
type 'created_record_info t
+
val from_account_id : 'a t -> id
+
val account_id : 'a t -> id
+
val old_state : 'a t -> string option
+
val new_state : 'a t -> string
+
val created : 'a t -> 'a id_map option
+
val not_created : 'a t -> Set_error.t id_map option
+
?not_created:Set_error.t id_map ->
+
(** Module for filter types.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)
+
(** Create a filter from a condition (raw JSON) *)
+
val condition : Yojson.Safe.t -> t
+
(** Create a filter from a logical operator and a list of filters *)
+
val operator : [ `AND | `OR | `NOT ] -> t list -> t
(** Comparator for sorting.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)
+
module Comparator : sig
+
val property : t -> string
+
val is_ascending : t -> bool option
+
val collation : t -> string option
+
val keyword : t -> string option
+
val other_fields : t -> Yojson.Safe.t string_map
+
?other_fields:Yojson.Safe.t string_map ->
(** Arguments for /query methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)
+
module Query_args : sig
+
val account_id : t -> id
+
val filter : t -> Filter.t option
+
val sort : t -> Comparator.t list option
+
val position : t -> jint option
+
val anchor : t -> id option
+
val anchor_offset : t -> jint option
+
val limit : t -> uint option
+
val calculate_total : t -> bool option
+
val collapse_threads : t -> bool option
+
val sort_as_tree : t -> bool option
+
val filter_as_tree : t -> bool option
+
?sort:Comparator.t list ->
+
?calculate_total:bool ->
+
?collapse_threads:bool ->
+
?filter_as_tree:bool ->
(** Response for /query methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)
+
module Query_response : sig
+
val account_id : t -> id
+
val query_state : t -> string
+
val can_calculate_changes : t -> bool
+
val position : t -> uint
+
val total : t -> uint option
+
val limit : t -> uint option
+
can_calculate_changes:bool ->
(** Item indicating an added record in /queryChanges.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.6> RFC 8620, Section 5.6 *)
+
module Added_item : sig
(** Arguments for /queryChanges methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.6> RFC 8620, Section 5.6 *)
+
module Query_changes_args : sig
+
val account_id : t -> id
+
val filter : t -> Filter.t option
+
val sort : t -> Comparator.t list option
+
val since_query_state : t -> string
+
val max_changes : t -> uint option
+
val up_to_id : t -> id option
+
val calculate_total : t -> bool option
+
val collapse_threads : t -> bool option
+
?sort:Comparator.t list ->
+
since_query_state:string ->
+
?calculate_total:bool ->
+
?collapse_threads:bool ->
(** Response for /queryChanges methods.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.6> RFC 8620, Section 5.6 *)
+
module Query_changes_response : sig
+
val account_id : t -> id
+
val old_query_state : t -> string
+
val new_query_state : t -> string
+
val total : t -> uint option
+
val removed : t -> id list
+
val added : t -> Added_item.t list
+
old_query_state:string ->
+
new_query_state:string ->
+
added:Added_item.t list ->
(** Core/echo method: Arguments are mirrored in the response.
@see <https://www.rfc-editor.org/rfc/rfc8620.html#section-4> RFC 8620, Section 4 *)