Module Collection.Batch

type operation =
  1. | Create of {
    1. if_match : string option;
    2. if_none_match : string option;
    3. body : string;
    }
  2. | Upsert of {
    1. if_match : string option;
    2. if_none_match : string option;
    3. body : string;
    }
  3. | Read of {
    1. id : string;
    2. if_match : string option;
    3. if_none_match : string option;
    }
  4. | Delete of {
    1. id : string;
    2. if_match : string option;
    3. if_none_match : string option;
    }
  5. | Replace of {
    1. id : string;
    2. if_match : string option;
    3. if_none_match : string option;
    4. body : string;
    }
  6. | Patch of {
    1. id : string;
    2. if_match : string option;
    3. patch_op : patch_operation;
    }
and patch_operation =
  1. | Add of {
    1. path : string;
    2. value : string;
    }
  2. | Set of {
    1. path : string;
    2. value : string;
    }
  3. | ReplacePath of {
    1. path : string;
    2. value : string;
    }
  4. | Remove of {
    1. path : string;
    }
  5. | Increment of {
    1. path : string;
    2. value : int;
    }
type operation_result = {
  1. status_code : int;
  2. request_charge : float;
  3. etag : string option;
  4. resource_body : string option;
}
type batch_result = {
  1. outcomes : operation_result list;
  2. total_request_charge : float;
}
type validation_error = batch_validation_error =
  1. | Too_many_operations of int
  2. | Mixed_patch_operations
  3. | Empty_batch
val validate : operation list -> (unit, validation_error) Stdlib.result
val execute : ?timeout:float -> ?atomic:bool -> ?should_validate:bool -> partition_key:string -> string -> string -> operation list -> (batch_result, cosmos_error) Stdlib.result io