Testing a Gemini codegen run
at main 3.8 kB view raw
1(** JMAP Error Types. *) 2 3open Jmap_types 4 5(** Standard Method-level error types. 6 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *) 7type method_error_type = [ 8 | `ServerUnavailable 9 | `ServerFail 10 | `ServerPartialFail 11 | `UnknownMethod 12 | `InvalidArguments 13 | `InvalidResultReference 14 | `Forbidden 15 | `AccountNotFound 16 | `AccountNotSupportedByMethod 17 | `AccountReadOnly 18 | `RequestTooLarge (* From /get *) 19 | `CannotCalculateChanges (* From /changes, /queryChanges *) 20 | `StateMismatch (* From /set, /copy *) 21 | `AnchorNotFound (* From /query *) 22 | `UnsupportedSort (* From /query *) 23 | `UnsupportedFilter (* From /query *) 24 | `TooManyChanges (* From /queryChanges *) 25 | `FromAccountNotFound (* From /copy, Blob/copy *) 26 | `FromAccountNotSupportedByMethod (* From /copy *) 27 | `Other_method_error of string (* For future or custom errors *) 28] 29 30(** Standard SetError types. 31 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *) 32type set_error_type = [ 33 | `Forbidden 34 | `OverQuota 35 | `TooLarge 36 | `RateLimit 37 | `NotFound 38 | `InvalidPatch 39 | `WillDestroy 40 | `InvalidProperties 41 | `Singleton 42 | `AlreadyExists (* From /copy *) 43 | `MailboxHasChild (* RFC 8621 *) 44 | `MailboxHasEmail (* RFC 8621 *) 45 | `BlobNotFound (* RFC 8621 *) 46 | `TooManyKeywords (* RFC 8621 *) 47 | `TooManyMailboxes (* RFC 8621 *) 48 | `InvalidEmail (* RFC 8621 *) 49 | `TooManyRecipients (* RFC 8621 *) 50 | `NoRecipients (* RFC 8621 *) 51 | `InvalidRecipients (* RFC 8621 *) 52 | `ForbiddenMailFrom (* RFC 8621 *) 53 | `ForbiddenFrom (* RFC 8621 *) 54 | `ForbiddenToSend (* RFC 8621 *) 55 | `CannotUnsend (* RFC 8621 *) 56 | `Other_set_error of string (* For future or custom errors *) 57] 58 59(** Problem details object for HTTP-level errors. 60 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.1> RFC 8620, Section 3.6.1 61 @see <https://www.rfc-editor.org/rfc/rfc7807.html> RFC 7807 *) 62module Problem_details : sig 63 type t 64 65 val problem_type : t -> string 66 val status : t -> int option 67 val detail : t -> string option 68 val limit : t -> string option 69 val other_fields : t -> Yojson.Safe.t string_map 70 71 val v : 72 ?status:int -> 73 ?detail:string -> 74 ?limit:string -> 75 ?other_fields:Yojson.Safe.t string_map -> 76 string -> 77 t 78end 79 80(** Description for method errors. May contain additional details. 81 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *) 82module Method_error_description : sig 83 type t 84 85 val description : t -> string option 86 87 val v : ?description:string -> unit -> t 88end 89 90(** Represents a method-level error response invocation part. 91 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *) 92module Method_error : sig 93 type t 94 95 val type_ : t -> method_error_type 96 val description : t -> Method_error_description.t option 97 98 val v : 99 ?description:Method_error_description.t -> 100 method_error_type -> 101 t 102end 103 104(** SetError object. 105 @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *) 106module Set_error : sig 107 type t 108 109 val type_ : t -> set_error_type 110 val description : t -> string option 111 val properties : t -> string list option 112 val existing_id : t -> id option 113 val max_recipients : t -> uint option 114 val invalid_recipients : t -> string list option 115 val max_size : t -> uint option 116 val not_found_blob_ids : t -> id list option 117 118 val v : 119 ?description:string -> 120 ?properties:string list -> 121 ?existing_id:id -> 122 ?max_recipients:uint -> 123 ?invalid_recipients:string list -> 124 ?max_size:uint -> 125 ?not_found_blob_ids:id list -> 126 set_error_type -> 127 t 128end