My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Complete OpenAPI generator with typed responses and nullable fields

Major enhancements to the OpenAPI code generator:

1. allOf composition support:
- Added resolve_schema_ref to look up referenced schemas
- Added flatten_all_of to recursively merge properties from composed schemas
- Added expand_schema to resolve allOf before generating types
- VideoDetails now contains all 50+ fields from Video merged in

2. Property type reference resolution:
- Updated type_of_json_schema to handle allOf with $ref in properties
- Properties like "id: allOf: [$ref: '#/components/schemas/id']" now
resolve to the correct type

3. Nullable field handling:
- Added is_nullable tracking to field_info
- Added nullable combinators to runtime (nullable_any, nullable_string,
nullable_ptime, nullable_int, nullable_float, nullable_bool)
- Fields marked "nullable: true" use these combinators to handle both
absent and explicit JSON null values

4. public_name in generated dune files:
- Libraries are now public by default for proper dependency management

The peertube library now generates fully typed records with proper
accessors for all schemas, including composed types like VideoDetails.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+5901 -4184
+146 -39
ocaml-openapi/lib/openapi_codegen.ml
··· 149 149 | ["#"; "components"; "schemas"; name] -> Some name 150 150 | _ -> None 151 151 152 + (** Resolve a schema reference to its definition *) 153 + let resolve_schema_ref ~(components : Spec.components option) (ref_str : string) : Spec.schema option = 154 + match schema_name_from_ref ref_str with 155 + | None -> None 156 + | Some name -> 157 + match components with 158 + | None -> None 159 + | Some comps -> 160 + List.find_map (fun (n, s_or_ref) -> 161 + if n = name then 162 + match s_or_ref with 163 + | Spec.Value s -> Some s 164 + | Spec.Ref _ -> None (* Nested refs not supported *) 165 + else None 166 + ) comps.schemas 167 + 168 + (** Flatten allOf composition by merging properties from all schemas *) 169 + let rec flatten_all_of ~(components : Spec.components option) (schemas : Jsont.json list) : (string * Jsont.json) list * string list = 170 + List.fold_left (fun (props, reqs) json -> 171 + match get_ref json with 172 + | Some ref_str -> 173 + (* Resolve the reference and get its properties *) 174 + (match resolve_schema_ref ~components ref_str with 175 + | Some schema -> 176 + let (nested_props, nested_reqs) = 177 + match schema.all_of with 178 + | Some all_of -> flatten_all_of ~components all_of 179 + | None -> (schema.properties, schema.required) 180 + in 181 + (props @ nested_props, reqs @ nested_reqs) 182 + | None -> (props, reqs)) 183 + | None -> 184 + (* Inline schema - get properties directly *) 185 + let inline_props = match get_member "properties" json with 186 + | Some (Jsont.Object (mems, _)) -> 187 + List.map (fun ((n, _), v) -> (n, v)) mems 188 + | _ -> [] 189 + in 190 + let inline_reqs = match get_member "required" json with 191 + | Some (Jsont.Array (items, _)) -> 192 + List.filter_map (function Jsont.String (s, _) -> Some s | _ -> None) items 193 + | _ -> [] 194 + in 195 + (props @ inline_props, reqs @ inline_reqs) 196 + ) ([], []) schemas 197 + 198 + (** Expand a schema by resolving allOf composition *) 199 + let expand_schema ~(components : Spec.components option) (schema : Spec.schema) : Spec.schema = 200 + match schema.all_of with 201 + | None -> schema 202 + | Some all_of_jsons -> 203 + let (all_props, all_reqs) = flatten_all_of ~components all_of_jsons in 204 + (* Merge with any direct properties on the schema *) 205 + let merged_props = schema.properties @ all_props in 206 + let merged_reqs = schema.required @ all_reqs in 207 + (* Deduplicate by property name, keeping later definitions *) 208 + let seen = Hashtbl.create 32 in 209 + let deduped_props = List.filter (fun (name, _) -> 210 + if Hashtbl.mem seen name then false 211 + else (Hashtbl.add seen name (); true) 212 + ) (List.rev merged_props) |> List.rev in 213 + let deduped_reqs = List.sort_uniq String.compare merged_reqs in 214 + { schema with properties = deduped_props; required = deduped_reqs; all_of = None } 215 + 152 216 let rec find_refs_in_json (json : Jsont.json) : string list = 153 217 match json with 154 218 | Jsont.Object (mems, _) -> ··· 224 288 base_type : string; 225 289 is_optional : bool; 226 290 is_required : bool; 291 + is_nullable : bool; (** JSON schema nullable: true *) 227 292 description : string option; 228 293 } 229 294 ··· 279 344 (Printf.sprintf "%s.%s.t" (Name.to_module_name prefix) (Name.to_module_name suffix), is_nullable) 280 345 | None -> ("Jsont.json", is_nullable)) 281 346 | None -> 282 - match get_string_member "type" json with 283 - | Some "string" -> 284 - (match get_string_member "format" json with 285 - | Some "date-time" -> ("Ptime.t", is_nullable) 286 - | _ -> ("string", is_nullable)) 287 - | Some "integer" -> 288 - (match get_string_member "format" json with 289 - | Some "int64" -> ("int64", is_nullable) 290 - | Some "int32" -> ("int32", is_nullable) 291 - | _ -> ("int", is_nullable)) 292 - | Some "number" -> ("float", is_nullable) 293 - | Some "boolean" -> ("bool", is_nullable) 294 - | Some "array" -> 295 - (match get_member "items" json with 296 - | Some items -> 297 - let (elem_type, _) = type_of_json_schema items in 298 - (elem_type ^ " list", is_nullable) 299 - | None -> ("Jsont.json list", is_nullable)) 300 - | Some "object" -> ("Jsont.json", is_nullable) 301 - | _ -> ("Jsont.json", is_nullable) 347 + (* Check for allOf with a single $ref - common pattern for type aliasing *) 348 + (match get_member "allOf" json with 349 + | Some (Jsont.Array ([item], _)) -> 350 + (* Single item allOf - try to resolve it *) 351 + type_of_json_schema item 352 + | Some (Jsont.Array (items, _)) when List.length items > 0 -> 353 + (* Multiple allOf items - try to find a $ref among them *) 354 + (match List.find_map (fun item -> 355 + match get_ref item with 356 + | Some ref_ -> schema_name_from_ref ref_ 357 + | None -> None 358 + ) items with 359 + | Some name -> 360 + let prefix, suffix = Name.split_schema_name name in 361 + (Printf.sprintf "%s.%s.t" (Name.to_module_name prefix) (Name.to_module_name suffix), is_nullable) 362 + | None -> ("Jsont.json", is_nullable)) 363 + | _ -> 364 + match get_string_member "type" json with 365 + | Some "string" -> 366 + (match get_string_member "format" json with 367 + | Some "date-time" -> ("Ptime.t", is_nullable) 368 + | _ -> ("string", is_nullable)) 369 + | Some "integer" -> 370 + (match get_string_member "format" json with 371 + | Some "int64" -> ("int64", is_nullable) 372 + | Some "int32" -> ("int32", is_nullable) 373 + | _ -> ("int", is_nullable)) 374 + | Some "number" -> ("float", is_nullable) 375 + | Some "boolean" -> ("bool", is_nullable) 376 + | Some "array" -> 377 + (match get_member "items" json with 378 + | Some items -> 379 + let (elem_type, _) = type_of_json_schema items in 380 + (elem_type ^ " list", is_nullable) 381 + | None -> ("Jsont.json list", is_nullable)) 382 + | Some "object" -> ("Jsont.json", is_nullable) 383 + | _ -> ("Jsont.json", is_nullable)) 302 384 303 385 let rec jsont_of_base_type = function 304 386 | "string" -> "Jsont.string" ··· 317 399 module_path ^ ".jsont" 318 400 | _ -> "Jsont.json" 319 401 402 + (** Generate a nullable codec wrapper for types that need to handle explicit JSON nulls *) 403 + let nullable_jsont_of_base_type = function 404 + | "string" -> "Openapi.Runtime.nullable_string" 405 + | "int" -> "Openapi.Runtime.nullable_int" 406 + | "float" -> "Openapi.Runtime.nullable_float" 407 + | "bool" -> "Openapi.Runtime.nullable_bool" 408 + | "Ptime.t" -> "Openapi.Runtime.nullable_ptime" 409 + | base_type -> 410 + (* For other types, wrap with nullable_any *) 411 + Printf.sprintf "(Openapi.Runtime.nullable_any %s)" (jsont_of_base_type base_type) 412 + 320 413 (** {1 Schema Processing} *) 321 414 322 - let analyze_schema (name : string) (schema : Spec.schema) : schema_info = 415 + let analyze_schema ~(components : Spec.components option) (name : string) (schema : Spec.schema) : schema_info = 416 + (* First expand allOf composition *) 417 + let expanded = expand_schema ~components schema in 323 418 let prefix, suffix = Name.split_schema_name name in 324 - let is_enum = Option.is_some schema.enum in 325 - let enum_variants = match schema.enum with 419 + let is_enum = Option.is_some expanded.enum in 420 + let enum_variants = match expanded.enum with 326 421 | Some values -> 327 422 List.filter_map (fun json -> 328 423 match json with ··· 333 428 in 334 429 let fields = List.map (fun (field_name, field_json) -> 335 430 let ocaml_name = Name.to_snake_case field_name in 336 - let is_required = List.mem field_name schema.required in 431 + let is_required = List.mem field_name expanded.required in 337 432 let (base_type, json_nullable) = type_of_json_schema field_json in 338 - let is_optional = json_nullable || not is_required in 433 + let is_nullable = json_nullable in 434 + let is_optional = is_nullable || not is_required in 339 435 let ocaml_type = if is_optional then base_type ^ " option" else base_type in 340 436 let description = get_string_member "description" field_json in 341 - { ocaml_name; json_name = field_name; ocaml_type; base_type; is_optional; is_required; description } 342 - ) schema.properties in 437 + { ocaml_name; json_name = field_name; ocaml_type; base_type; is_optional; is_required; is_nullable; description } 438 + ) expanded.properties in 343 439 (* Check if schema references itself *) 344 - let deps = find_schema_dependencies schema in 440 + let deps = find_schema_dependencies expanded in 345 441 let is_recursive = List.mem name deps in 346 - { original_name = name; prefix; suffix; schema; fields; is_enum; enum_variants; 347 - description = schema.description; is_recursive } 442 + { original_name = name; prefix; suffix; schema = expanded; fields; is_enum; enum_variants; 443 + description = expanded.description; is_recursive } 348 444 349 445 (** {1 Operation Processing} *) 350 446 ··· 700 796 (* Jsont codec *) 701 797 let make_params = String.concat " " (List.map (fun (f : field_info) -> f.ocaml_name) schema.fields) in 702 798 let jsont_members = String.concat "\n" (List.map (fun (f : field_info) -> 703 - let codec = loc_jsont (jsont_of_base_type f.base_type) in 704 - if f.is_optional then 799 + (* Determine the right codec based on nullable/required status: 800 + - nullable + required: use nullable codec with mem (field must be present, can be null) 801 + - nullable + not required: use nullable codec with opt_mem (field may be absent or null) 802 + - not nullable + required: use base codec with mem 803 + - not nullable + not required: use base codec with opt_mem *) 804 + if f.is_nullable then 805 + let nullable_codec = loc_jsont (nullable_jsont_of_base_type f.base_type) in 705 806 if f.is_required then 706 - Printf.sprintf " |> Jsont.Object.mem %S (Jsont.option %s)\n ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.%s)" 707 - f.json_name codec f.ocaml_name 807 + Printf.sprintf " |> Jsont.Object.mem %S %s\n ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.%s)" 808 + f.json_name nullable_codec f.ocaml_name 708 809 else 709 - Printf.sprintf " |> Jsont.Object.opt_mem %S %s ~enc:(fun r -> r.%s)" 710 - f.json_name codec f.ocaml_name 810 + Printf.sprintf " |> Jsont.Object.mem %S %s\n ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.%s)" 811 + f.json_name nullable_codec f.ocaml_name 812 + else if f.is_optional then 813 + let codec = loc_jsont (jsont_of_base_type f.base_type) in 814 + Printf.sprintf " |> Jsont.Object.opt_mem %S %s ~enc:(fun r -> r.%s)" 815 + f.json_name codec f.ocaml_name 711 816 else 817 + let codec = loc_jsont (jsont_of_base_type f.base_type) in 712 818 Printf.sprintf " |> Jsont.Object.mem %S %s ~enc:(fun r -> r.%s)" 713 819 f.json_name codec f.ocaml_name 714 820 ) schema.fields) in ··· 1015 1121 | Some c -> List.filter_map (fun (name, sor) -> 1016 1122 match sor with 1017 1123 | Spec.Ref _ -> None 1018 - | Spec.Value s -> Some (analyze_schema name s) 1124 + | Spec.Value s -> Some (analyze_schema ~components:spec.components name s) 1019 1125 ) c.schemas 1020 1126 in 1021 1127 ··· 1093 1199 | Some c -> List.filter_map (fun (name, sor) -> 1094 1200 match sor with 1095 1201 | Spec.Ref _ -> None 1096 - | Spec.Value s -> Some (analyze_schema name s) 1202 + | Spec.Value s -> Some (analyze_schema ~components:spec.components name s) 1097 1203 ) c.schemas 1098 1204 in 1099 1205 ··· 1161 1267 let generate_dune (package_name : string) : string = 1162 1268 Printf.sprintf {|(library 1163 1269 (name %s) 1270 + (public_name %s) 1164 1271 (libraries openapi jsont jsont.bytesrw requests ptime eio) 1165 1272 (wrapped true)) 1166 1273 1167 1274 (include dune.inc) 1168 - |} package_name 1275 + |} package_name package_name 1169 1276 1170 1277 let generate_dune_inc ~(spec_path : string option) (package_name : string) : string = 1171 1278 match spec_path with
+43
ocaml-openapi/lib/openapi_runtime.ml
··· 173 173 let nullable (codec : 'a Jsont.t) : 'a option Jsont.t = 174 174 Jsont.option codec 175 175 176 + (** Nullable combinator that handles explicit JSON null values. 177 + Use this for fields marked as "nullable: true" in OpenAPI specs. 178 + Unlike Jsont.option, this properly decodes explicit null as None. *) 179 + let nullable_any (base_codec : 'a Jsont.t) : 'a option Jsont.t = 180 + let null_codec = Jsont.null None in 181 + let some_codec = Jsont.map base_codec 182 + ~kind:"nullable_some" 183 + ~dec:(fun v -> Some v) 184 + ~enc:(function Some v -> v | None -> failwith "unreachable") 185 + in 186 + (* Use Jsont.any to dispatch based on the JSON value type *) 187 + Jsont.any 188 + ~dec_null:null_codec 189 + ~dec_string:some_codec 190 + ~dec_number:some_codec 191 + ~dec_bool:some_codec 192 + ~dec_array:some_codec 193 + ~dec_object:some_codec 194 + ~enc:(function 195 + | None -> null_codec 196 + | Some _ -> some_codec) 197 + () 198 + 199 + (** Nullable string that handles both absent and explicit null *) 200 + let nullable_string : string option Jsont.t = 201 + nullable_any Jsont.string 202 + 203 + (** Nullable ptime that handles both absent and explicit null *) 204 + let nullable_ptime : Ptime.t option Jsont.t = 205 + nullable_any ptime_jsont 206 + 207 + (** Nullable int that handles both absent and explicit null *) 208 + let nullable_int : int option Jsont.t = 209 + nullable_any Jsont.int 210 + 211 + (** Nullable float that handles both absent and explicit null *) 212 + let nullable_float : float option Jsont.t = 213 + nullable_any Jsont.number 214 + 215 + (** Nullable bool that handles both absent and explicit null *) 216 + let nullable_bool : bool option Jsont.t = 217 + nullable_any Jsont.bool 218 + 176 219 (** {1 Any JSON value wrapper} *) 177 220 178 221 type json = Jsont.json
+3327 -2511
ocaml-peertube/peertube.ml
··· 158 158 end 159 159 end 160 160 161 - module VideoUploadRequestResumable = struct 162 - module T = struct 163 - type t = Jsont.json 164 - 165 - let jsont = Jsont.json 166 - 167 - let v () = Jsont.Null ((), Jsont.Meta.none) 168 - end 169 - end 170 - 171 - module VideoUploadRequestLegacy = struct 172 - module T = struct 173 - type t = Jsont.json 174 - 175 - let jsont = Jsont.json 176 - 177 - let v () = Jsont.Null ((), Jsont.Meta.none) 178 - end 179 - end 180 - 181 161 module VideoUpload = struct 182 162 module Response = struct 183 163 type t = { ··· 355 335 end 356 336 end 357 337 358 - module VideoStreamingPlaylists = struct 359 - module T = struct 360 - type t = Jsont.json 361 - 362 - let jsont = Jsont.json 363 - 364 - let v () = Jsont.Null ((), Jsont.Meta.none) 365 - end 366 - end 367 - 368 338 module VideoStatsUserAgentDevice = struct 369 339 module T = struct 370 340 type t = [ ··· 402 372 end 403 373 end 404 374 375 + module UserViewingVideo = struct 376 + module T = struct 377 + type t = { 378 + client : string option; (** Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 379 + *) 380 + current_time : int; (** timestamp within the video, in seconds *) 381 + device : VideoStatsUserAgentDevice.T.t option; (** Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 382 + *) 383 + operating_system : string option; (** Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 384 + *) 385 + session_id : string option; (** Optional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. 386 + *) 387 + view_event : string option; (** Event since last viewing call: 388 + * `seek` - If the user seeked the video 389 + *) 390 + } 391 + 392 + let v ~current_time ?client ?device ?operating_system ?session_id ?view_event () = { client; current_time; device; operating_system; session_id; view_event } 393 + 394 + let client t = t.client 395 + let current_time t = t.current_time 396 + let device t = t.device 397 + let operating_system t = t.operating_system 398 + let session_id t = t.session_id 399 + let view_event t = t.view_event 400 + 401 + let jsont : t Jsont.t = 402 + Jsont.Object.map ~kind:"UserViewingVideo" 403 + (fun client current_time device operating_system session_id view_event -> { client; current_time; device; operating_system; session_id; view_event }) 404 + |> Jsont.Object.opt_mem "client" Jsont.string ~enc:(fun r -> r.client) 405 + |> Jsont.Object.mem "currentTime" Jsont.int ~enc:(fun r -> r.current_time) 406 + |> Jsont.Object.opt_mem "device" VideoStatsUserAgentDevice.T.jsont ~enc:(fun r -> r.device) 407 + |> Jsont.Object.opt_mem "operatingSystem" Jsont.string ~enc:(fun r -> r.operating_system) 408 + |> Jsont.Object.opt_mem "sessionId" Jsont.string ~enc:(fun r -> r.session_id) 409 + |> Jsont.Object.opt_mem "viewEvent" Jsont.string ~enc:(fun r -> r.view_event) 410 + |> Jsont.Object.skip_unknown 411 + |> Jsont.Object.finish 412 + end 413 + end 414 + 405 415 module VideoStatsUserAgent = struct 406 416 module T = struct 407 417 type t = { ··· 641 651 end 642 652 end 643 653 654 + module VideoResolutionSet = struct 655 + module T = struct 656 + (** Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) 657 + 658 + `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. 659 + *) 660 + type t = Jsont.json 661 + 662 + let jsont = Jsont.json 663 + 664 + let v () = Jsont.Null ((), Jsont.Meta.none) 665 + end 666 + end 667 + 668 + module VideoResolutionConstant = struct 669 + module T = struct 670 + (** resolutions and their labels for the video *) 671 + type t = { 672 + id : VideoResolutionSet.T.t option; 673 + label : string option; 674 + } 675 + 676 + let v ?id ?label () = { id; label } 677 + 678 + let id t = t.id 679 + let label t = t.label 680 + 681 + let jsont : t Jsont.t = 682 + Jsont.Object.map ~kind:"VideoResolutionConstant" 683 + (fun id label -> { id; label }) 684 + |> Jsont.Object.opt_mem "id" VideoResolutionSet.T.jsont ~enc:(fun r -> r.id) 685 + |> Jsont.Object.opt_mem "label" Jsont.string ~enc:(fun r -> r.label) 686 + |> Jsont.Object.skip_unknown 687 + |> Jsont.Object.finish 688 + end 689 + end 690 + 644 691 module VideoSource = struct 645 692 module T = struct 646 693 type t = { ··· 649 696 fps : float option; (** **PeerTube >= 6.1** Frames per second of the video file *) 650 697 height : int option; (** **PeerTube >= 6.1** Video stream height *) 651 698 input_filename : string option; (** Uploaded/imported filename *) 652 - resolution : Jsont.json option; (** **PeerTube >= 6.1** *) 699 + resolution : VideoResolutionConstant.T.t option; (** **PeerTube >= 6.1** *) 653 700 size : int option; (** **PeerTube >= 6.1** Video file size in bytes *) 654 701 width : int option; (** **PeerTube >= 6.1** Video stream width *) 655 702 } ··· 673 720 |> Jsont.Object.opt_mem "fps" Jsont.number ~enc:(fun r -> r.fps) 674 721 |> Jsont.Object.opt_mem "height" Jsont.int ~enc:(fun r -> r.height) 675 722 |> Jsont.Object.opt_mem "inputFilename" Jsont.string ~enc:(fun r -> r.input_filename) 676 - |> Jsont.Object.opt_mem "resolution" Jsont.json ~enc:(fun r -> r.resolution) 723 + |> Jsont.Object.opt_mem "resolution" VideoResolutionConstant.T.jsont ~enc:(fun r -> r.resolution) 677 724 |> Jsont.Object.opt_mem "size" Jsont.int ~enc:(fun r -> r.size) 678 725 |> Jsont.Object.opt_mem "width" Jsont.int ~enc:(fun r -> r.width) 679 726 |> Jsont.Object.skip_unknown ··· 706 753 status = Requests.Response.status_code response; 707 754 body = Requests.Response.text response; 708 755 }) 709 - end 710 - 711 - module VideoResolutionSet = struct 712 - module T = struct 713 - (** Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) 714 - 715 - `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. 716 - *) 717 - type t = Jsont.json 718 - 719 - let jsont = Jsont.json 720 - 721 - let v () = Jsont.Null ((), Jsont.Meta.none) 722 - end 723 - end 724 - 725 - module VideoResolutionConstant = struct 726 - module T = struct 727 - (** resolutions and their labels for the video *) 728 - type t = { 729 - id : VideoResolutionSet.T.t option; 730 - label : string option; 731 - } 732 - 733 - let v ?id ?label () = { id; label } 734 - 735 - let id t = t.id 736 - let label t = t.label 737 - 738 - let jsont : t Jsont.t = 739 - Jsont.Object.map ~kind:"VideoResolutionConstant" 740 - (fun id label -> { id; label }) 741 - |> Jsont.Object.opt_mem "id" VideoResolutionSet.T.jsont ~enc:(fun r -> r.id) 742 - |> Jsont.Object.opt_mem "label" Jsont.string ~enc:(fun r -> r.label) 743 - |> Jsont.Object.skip_unknown 744 - |> Jsont.Object.finish 745 - end 746 756 end 747 757 748 758 module VideoReplaceSourceRequestResumable = struct ··· 1020 1030 end 1021 1031 end 1022 1032 1023 - module VideoDetails = struct 1024 - module T = struct 1025 - type t = Jsont.json 1026 - 1027 - let jsont = Jsont.json 1028 - 1029 - let v () = Jsont.Null ((), Jsont.Meta.none) 1030 - end 1031 - 1032 - (** Get a video 1033 - @param id The object id, uuid or short uuid 1034 - *) 1035 - let get_video ~id client () = 1036 - let op_name = "get_video" in 1037 - let url_path = Openapi.Runtime.Path.render ~params:[("id", id)] "/api/v1/videos/{id}" in 1038 - let query = "" in 1039 - let url = client.base_url ^ url_path ^ query in 1040 - let response = 1041 - try Requests.get client.session url 1042 - with Eio.Io _ as ex -> 1043 - let bt = Printexc.get_raw_backtrace () in 1044 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1045 - in 1046 - if Requests.Response.ok response then 1047 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1048 - else 1049 - raise (Openapi.Runtime.Api_error { 1050 - operation = op_name; 1051 - method_ = "GET"; 1052 - url; 1053 - status = Requests.Response.status_code response; 1054 - body = Requests.Response.text response; 1055 - }) 1056 - end 1057 - 1058 - module VideoCreateImport = struct 1059 - module T = struct 1060 - type t = Jsont.json 1061 - 1062 - let jsont = Jsont.json 1063 - 1064 - let v () = Jsont.Null ((), Jsont.Meta.none) 1065 - end 1066 - end 1067 - 1068 1033 module VideoCommentsPolicySet = struct 1069 1034 module T = struct 1070 1035 (** Comments policy of the video (Enabled = `1`, Disabled = `2`, Requires Approval = `3`) *) ··· 1152 1117 }) 1153 1118 end 1154 1119 1155 - module VideoChannelSyncList = struct 1156 - module T = struct 1157 - type t = { 1158 - data : Jsont.json list option; 1159 - total : int option; 1160 - } 1161 - 1162 - let v ?data ?total () = { data; total } 1163 - 1164 - let data t = t.data 1165 - let total t = t.total 1166 - 1167 - let jsont : t Jsont.t = 1168 - Jsont.Object.map ~kind:"VideoChannelSyncList" 1169 - (fun data total -> { data; total }) 1170 - |> Jsont.Object.opt_mem "data" (Jsont.list Jsont.json) ~enc:(fun r -> r.data) 1171 - |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 1172 - |> Jsont.Object.skip_unknown 1173 - |> Jsont.Object.finish 1174 - end 1175 - 1176 - (** List the synchronizations of video channels of an account 1177 - @param name The username or handle of the account 1178 - @param start Offset used to paginate results 1179 - @param count Number of items to return 1180 - @param sort Sort column 1181 - @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 1182 - *) 1183 - let get_api_v1_accounts_video_channel_syncs ~name ?start ?count ?sort ?include_collaborations client () = 1184 - let op_name = "get_api_v1_accounts_video_channel_syncs" in 1185 - let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/video-channel-syncs" in 1186 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"includeCollaborations" ~value:include_collaborations]) in 1187 - let url = client.base_url ^ url_path ^ query in 1188 - let response = 1189 - try Requests.get client.session url 1190 - with Eio.Io _ as ex -> 1191 - let bt = Printexc.get_raw_backtrace () in 1192 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1193 - in 1194 - if Requests.Response.ok response then 1195 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1196 - else 1197 - raise (Openapi.Runtime.Api_error { 1198 - operation = op_name; 1199 - method_ = "GET"; 1200 - url; 1201 - status = Requests.Response.status_code response; 1202 - body = Requests.Response.text response; 1203 - }) 1204 - end 1205 - 1206 - module VideoChannelList = struct 1207 - module T = struct 1208 - type t = { 1209 - data : Jsont.json list option; 1210 - total : int option; 1211 - } 1212 - 1213 - let v ?data ?total () = { data; total } 1214 - 1215 - let data t = t.data 1216 - let total t = t.total 1217 - 1218 - let jsont : t Jsont.t = 1219 - Jsont.Object.map ~kind:"VideoChannelList" 1220 - (fun data total -> { data; total }) 1221 - |> Jsont.Object.opt_mem "data" (Jsont.list Jsont.json) ~enc:(fun r -> r.data) 1222 - |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 1223 - |> Jsont.Object.skip_unknown 1224 - |> Jsont.Object.finish 1225 - end 1226 - 1227 - (** List video channels of an account 1228 - @param name The username or handle of the account 1229 - @param with_stats include daily view statistics for the last 30 days and total views (only if authenticated as the account user) 1230 - @param start Offset used to paginate results 1231 - @param count Number of items to return 1232 - @param search Plain text search, applied to various parts of the model depending on endpoint 1233 - @param sort Sort column 1234 - @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 1235 - *) 1236 - let get_api_v1_accounts_video_channels ~name ?with_stats ?start ?count ?search ?sort ?include_collaborations client () = 1237 - let op_name = "get_api_v1_accounts_video_channels" in 1238 - let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/video-channels" in 1239 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"withStats" ~value:with_stats; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"includeCollaborations" ~value:include_collaborations]) in 1240 - let url = client.base_url ^ url_path ^ query in 1241 - let response = 1242 - try Requests.get client.session url 1243 - with Eio.Io _ as ex -> 1244 - let bt = Printexc.get_raw_backtrace () in 1245 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1246 - in 1247 - if Requests.Response.ok response then 1248 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1249 - else 1250 - raise (Openapi.Runtime.Api_error { 1251 - operation = op_name; 1252 - method_ = "GET"; 1253 - url; 1254 - status = Requests.Response.status_code response; 1255 - body = Requests.Response.text response; 1256 - }) 1257 - 1258 - (** Search channels 1259 - @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it. 1260 - 1261 - @param start Offset used to paginate results 1262 - @param count Number of items to return 1263 - @param search_target If the administrator enabled search index support, you can override the default search target. 1264 - 1265 - **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information: 1266 - * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), 1267 - then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. 1268 - After that, you can use the classic REST API endpoints to fetch the complete object or interact with it 1269 - * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch 1270 - the data from the origin instance API 1271 - 1272 - @param sort Sort column 1273 - @param host Find elements owned by this host 1274 - @param handles Find elements with these handles 1275 - *) 1276 - let search_channels ~search ?start ?count ?search_target ?sort ?host ?handles client () = 1277 - let op_name = "search_channels" in 1278 - let url_path = "/api/v1/search/video-channels" in 1279 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.singleton ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"searchTarget" ~value:search_target; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"handles" ~value:handles]) in 1280 - let url = client.base_url ^ url_path ^ query in 1281 - let response = 1282 - try Requests.get client.session url 1283 - with Eio.Io _ as ex -> 1284 - let bt = Printexc.get_raw_backtrace () in 1285 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1286 - in 1287 - if Requests.Response.ok response then 1288 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1289 - else 1290 - raise (Openapi.Runtime.Api_error { 1291 - operation = op_name; 1292 - method_ = "GET"; 1293 - url; 1294 - status = Requests.Response.status_code response; 1295 - body = Requests.Response.text response; 1296 - }) 1297 - 1298 - (** List my user subscriptions 1299 - @param start Offset used to paginate results 1300 - @param count Number of items to return 1301 - *) 1302 - let get_api_v1_users_me_subscriptions ?start ?count ?sort client () = 1303 - let op_name = "get_api_v1_users_me_subscriptions" in 1304 - let url_path = "/api/v1/users/me/subscriptions" in 1305 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 1306 - let url = client.base_url ^ url_path ^ query in 1307 - let response = 1308 - try Requests.get client.session url 1309 - with Eio.Io _ as ex -> 1310 - let bt = Printexc.get_raw_backtrace () in 1311 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1312 - in 1313 - if Requests.Response.ok response then 1314 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1315 - else 1316 - raise (Openapi.Runtime.Api_error { 1317 - operation = op_name; 1318 - method_ = "GET"; 1319 - url; 1320 - status = Requests.Response.status_code response; 1321 - body = Requests.Response.text response; 1322 - }) 1323 - 1324 - (** List video channels 1325 - @param start Offset used to paginate results 1326 - @param count Number of items to return 1327 - @param sort Sort column 1328 - *) 1329 - let get_video_channels ?start ?count ?sort client () = 1330 - let op_name = "get_video_channels" in 1331 - let url_path = "/api/v1/video-channels" in 1332 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 1333 - let url = client.base_url ^ url_path ^ query in 1334 - let response = 1335 - try Requests.get client.session url 1336 - with Eio.Io _ as ex -> 1337 - let bt = Printexc.get_raw_backtrace () in 1338 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1339 - in 1340 - if Requests.Response.ok response then 1341 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1342 - else 1343 - raise (Openapi.Runtime.Api_error { 1344 - operation = op_name; 1345 - method_ = "GET"; 1346 - url; 1347 - status = Requests.Response.status_code response; 1348 - body = Requests.Response.text response; 1349 - }) 1350 - end 1351 - 1352 1120 module VideoChannelEdit = struct 1353 1121 module T = struct 1354 1122 type t = { ··· 1422 1190 end 1423 1191 end 1424 1192 1425 - module VideoChannel = struct 1426 - module Update = struct 1427 - type t = Jsont.json 1428 - 1429 - let jsont = Jsont.json 1430 - 1431 - let v () = Jsont.Null ((), Jsont.Meta.none) 1432 - end 1433 - 1434 - module Create = struct 1435 - type t = Jsont.json 1436 - 1437 - let jsont = Jsont.json 1438 - 1439 - let v () = Jsont.Null ((), Jsont.Meta.none) 1440 - end 1441 - 1442 - module T = struct 1443 - type t = Jsont.json 1444 - 1445 - let jsont = Jsont.json 1446 - 1447 - let v () = Jsont.Null ((), Jsont.Meta.none) 1448 - end 1449 - 1450 - (** Get subscription of my user 1451 - @param subscription_handle The subscription handle 1452 - *) 1453 - let get_api_v1_users_me_subscriptions ~subscription_handle client () = 1454 - let op_name = "get_api_v1_users_me_subscriptions" in 1455 - let url_path = Openapi.Runtime.Path.render ~params:[("subscriptionHandle", subscription_handle)] "/api/v1/users/me/subscriptions/{subscriptionHandle}" in 1456 - let query = "" in 1457 - let url = client.base_url ^ url_path ^ query in 1458 - let response = 1459 - try Requests.get client.session url 1460 - with Eio.Io _ as ex -> 1461 - let bt = Printexc.get_raw_backtrace () in 1462 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1463 - in 1464 - if Requests.Response.ok response then 1465 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1466 - else 1467 - raise (Openapi.Runtime.Api_error { 1468 - operation = op_name; 1469 - method_ = "GET"; 1470 - url; 1471 - status = Requests.Response.status_code response; 1472 - body = Requests.Response.text response; 1473 - }) 1474 - 1475 - (** Get a video channel 1476 - @param channel_handle The video channel handle 1477 - *) 1478 - let get_video_channel ~channel_handle client () = 1479 - let op_name = "get_video_channel" in 1480 - let url_path = Openapi.Runtime.Path.render ~params:[("channelHandle", channel_handle)] "/api/v1/video-channels/{channelHandle}" in 1481 - let query = "" in 1482 - let url = client.base_url ^ url_path ^ query in 1483 - let response = 1484 - try Requests.get client.session url 1485 - with Eio.Io _ as ex -> 1486 - let bt = Printexc.get_raw_backtrace () in 1487 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 1488 - in 1489 - if Requests.Response.ok response then 1490 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1491 - else 1492 - raise (Openapi.Runtime.Api_error { 1493 - operation = op_name; 1494 - method_ = "GET"; 1495 - url; 1496 - status = Requests.Response.status_code response; 1497 - body = Requests.Response.text response; 1498 - }) 1499 - end 1500 - 1501 1193 module VideoCategorySet = struct 1502 1194 module T = struct 1503 1195 (** category id of the video (see [/videos/categories](#operation/getCategories)) *) ··· 1560 1252 let jsont = Jsont.json 1561 1253 1562 1254 let v () = Jsont.Null ((), Jsont.Meta.none) 1563 - end 1564 - end 1565 - 1566 - module UserWithStats = struct 1567 - module T = struct 1568 - type t = Jsont.json 1569 - 1570 - let jsont = Jsont.json 1571 - 1572 - let v () = Jsont.Null ((), Jsont.Meta.none) 1573 - end 1574 - end 1575 - 1576 - module UserViewingVideo = struct 1577 - module T = struct 1578 - type t = { 1579 - client : string option; (** Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 1580 - *) 1581 - current_time : int; (** timestamp within the video, in seconds *) 1582 - device : Jsont.json option; (** Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 1583 - *) 1584 - operating_system : string option; (** Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 1585 - *) 1586 - session_id : string option; (** Optional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. 1587 - *) 1588 - view_event : string option; (** Event since last viewing call: 1589 - * `seek` - If the user seeked the video 1590 - *) 1591 - } 1592 - 1593 - let v ~current_time ?client ?device ?operating_system ?session_id ?view_event () = { client; current_time; device; operating_system; session_id; view_event } 1594 - 1595 - let client t = t.client 1596 - let current_time t = t.current_time 1597 - let device t = t.device 1598 - let operating_system t = t.operating_system 1599 - let session_id t = t.session_id 1600 - let view_event t = t.view_event 1601 - 1602 - let jsont : t Jsont.t = 1603 - Jsont.Object.map ~kind:"UserViewingVideo" 1604 - (fun client current_time device operating_system session_id view_event -> { client; current_time; device; operating_system; session_id; view_event }) 1605 - |> Jsont.Object.opt_mem "client" Jsont.string ~enc:(fun r -> r.client) 1606 - |> Jsont.Object.mem "currentTime" Jsont.int ~enc:(fun r -> r.current_time) 1607 - |> Jsont.Object.opt_mem "device" Jsont.json ~enc:(fun r -> r.device) 1608 - |> Jsont.Object.opt_mem "operatingSystem" Jsont.string ~enc:(fun r -> r.operating_system) 1609 - |> Jsont.Object.opt_mem "sessionId" Jsont.string ~enc:(fun r -> r.session_id) 1610 - |> Jsont.Object.opt_mem "viewEvent" Jsont.string ~enc:(fun r -> r.view_event) 1611 - |> Jsont.Object.skip_unknown 1612 - |> Jsont.Object.finish 1613 1255 end 1614 1256 end 1615 1257 ··· 2365 2007 Jsont.Object.map ~kind:"RunnerJob" 2366 2008 (fun created_at error failures finished_at parent payload priority progress runner started_at state type_ updated_at uuid -> { created_at; error; failures; finished_at; parent; payload; priority; progress; runner; started_at; state; type_; updated_at; uuid }) 2367 2009 |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 2368 - |> Jsont.Object.opt_mem "error" Jsont.string ~enc:(fun r -> r.error) 2010 + |> Jsont.Object.mem "error" Openapi.Runtime.nullable_string 2011 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.error) 2369 2012 |> Jsont.Object.opt_mem "failures" Jsont.int ~enc:(fun r -> r.failures) 2370 2013 |> Jsont.Object.opt_mem "finishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.finished_at) 2371 - |> Jsont.Object.opt_mem "parent" Jsont.json ~enc:(fun r -> r.parent) 2014 + |> Jsont.Object.mem "parent" (Openapi.Runtime.nullable_any Jsont.json) 2015 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.parent) 2372 2016 |> Jsont.Object.opt_mem "payload" RunnerJobPayload.T.jsont ~enc:(fun r -> r.payload) 2373 2017 |> Jsont.Object.opt_mem "priority" Jsont.int ~enc:(fun r -> r.priority) 2374 2018 |> Jsont.Object.opt_mem "progress" Jsont.int ~enc:(fun r -> r.progress) 2375 - |> Jsont.Object.opt_mem "runner" Jsont.json ~enc:(fun r -> r.runner) 2019 + |> Jsont.Object.mem "runner" (Openapi.Runtime.nullable_any Jsont.json) 2020 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.runner) 2376 2021 |> Jsont.Object.opt_mem "startedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.started_at) 2377 2022 |> Jsont.Object.opt_mem "state" RunnerJobStateConstant.T.jsont ~enc:(fun r -> r.state) 2378 2023 |> Jsont.Object.opt_mem "type" Type.jsont ~enc:(fun r -> r.type_) ··· 2385 2030 2386 2031 module RunnerJobAdmin = struct 2387 2032 module T = struct 2388 - type t = Jsont.json 2033 + type t = { 2034 + created_at : Ptime.t option; 2035 + error : string option; (** Error message if the job is errored *) 2036 + failures : int option; (** Number of times a remote runner failed to process this job. After too many failures, the job in "error" state *) 2037 + finished_at : Ptime.t option; 2038 + parent : Jsont.json option; (** If job has a parent job *) 2039 + payload : RunnerJobPayload.T.t option; 2040 + priority : int option; (** Job priority (less has more priority) *) 2041 + progress : int option; (** Percentage progress *) 2042 + runner : Jsont.json option; (** If job is associated to a runner *) 2043 + started_at : Ptime.t option; 2044 + state : RunnerJobStateConstant.T.t option; 2045 + type_ : RunnerJob.Type.t option; 2046 + updated_at : Ptime.t option; 2047 + uuid : Uuidv4.T.t option; 2048 + private_payload : Jsont.json option; 2049 + } 2389 2050 2390 - let jsont = Jsont.json 2051 + let v ?created_at ?error ?failures ?finished_at ?parent ?payload ?priority ?progress ?runner ?started_at ?state ?type_ ?updated_at ?uuid ?private_payload () = { created_at; error; failures; finished_at; parent; payload; priority; progress; runner; started_at; state; type_; updated_at; uuid; private_payload } 2052 + 2053 + let created_at t = t.created_at 2054 + let error t = t.error 2055 + let failures t = t.failures 2056 + let finished_at t = t.finished_at 2057 + let parent t = t.parent 2058 + let payload t = t.payload 2059 + let priority t = t.priority 2060 + let progress t = t.progress 2061 + let runner t = t.runner 2062 + let started_at t = t.started_at 2063 + let state t = t.state 2064 + let type_ t = t.type_ 2065 + let updated_at t = t.updated_at 2066 + let uuid t = t.uuid 2067 + let private_payload t = t.private_payload 2391 2068 2392 - let v () = Jsont.Null ((), Jsont.Meta.none) 2069 + let jsont : t Jsont.t = 2070 + Jsont.Object.map ~kind:"RunnerJobAdmin" 2071 + (fun created_at error failures finished_at parent payload priority progress runner started_at state type_ updated_at uuid private_payload -> { created_at; error; failures; finished_at; parent; payload; priority; progress; runner; started_at; state; type_; updated_at; uuid; private_payload }) 2072 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 2073 + |> Jsont.Object.mem "error" Openapi.Runtime.nullable_string 2074 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.error) 2075 + |> Jsont.Object.opt_mem "failures" Jsont.int ~enc:(fun r -> r.failures) 2076 + |> Jsont.Object.opt_mem "finishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.finished_at) 2077 + |> Jsont.Object.mem "parent" (Openapi.Runtime.nullable_any Jsont.json) 2078 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.parent) 2079 + |> Jsont.Object.opt_mem "payload" RunnerJobPayload.T.jsont ~enc:(fun r -> r.payload) 2080 + |> Jsont.Object.opt_mem "priority" Jsont.int ~enc:(fun r -> r.priority) 2081 + |> Jsont.Object.opt_mem "progress" Jsont.int ~enc:(fun r -> r.progress) 2082 + |> Jsont.Object.mem "runner" (Openapi.Runtime.nullable_any Jsont.json) 2083 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.runner) 2084 + |> Jsont.Object.opt_mem "startedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.started_at) 2085 + |> Jsont.Object.opt_mem "state" RunnerJobStateConstant.T.jsont ~enc:(fun r -> r.state) 2086 + |> Jsont.Object.opt_mem "type" RunnerJob.Type.jsont ~enc:(fun r -> r.type_) 2087 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 2088 + |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 2089 + |> Jsont.Object.opt_mem "privatePayload" Jsont.json ~enc:(fun r -> r.private_payload) 2090 + |> Jsont.Object.skip_unknown 2091 + |> Jsont.Object.finish 2393 2092 end 2394 2093 end 2395 2094 ··· 2638 2337 status = Requests.Response.status_code response; 2639 2338 body = Requests.Response.text response; 2640 2339 }) 2641 - end 2642 - 2643 - module PlaylistElement = struct 2644 - module T = struct 2645 - type t = { 2646 - position : int option; 2647 - start_timestamp : int option; 2648 - stop_timestamp : int option; 2649 - video : Jsont.json option; 2650 - } 2651 - 2652 - let v ?position ?start_timestamp ?stop_timestamp ?video () = { position; start_timestamp; stop_timestamp; video } 2653 - 2654 - let position t = t.position 2655 - let start_timestamp t = t.start_timestamp 2656 - let stop_timestamp t = t.stop_timestamp 2657 - let video t = t.video 2658 - 2659 - let jsont : t Jsont.t = 2660 - Jsont.Object.map ~kind:"PlaylistElement" 2661 - (fun position start_timestamp stop_timestamp video -> { position; start_timestamp; stop_timestamp; video }) 2662 - |> Jsont.Object.opt_mem "position" Jsont.int ~enc:(fun r -> r.position) 2663 - |> Jsont.Object.opt_mem "startTimestamp" Jsont.int ~enc:(fun r -> r.start_timestamp) 2664 - |> Jsont.Object.opt_mem "stopTimestamp" Jsont.int ~enc:(fun r -> r.stop_timestamp) 2665 - |> Jsont.Object.opt_mem "video" Jsont.json ~enc:(fun r -> r.video) 2666 - |> Jsont.Object.skip_unknown 2667 - |> Jsont.Object.finish 2668 - end 2669 2340 end 2670 2341 2671 2342 module PlayerThemeVideoSetting = struct ··· 3025 2696 |> Jsont.Object.opt_mem "email" Jsont.json ~enc:(fun r -> r.email) 3026 2697 |> Jsont.Object.opt_mem "emailVerified" Jsont.bool ~enc:(fun r -> r.email_verified) 3027 2698 |> Jsont.Object.opt_mem "password" Password.T.jsont ~enc:(fun r -> r.password) 3028 - |> Jsont.Object.opt_mem "pluginAuth" Jsont.string ~enc:(fun r -> r.plugin_auth) 2699 + |> Jsont.Object.mem "pluginAuth" Openapi.Runtime.nullable_string 2700 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.plugin_auth) 3029 2701 |> Jsont.Object.opt_mem "role" UserRole.T.jsont ~enc:(fun r -> r.role) 3030 2702 |> Jsont.Object.opt_mem "videoQuota" Jsont.int ~enc:(fun r -> r.video_quota) 3031 2703 |> Jsont.Object.opt_mem "videoQuotaDaily" Jsont.int ~enc:(fun r -> r.video_quota_daily) ··· 3041 2713 display_name : string option; (** editable name of the user, displayed in its representations *) 3042 2714 email : string; (** email of the user, used for login or service communications *) 3043 2715 password : Password.T.t; 3044 - username : Jsont.json; (** immutable name of the user, used to find or mention its actor *) 2716 + username : Username.T.t; (** immutable name of the user, used to find or mention its actor *) 3045 2717 } 3046 2718 3047 2719 let v ~email ~password ~username ?channel ?display_name () = { channel; display_name; email; password; username } ··· 3059 2731 |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 3060 2732 |> Jsont.Object.mem "email" Jsont.string ~enc:(fun r -> r.email) 3061 2733 |> Jsont.Object.mem "password" Password.T.jsont ~enc:(fun r -> r.password) 2734 + |> Jsont.Object.mem "username" Username.T.jsont ~enc:(fun r -> r.username) 2735 + |> Jsont.Object.skip_unknown 2736 + |> Jsont.Object.finish 2737 + end 2738 + end 2739 + 2740 + module OauthTokenPassword = struct 2741 + module T = struct 2742 + type t = { 2743 + client_id : string; 2744 + client_secret : string; 2745 + grant_type : string; 2746 + username : Jsont.json; 2747 + password : Password.T.t option; 2748 + external_auth_token : string option; (** If you want to authenticate using an external authentication token you got from an auth plugin (like `peertube-plugin-auth-openid-connect` for example) instead of a password or a refresh token, provide it here. *) 2749 + } 2750 + 2751 + let v ~client_id ~client_secret ~grant_type ~username ?password ?external_auth_token () = { client_id; client_secret; grant_type; username; password; external_auth_token } 2752 + 2753 + let client_id t = t.client_id 2754 + let client_secret t = t.client_secret 2755 + let grant_type t = t.grant_type 2756 + let username t = t.username 2757 + let password t = t.password 2758 + let external_auth_token t = t.external_auth_token 2759 + 2760 + let jsont : t Jsont.t = 2761 + Jsont.Object.map ~kind:"OAuthToken-password" 2762 + (fun client_id client_secret grant_type username password external_auth_token -> { client_id; client_secret; grant_type; username; password; external_auth_token }) 2763 + |> Jsont.Object.mem "client_id" Jsont.string ~enc:(fun r -> r.client_id) 2764 + |> Jsont.Object.mem "client_secret" Jsont.string ~enc:(fun r -> r.client_secret) 2765 + |> Jsont.Object.mem "grant_type" Jsont.string ~enc:(fun r -> r.grant_type) 3062 2766 |> Jsont.Object.mem "username" Jsont.json ~enc:(fun r -> r.username) 2767 + |> Jsont.Object.opt_mem "password" Password.T.jsont ~enc:(fun r -> r.password) 2768 + |> Jsont.Object.opt_mem "externalAuthToken" Jsont.string ~enc:(fun r -> r.external_auth_token) 3063 2769 |> Jsont.Object.skip_unknown 3064 2770 |> Jsont.Object.finish 3065 2771 end ··· 3147 2853 3148 2854 module OauthTokenRefreshToken = struct 3149 2855 module T = struct 3150 - type t = Jsont.json 3151 - 3152 - let jsont = Jsont.json 2856 + type t = { 2857 + client_id : string; 2858 + client_secret : string; 2859 + grant_type : string; 2860 + refresh_token : string; 2861 + } 3153 2862 3154 - let v () = Jsont.Null ((), Jsont.Meta.none) 3155 - end 3156 - end 3157 - 3158 - module OauthTokenPassword = struct 3159 - module T = struct 3160 - type t = Jsont.json 2863 + let v ~client_id ~client_secret ~grant_type ~refresh_token () = { client_id; client_secret; grant_type; refresh_token } 3161 2864 3162 - let jsont = Jsont.json 2865 + let client_id t = t.client_id 2866 + let client_secret t = t.client_secret 2867 + let grant_type t = t.grant_type 2868 + let refresh_token t = t.refresh_token 3163 2869 3164 - let v () = Jsont.Null ((), Jsont.Meta.none) 2870 + let jsont : t Jsont.t = 2871 + Jsont.Object.map ~kind:"OAuthToken-refresh_token" 2872 + (fun client_id client_secret grant_type refresh_token -> { client_id; client_secret; grant_type; refresh_token }) 2873 + |> Jsont.Object.mem "client_id" Jsont.string ~enc:(fun r -> r.client_id) 2874 + |> Jsont.Object.mem "client_secret" Jsont.string ~enc:(fun r -> r.client_secret) 2875 + |> Jsont.Object.mem "grant_type" Jsont.string ~enc:(fun r -> r.grant_type) 2876 + |> Jsont.Object.mem "refresh_token" Jsont.string ~enc:(fun r -> r.refresh_token) 2877 + |> Jsont.Object.skip_unknown 2878 + |> Jsont.Object.finish 3165 2879 end 3166 2880 end 3167 2881 ··· 3507 3221 let jsont : t Jsont.t = 3508 3222 Jsont.Object.map ~kind:"LiveVideoSessionResponse" 3509 3223 (fun end_date error id replay_video start_date -> { end_date; error; id; replay_video; start_date }) 3510 - |> Jsont.Object.opt_mem "endDate" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.end_date) 3511 - |> Jsont.Object.opt_mem "error" Jsont.int ~enc:(fun r -> r.error) 3224 + |> Jsont.Object.mem "endDate" Openapi.Runtime.nullable_ptime 3225 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.end_date) 3226 + |> Jsont.Object.mem "error" Openapi.Runtime.nullable_int 3227 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.error) 3512 3228 |> Jsont.Object.opt_mem "id" Jsont.int ~enc:(fun r -> r.id) 3513 3229 |> Jsont.Object.opt_mem "replayVideo" Jsont.json ~enc:(fun r -> r.replay_video) 3514 3230 |> Jsont.Object.opt_mem "startDate" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.start_date) ··· 3575 3291 module LiveVideo = struct 3576 3292 module Update = struct 3577 3293 type t = { 3578 - latency_mode : Jsont.json option; (** User can select live latency mode if enabled by the instance *) 3294 + latency_mode : LiveVideoLatencyMode.T.t option; (** User can select live latency mode if enabled by the instance *) 3579 3295 permanent_live : bool option; (** User can stream multiple times in a permanent live *) 3580 3296 replay_settings : LiveVideoReplaySettings.T.t option; 3581 3297 save_replay : bool option; ··· 3593 3309 let jsont : t Jsont.t = 3594 3310 Jsont.Object.map ~kind:"LiveVideoUpdate" 3595 3311 (fun latency_mode permanent_live replay_settings save_replay schedules -> { latency_mode; permanent_live; replay_settings; save_replay; schedules }) 3596 - |> Jsont.Object.opt_mem "latencyMode" Jsont.json ~enc:(fun r -> r.latency_mode) 3312 + |> Jsont.Object.opt_mem "latencyMode" LiveVideoLatencyMode.T.jsont ~enc:(fun r -> r.latency_mode) 3597 3313 |> Jsont.Object.opt_mem "permanentLive" Jsont.bool ~enc:(fun r -> r.permanent_live) 3598 3314 |> Jsont.Object.opt_mem "replaySettings" LiveVideoReplaySettings.T.jsont ~enc:(fun r -> r.replay_settings) 3599 3315 |> Jsont.Object.opt_mem "saveReplay" Jsont.bool ~enc:(fun r -> r.save_replay) ··· 3604 3320 3605 3321 module Response = struct 3606 3322 type t = { 3607 - latency_mode : Jsont.json option; (** User can select live latency mode if enabled by the instance *) 3323 + latency_mode : LiveVideoLatencyMode.T.t option; (** User can select live latency mode if enabled by the instance *) 3608 3324 permanent_live : bool option; (** User can stream multiple times in a permanent live *) 3609 3325 replay_settings : LiveVideoReplaySettings.T.t option; 3610 3326 rtmp_url : string option; (** Included in the response if an appropriate token is provided *) ··· 3628 3344 let jsont : t Jsont.t = 3629 3345 Jsont.Object.map ~kind:"LiveVideoResponse" 3630 3346 (fun latency_mode permanent_live replay_settings rtmp_url rtmps_url save_replay schedules stream_key -> { latency_mode; permanent_live; replay_settings; rtmp_url; rtmps_url; save_replay; schedules; stream_key }) 3631 - |> Jsont.Object.opt_mem "latencyMode" Jsont.json ~enc:(fun r -> r.latency_mode) 3347 + |> Jsont.Object.opt_mem "latencyMode" LiveVideoLatencyMode.T.jsont ~enc:(fun r -> r.latency_mode) 3632 3348 |> Jsont.Object.opt_mem "permanentLive" Jsont.bool ~enc:(fun r -> r.permanent_live) 3633 3349 |> Jsont.Object.opt_mem "replaySettings" LiveVideoReplaySettings.T.jsont ~enc:(fun r -> r.replay_settings) 3634 3350 |> Jsont.Object.opt_mem "rtmpUrl" Jsont.string ~enc:(fun r -> r.rtmp_url) ··· 3835 3551 end 3836 3552 end 3837 3553 3554 + module VideoBlacklist = struct 3555 + module T = struct 3556 + type t = { 3557 + created_at : Ptime.t option; 3558 + description : string option; 3559 + dislikes : int option; 3560 + duration : int option; 3561 + id : Id.T.t option; 3562 + likes : int option; 3563 + name : string option; 3564 + nsfw : bool option; 3565 + updated_at : Ptime.t option; 3566 + uuid : Uuidv4.T.t option; 3567 + video_id : Jsont.json option; 3568 + views : int option; 3569 + } 3570 + 3571 + let v ?created_at ?description ?dislikes ?duration ?id ?likes ?name ?nsfw ?updated_at ?uuid ?video_id ?views () = { created_at; description; dislikes; duration; id; likes; name; nsfw; updated_at; uuid; video_id; views } 3572 + 3573 + let created_at t = t.created_at 3574 + let description t = t.description 3575 + let dislikes t = t.dislikes 3576 + let duration t = t.duration 3577 + let id t = t.id 3578 + let likes t = t.likes 3579 + let name t = t.name 3580 + let nsfw t = t.nsfw 3581 + let updated_at t = t.updated_at 3582 + let uuid t = t.uuid 3583 + let video_id t = t.video_id 3584 + let views t = t.views 3585 + 3586 + let jsont : t Jsont.t = 3587 + Jsont.Object.map ~kind:"VideoBlacklist" 3588 + (fun created_at description dislikes duration id likes name nsfw updated_at uuid video_id views -> { created_at; description; dislikes; duration; id; likes; name; nsfw; updated_at; uuid; video_id; views }) 3589 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 3590 + |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 3591 + |> Jsont.Object.opt_mem "dislikes" Jsont.int ~enc:(fun r -> r.dislikes) 3592 + |> Jsont.Object.opt_mem "duration" Jsont.int ~enc:(fun r -> r.duration) 3593 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3594 + |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 3595 + |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 3596 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 3597 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 3598 + |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 3599 + |> Jsont.Object.opt_mem "videoId" Jsont.json ~enc:(fun r -> r.video_id) 3600 + |> Jsont.Object.opt_mem "views" Jsont.int ~enc:(fun r -> r.views) 3601 + |> Jsont.Object.skip_unknown 3602 + |> Jsont.Object.finish 3603 + end 3604 + end 3605 + 3606 + module UserRegistration = struct 3607 + module Request = struct 3608 + type t = { 3609 + channel : Jsont.json option; (** channel base information used to create the first channel of the user *) 3610 + display_name : string option; (** editable name of the user, displayed in its representations *) 3611 + email : string; (** email of the user, used for login or service communications *) 3612 + password : Password.T.t; 3613 + username : Username.T.t; (** immutable name of the user, used to find or mention its actor *) 3614 + registration_reason : string; (** reason for the user to register on the instance *) 3615 + } 3616 + 3617 + let v ~email ~password ~username ~registration_reason ?channel ?display_name () = { channel; display_name; email; password; username; registration_reason } 3618 + 3619 + let channel t = t.channel 3620 + let display_name t = t.display_name 3621 + let email t = t.email 3622 + let password t = t.password 3623 + let username t = t.username 3624 + let registration_reason t = t.registration_reason 3625 + 3626 + let jsont : t Jsont.t = 3627 + Jsont.Object.map ~kind:"UserRegistrationRequest" 3628 + (fun channel display_name email password username registration_reason -> { channel; display_name; email; password; username; registration_reason }) 3629 + |> Jsont.Object.opt_mem "channel" Jsont.json ~enc:(fun r -> r.channel) 3630 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 3631 + |> Jsont.Object.mem "email" Jsont.string ~enc:(fun r -> r.email) 3632 + |> Jsont.Object.mem "password" Password.T.jsont ~enc:(fun r -> r.password) 3633 + |> Jsont.Object.mem "username" Username.T.jsont ~enc:(fun r -> r.username) 3634 + |> Jsont.Object.mem "registrationReason" Jsont.string ~enc:(fun r -> r.registration_reason) 3635 + |> Jsont.Object.skip_unknown 3636 + |> Jsont.Object.finish 3637 + end 3638 + 3639 + module T = struct 3640 + type t = { 3641 + account_display_name : string option; 3642 + channel_display_name : string option; 3643 + channel_handle : string option; 3644 + created_at : Ptime.t option; 3645 + email : string option; 3646 + email_verified : bool option; 3647 + id : Id.T.t option; 3648 + moderation_response : string option; 3649 + registration_reason : string option; 3650 + state : Jsont.json option; 3651 + updated_at : Ptime.t option; 3652 + user : Jsont.json option; (** If the registration has been accepted, this is a partial user object created by the registration *) 3653 + username : string option; 3654 + } 3655 + 3656 + let v ?account_display_name ?channel_display_name ?channel_handle ?created_at ?email ?email_verified ?id ?moderation_response ?registration_reason ?state ?updated_at ?user ?username () = { account_display_name; channel_display_name; channel_handle; created_at; email; email_verified; id; moderation_response; registration_reason; state; updated_at; user; username } 3657 + 3658 + let account_display_name t = t.account_display_name 3659 + let channel_display_name t = t.channel_display_name 3660 + let channel_handle t = t.channel_handle 3661 + let created_at t = t.created_at 3662 + let email t = t.email 3663 + let email_verified t = t.email_verified 3664 + let id t = t.id 3665 + let moderation_response t = t.moderation_response 3666 + let registration_reason t = t.registration_reason 3667 + let state t = t.state 3668 + let updated_at t = t.updated_at 3669 + let user t = t.user 3670 + let username t = t.username 3671 + 3672 + let jsont : t Jsont.t = 3673 + Jsont.Object.map ~kind:"UserRegistration" 3674 + (fun account_display_name channel_display_name channel_handle created_at email email_verified id moderation_response registration_reason state updated_at user username -> { account_display_name; channel_display_name; channel_handle; created_at; email; email_verified; id; moderation_response; registration_reason; state; updated_at; user; username }) 3675 + |> Jsont.Object.opt_mem "accountDisplayName" Jsont.string ~enc:(fun r -> r.account_display_name) 3676 + |> Jsont.Object.opt_mem "channelDisplayName" Jsont.string ~enc:(fun r -> r.channel_display_name) 3677 + |> Jsont.Object.opt_mem "channelHandle" Jsont.string ~enc:(fun r -> r.channel_handle) 3678 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 3679 + |> Jsont.Object.opt_mem "email" Jsont.string ~enc:(fun r -> r.email) 3680 + |> Jsont.Object.opt_mem "emailVerified" Jsont.bool ~enc:(fun r -> r.email_verified) 3681 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3682 + |> Jsont.Object.mem "moderationResponse" Openapi.Runtime.nullable_string 3683 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.moderation_response) 3684 + |> Jsont.Object.opt_mem "registrationReason" Jsont.string ~enc:(fun r -> r.registration_reason) 3685 + |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 3686 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 3687 + |> Jsont.Object.mem "user" (Openapi.Runtime.nullable_any Jsont.json) 3688 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.user) 3689 + |> Jsont.Object.opt_mem "username" Jsont.string ~enc:(fun r -> r.username) 3690 + |> Jsont.Object.skip_unknown 3691 + |> Jsont.Object.finish 3692 + end 3693 + 3694 + (** Request registration 3695 + 3696 + Signup has to be enabled and require approval on the instance *) 3697 + let request_registration ~body client () = 3698 + let op_name = "request_registration" in 3699 + let url_path = "/api/v1/users/registrations/request" in 3700 + let query = "" in 3701 + let url = client.base_url ^ url_path ^ query in 3702 + let response = 3703 + try Requests.post client.session ~body:(Requests.Body.json (Openapi.Runtime.Json.encode_json Request.jsont body)) url 3704 + with Eio.Io _ as ex -> 3705 + let bt = Printexc.get_raw_backtrace () in 3706 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "POST" url 3707 + in 3708 + if Requests.Response.ok response then 3709 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 3710 + else 3711 + raise (Openapi.Runtime.Api_error { 3712 + operation = op_name; 3713 + method_ = "POST"; 3714 + url; 3715 + status = Requests.Response.status_code response; 3716 + body = Requests.Response.text response; 3717 + }) 3718 + end 3719 + 3720 + module Job = struct 3721 + module T = struct 3722 + type t = { 3723 + created_at : Ptime.t option; 3724 + data : Jsont.json option; 3725 + error : Jsont.json option; 3726 + finished_on : Ptime.t option; 3727 + id : Id.T.t option; 3728 + processed_on : Ptime.t option; 3729 + state : string option; 3730 + type_ : string option; 3731 + } 3732 + 3733 + let v ?created_at ?data ?error ?finished_on ?id ?processed_on ?state ?type_ () = { created_at; data; error; finished_on; id; processed_on; state; type_ } 3734 + 3735 + let created_at t = t.created_at 3736 + let data t = t.data 3737 + let error t = t.error 3738 + let finished_on t = t.finished_on 3739 + let id t = t.id 3740 + let processed_on t = t.processed_on 3741 + let state t = t.state 3742 + let type_ t = t.type_ 3743 + 3744 + let jsont : t Jsont.t = 3745 + Jsont.Object.map ~kind:"Job" 3746 + (fun created_at data error finished_on id processed_on state type_ -> { created_at; data; error; finished_on; id; processed_on; state; type_ }) 3747 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 3748 + |> Jsont.Object.opt_mem "data" Jsont.json ~enc:(fun r -> r.data) 3749 + |> Jsont.Object.opt_mem "error" Jsont.json ~enc:(fun r -> r.error) 3750 + |> Jsont.Object.opt_mem "finishedOn" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.finished_on) 3751 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3752 + |> Jsont.Object.opt_mem "processedOn" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.processed_on) 3753 + |> Jsont.Object.opt_mem "state" Jsont.string ~enc:(fun r -> r.state) 3754 + |> Jsont.Object.opt_mem "type" Jsont.string ~enc:(fun r -> r.type_) 3755 + |> Jsont.Object.skip_unknown 3756 + |> Jsont.Object.finish 3757 + end 3758 + end 3759 + 3760 + module GetMeVideoRating = struct 3761 + module T = struct 3762 + type t = { 3763 + id : Id.T.t; 3764 + rating : string; (** Rating of the video *) 3765 + } 3766 + 3767 + let v ~id ~rating () = { id; rating } 3768 + 3769 + let id t = t.id 3770 + let rating t = t.rating 3771 + 3772 + let jsont : t Jsont.t = 3773 + Jsont.Object.map ~kind:"GetMeVideoRating" 3774 + (fun id rating -> { id; rating }) 3775 + |> Jsont.Object.mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3776 + |> Jsont.Object.mem "rating" Jsont.string ~enc:(fun r -> r.rating) 3777 + |> Jsont.Object.skip_unknown 3778 + |> Jsont.Object.finish 3779 + end 3780 + 3781 + (** Get rate of my user for a video 3782 + @param video_id The video id 3783 + *) 3784 + let get_api_v1_users_me_videos_rating ~video_id client () = 3785 + let op_name = "get_api_v1_users_me_videos_rating" in 3786 + let url_path = Openapi.Runtime.Path.render ~params:[("videoId", video_id)] "/api/v1/users/me/videos/{videoId}/rating" in 3787 + let query = "" in 3788 + let url = client.base_url ^ url_path ^ query in 3789 + let response = 3790 + try Requests.get client.session url 3791 + with Eio.Io _ as ex -> 3792 + let bt = Printexc.get_raw_backtrace () in 3793 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 3794 + in 3795 + if Requests.Response.ok response then 3796 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 3797 + else 3798 + raise (Openapi.Runtime.Api_error { 3799 + operation = op_name; 3800 + method_ = "GET"; 3801 + url; 3802 + status = Requests.Response.status_code response; 3803 + body = Requests.Response.text response; 3804 + }) 3805 + end 3806 + 3807 + module FileRedundancyInformation = struct 3808 + module T = struct 3809 + type t = { 3810 + created_at : Ptime.t option; 3811 + expires_on : Ptime.t option; 3812 + file_url : string option; 3813 + id : Id.T.t option; 3814 + size : int option; 3815 + strategy : string option; 3816 + updated_at : Ptime.t option; 3817 + } 3818 + 3819 + let v ?created_at ?expires_on ?file_url ?id ?size ?strategy ?updated_at () = { created_at; expires_on; file_url; id; size; strategy; updated_at } 3820 + 3821 + let created_at t = t.created_at 3822 + let expires_on t = t.expires_on 3823 + let file_url t = t.file_url 3824 + let id t = t.id 3825 + let size t = t.size 3826 + let strategy t = t.strategy 3827 + let updated_at t = t.updated_at 3828 + 3829 + let jsont : t Jsont.t = 3830 + Jsont.Object.map ~kind:"FileRedundancyInformation" 3831 + (fun created_at expires_on file_url id size strategy updated_at -> { created_at; expires_on; file_url; id; size; strategy; updated_at }) 3832 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 3833 + |> Jsont.Object.opt_mem "expiresOn" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.expires_on) 3834 + |> Jsont.Object.opt_mem "fileUrl" Jsont.string ~enc:(fun r -> r.file_url) 3835 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3836 + |> Jsont.Object.opt_mem "size" Jsont.int ~enc:(fun r -> r.size) 3837 + |> Jsont.Object.opt_mem "strategy" Jsont.string ~enc:(fun r -> r.strategy) 3838 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 3839 + |> Jsont.Object.skip_unknown 3840 + |> Jsont.Object.finish 3841 + end 3842 + end 3843 + 3844 + module FileStorage = struct 3845 + module T = struct 3846 + (** The file storage type: 3847 + - `0` File system 3848 + - `1` Object storage 3849 + *) 3850 + type t = string 3851 + 3852 + let jsont = Jsont.string 3853 + end 3854 + end 3855 + 3856 + module VideoFile = struct 3857 + module T = struct 3858 + type t = { 3859 + file_download_url : string option; (** URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) *) 3860 + file_url : string option; (** Direct URL of the video *) 3861 + fps : float option; (** Frames per second of the video file *) 3862 + has_audio : bool option; (** **PeerTube >= 6.2** The file container has an audio stream *) 3863 + has_video : bool option; (** **PeerTube >= 6.2** The file container has a video stream *) 3864 + height : float option; (** **PeerTube >= 6.1** Video stream height *) 3865 + id : Id.T.t option; 3866 + magnet_uri : string option; (** magnet URI allowing to resolve the video via BitTorrent without a metainfo file *) 3867 + metadata_url : string option; (** URL dereferencing the output of ffprobe on the file *) 3868 + playlist_url : string option; (** Playlist URL of the file if it is owned by a playlist *) 3869 + resolution : VideoResolutionConstant.T.t option; 3870 + size : int option; (** Video file size in bytes *) 3871 + storage : FileStorage.T.t option; 3872 + torrent_download_url : string option; (** URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) *) 3873 + torrent_url : string option; (** Direct URL of the torrent file *) 3874 + width : float option; (** **PeerTube >= 6.1** Video stream width *) 3875 + } 3876 + 3877 + let v ?file_download_url ?file_url ?fps ?has_audio ?has_video ?height ?id ?magnet_uri ?metadata_url ?playlist_url ?resolution ?size ?storage ?torrent_download_url ?torrent_url ?width () = { file_download_url; file_url; fps; has_audio; has_video; height; id; magnet_uri; metadata_url; playlist_url; resolution; size; storage; torrent_download_url; torrent_url; width } 3878 + 3879 + let file_download_url t = t.file_download_url 3880 + let file_url t = t.file_url 3881 + let fps t = t.fps 3882 + let has_audio t = t.has_audio 3883 + let has_video t = t.has_video 3884 + let height t = t.height 3885 + let id t = t.id 3886 + let magnet_uri t = t.magnet_uri 3887 + let metadata_url t = t.metadata_url 3888 + let playlist_url t = t.playlist_url 3889 + let resolution t = t.resolution 3890 + let size t = t.size 3891 + let storage t = t.storage 3892 + let torrent_download_url t = t.torrent_download_url 3893 + let torrent_url t = t.torrent_url 3894 + let width t = t.width 3895 + 3896 + let jsont : t Jsont.t = 3897 + Jsont.Object.map ~kind:"VideoFile" 3898 + (fun file_download_url file_url fps has_audio has_video height id magnet_uri metadata_url playlist_url resolution size storage torrent_download_url torrent_url width -> { file_download_url; file_url; fps; has_audio; has_video; height; id; magnet_uri; metadata_url; playlist_url; resolution; size; storage; torrent_download_url; torrent_url; width }) 3899 + |> Jsont.Object.opt_mem "fileDownloadUrl" Jsont.string ~enc:(fun r -> r.file_download_url) 3900 + |> Jsont.Object.opt_mem "fileUrl" Jsont.string ~enc:(fun r -> r.file_url) 3901 + |> Jsont.Object.opt_mem "fps" Jsont.number ~enc:(fun r -> r.fps) 3902 + |> Jsont.Object.opt_mem "hasAudio" Jsont.bool ~enc:(fun r -> r.has_audio) 3903 + |> Jsont.Object.opt_mem "hasVideo" Jsont.bool ~enc:(fun r -> r.has_video) 3904 + |> Jsont.Object.opt_mem "height" Jsont.number ~enc:(fun r -> r.height) 3905 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3906 + |> Jsont.Object.opt_mem "magnetUri" Jsont.string ~enc:(fun r -> r.magnet_uri) 3907 + |> Jsont.Object.opt_mem "metadataUrl" Jsont.string ~enc:(fun r -> r.metadata_url) 3908 + |> Jsont.Object.opt_mem "playlistUrl" Jsont.string ~enc:(fun r -> r.playlist_url) 3909 + |> Jsont.Object.opt_mem "resolution" VideoResolutionConstant.T.jsont ~enc:(fun r -> r.resolution) 3910 + |> Jsont.Object.opt_mem "size" Jsont.int ~enc:(fun r -> r.size) 3911 + |> Jsont.Object.opt_mem "storage" FileStorage.T.jsont ~enc:(fun r -> r.storage) 3912 + |> Jsont.Object.opt_mem "torrentDownloadUrl" Jsont.string ~enc:(fun r -> r.torrent_download_url) 3913 + |> Jsont.Object.opt_mem "torrentUrl" Jsont.string ~enc:(fun r -> r.torrent_url) 3914 + |> Jsont.Object.opt_mem "width" Jsont.number ~enc:(fun r -> r.width) 3915 + |> Jsont.Object.skip_unknown 3916 + |> Jsont.Object.finish 3917 + end 3918 + end 3919 + 3920 + module VideoStreamingPlaylistsHls = struct 3921 + module T = struct 3922 + type t = { 3923 + files : VideoFile.T.t list option; (** Video files associated to this playlist. 3924 + 3925 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 3926 + *) 3927 + playlist_url : string option; 3928 + redundancies : Jsont.json list option; 3929 + segments_sha256_url : string option; 3930 + } 3931 + 3932 + let v ?files ?playlist_url ?redundancies ?segments_sha256_url () = { files; playlist_url; redundancies; segments_sha256_url } 3933 + 3934 + let files t = t.files 3935 + let playlist_url t = t.playlist_url 3936 + let redundancies t = t.redundancies 3937 + let segments_sha256_url t = t.segments_sha256_url 3938 + 3939 + let jsont : t Jsont.t = 3940 + Jsont.Object.map ~kind:"VideoStreamingPlaylists-HLS" 3941 + (fun files playlist_url redundancies segments_sha256_url -> { files; playlist_url; redundancies; segments_sha256_url }) 3942 + |> Jsont.Object.opt_mem "files" (Jsont.list VideoFile.T.jsont) ~enc:(fun r -> r.files) 3943 + |> Jsont.Object.opt_mem "playlistUrl" Jsont.string ~enc:(fun r -> r.playlist_url) 3944 + |> Jsont.Object.opt_mem "redundancies" (Jsont.list Jsont.json) ~enc:(fun r -> r.redundancies) 3945 + |> Jsont.Object.opt_mem "segmentsSha256Url" Jsont.string ~enc:(fun r -> r.segments_sha256_url) 3946 + |> Jsont.Object.skip_unknown 3947 + |> Jsont.Object.finish 3948 + end 3949 + end 3950 + 3951 + module VideoStreamingPlaylists = struct 3952 + module T = struct 3953 + type t = { 3954 + id : Id.T.t option; 3955 + type_ : int option; (** Playlist type: 3956 + - `1`: HLS 3957 + *) 3958 + files : VideoFile.T.t list option; (** Video files associated to this playlist. 3959 + 3960 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 3961 + *) 3962 + playlist_url : string option; 3963 + redundancies : Jsont.json list option; 3964 + segments_sha256_url : string option; 3965 + } 3966 + 3967 + let v ?id ?type_ ?files ?playlist_url ?redundancies ?segments_sha256_url () = { id; type_; files; playlist_url; redundancies; segments_sha256_url } 3968 + 3969 + let id t = t.id 3970 + let type_ t = t.type_ 3971 + let files t = t.files 3972 + let playlist_url t = t.playlist_url 3973 + let redundancies t = t.redundancies 3974 + let segments_sha256_url t = t.segments_sha256_url 3975 + 3976 + let jsont : t Jsont.t = 3977 + Jsont.Object.map ~kind:"VideoStreamingPlaylists" 3978 + (fun id type_ files playlist_url redundancies segments_sha256_url -> { id; type_; files; playlist_url; redundancies; segments_sha256_url }) 3979 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3980 + |> Jsont.Object.opt_mem "type" Jsont.int ~enc:(fun r -> r.type_) 3981 + |> Jsont.Object.opt_mem "files" (Jsont.list VideoFile.T.jsont) ~enc:(fun r -> r.files) 3982 + |> Jsont.Object.opt_mem "playlistUrl" Jsont.string ~enc:(fun r -> r.playlist_url) 3983 + |> Jsont.Object.opt_mem "redundancies" (Jsont.list Jsont.json) ~enc:(fun r -> r.redundancies) 3984 + |> Jsont.Object.opt_mem "segmentsSha256Url" Jsont.string ~enc:(fun r -> r.segments_sha256_url) 3985 + |> Jsont.Object.skip_unknown 3986 + |> Jsont.Object.finish 3987 + end 3988 + end 3989 + 3990 + module CustomHomepage = struct 3991 + module T = struct 3992 + type t = { 3993 + content : string option; 3994 + } 3995 + 3996 + let v ?content () = { content } 3997 + 3998 + let content t = t.content 3999 + 4000 + let jsont : t Jsont.t = 4001 + Jsont.Object.map ~kind:"CustomHomepage" 4002 + (fun content -> { content }) 4003 + |> Jsont.Object.opt_mem "content" Jsont.string ~enc:(fun r -> r.content) 4004 + |> Jsont.Object.skip_unknown 4005 + |> Jsont.Object.finish 4006 + end 4007 + 4008 + (** Get instance custom homepage *) 4009 + let get_api_v1_custom_pages_homepage_instance client () = 4010 + let op_name = "get_api_v1_custom_pages_homepage_instance" in 4011 + let url_path = "/api/v1/custom-pages/homepage/instance" in 4012 + let query = "" in 4013 + let url = client.base_url ^ url_path ^ query in 4014 + let response = 4015 + try Requests.get client.session url 4016 + with Eio.Io _ as ex -> 4017 + let bt = Printexc.get_raw_backtrace () in 4018 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4019 + in 4020 + if Requests.Response.ok response then 4021 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4022 + else 4023 + raise (Openapi.Runtime.Api_error { 4024 + operation = op_name; 4025 + method_ = "GET"; 4026 + url; 4027 + status = Requests.Response.status_code response; 4028 + body = Requests.Response.text response; 4029 + }) 4030 + end 4031 + 4032 + module CommentAutoTagPolicies = struct 4033 + module T = struct 4034 + type t = { 4035 + review : string list option; (** Auto tags that automatically set the comment in review state *) 4036 + } 4037 + 4038 + let v ?review () = { review } 4039 + 4040 + let review t = t.review 4041 + 4042 + let jsont : t Jsont.t = 4043 + Jsont.Object.map ~kind:"CommentAutoTagPolicies" 4044 + (fun review -> { review }) 4045 + |> Jsont.Object.opt_mem "review" (Jsont.list Jsont.string) ~enc:(fun r -> r.review) 4046 + |> Jsont.Object.skip_unknown 4047 + |> Jsont.Object.finish 4048 + end 4049 + 4050 + (** Get account auto tag policies on comments 4051 + 4052 + **PeerTube >= 6.2** 4053 + @param account_name account name to get auto tag policies 4054 + *) 4055 + let get_api_v1_automatic_tags_policies_accounts_comments ~account_name client () = 4056 + let op_name = "get_api_v1_automatic_tags_policies_accounts_comments" in 4057 + let url_path = Openapi.Runtime.Path.render ~params:[("accountName", account_name)] "/api/v1/automatic-tags/policies/accounts/{accountName}/comments" in 4058 + let query = "" in 4059 + let url = client.base_url ^ url_path ^ query in 4060 + let response = 4061 + try Requests.get client.session url 4062 + with Eio.Io _ as ex -> 4063 + let bt = Printexc.get_raw_backtrace () in 4064 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4065 + in 4066 + if Requests.Response.ok response then 4067 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4068 + else 4069 + raise (Openapi.Runtime.Api_error { 4070 + operation = op_name; 4071 + method_ = "GET"; 4072 + url; 4073 + status = Requests.Response.status_code response; 4074 + body = Requests.Response.text response; 4075 + }) 4076 + end 4077 + 4078 + module ChannelActivityList = struct 4079 + module Response = struct 4080 + type t = { 4081 + data : Jsont.json list option; 4082 + total : int option; 4083 + } 4084 + 4085 + let v ?data ?total () = { data; total } 4086 + 4087 + let data t = t.data 4088 + let total t = t.total 4089 + 4090 + let jsont : t Jsont.t = 4091 + Jsont.Object.map ~kind:"ChannelActivityListResponse" 4092 + (fun data total -> { data; total }) 4093 + |> Jsont.Object.opt_mem "data" (Jsont.list Jsont.json) ~enc:(fun r -> r.data) 4094 + |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 4095 + |> Jsont.Object.skip_unknown 4096 + |> Jsont.Object.finish 4097 + end 4098 + 4099 + (** List activities of a video channel 4100 + 4101 + **PeerTube >= 8.0** 4102 + @param channel_handle The video channel handle 4103 + @param start Offset used to paginate results 4104 + @param count Number of items to return 4105 + @param sort Sort column 4106 + *) 4107 + let list_video_channel_activities ~channel_handle ?start ?count ?sort client () = 4108 + let op_name = "list_video_channel_activities" in 4109 + let url_path = Openapi.Runtime.Path.render ~params:[("channelHandle", channel_handle)] "/api/v1/video-channels/{channelHandle}/activities" in 4110 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 4111 + let url = client.base_url ^ url_path ^ query in 4112 + let response = 4113 + try Requests.get client.session url 4114 + with Eio.Io _ as ex -> 4115 + let bt = Printexc.get_raw_backtrace () in 4116 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4117 + in 4118 + if Requests.Response.ok response then 4119 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 4120 + else 4121 + raise (Openapi.Runtime.Api_error { 4122 + operation = op_name; 4123 + method_ = "GET"; 4124 + url; 4125 + status = Requests.Response.status_code response; 4126 + body = Requests.Response.text response; 4127 + }) 4128 + end 4129 + 4130 + module Block = struct 4131 + module Status = struct 4132 + type t = { 4133 + accounts : Jsont.json option; 4134 + hosts : Jsont.json option; 4135 + } 4136 + 4137 + let v ?accounts ?hosts () = { accounts; hosts } 4138 + 4139 + let accounts t = t.accounts 4140 + let hosts t = t.hosts 4141 + 4142 + let jsont : t Jsont.t = 4143 + Jsont.Object.map ~kind:"BlockStatus" 4144 + (fun accounts hosts -> { accounts; hosts }) 4145 + |> Jsont.Object.opt_mem "accounts" Jsont.json ~enc:(fun r -> r.accounts) 4146 + |> Jsont.Object.opt_mem "hosts" Jsont.json ~enc:(fun r -> r.hosts) 4147 + |> Jsont.Object.skip_unknown 4148 + |> Jsont.Object.finish 4149 + end 4150 + 4151 + (** Get block status of accounts/hosts 4152 + @param accounts Check if these accounts are blocked 4153 + @param hosts Check if these hosts are blocked 4154 + *) 4155 + let get_api_v1_blocklist_status ?accounts ?hosts client () = 4156 + let op_name = "get_api_v1_blocklist_status" in 4157 + let url_path = "/api/v1/blocklist/status" in 4158 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"accounts" ~value:accounts; Openapi.Runtime.Query.optional ~key:"hosts" ~value:hosts]) in 4159 + let url = client.base_url ^ url_path ^ query in 4160 + let response = 4161 + try Requests.get client.session url 4162 + with Eio.Io _ as ex -> 4163 + let bt = Printexc.get_raw_backtrace () in 4164 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4165 + in 4166 + if Requests.Response.ok response then 4167 + Openapi.Runtime.Json.decode_json_exn Status.jsont (Requests.Response.json response) 4168 + else 4169 + raise (Openapi.Runtime.Api_error { 4170 + operation = op_name; 4171 + method_ = "GET"; 4172 + url; 4173 + status = Requests.Response.status_code response; 4174 + body = Requests.Response.text response; 4175 + }) 4176 + end 4177 + 4178 + module AutomaticTagAvailable = struct 4179 + module T = struct 4180 + type t = { 4181 + available : Jsont.json list option; (** Available auto tags that can be used to filter objects or set a comment in review state *) 4182 + } 4183 + 4184 + let v ?available () = { available } 4185 + 4186 + let available t = t.available 4187 + 4188 + let jsont : t Jsont.t = 4189 + Jsont.Object.map ~kind:"AutomaticTagAvailable" 4190 + (fun available -> { available }) 4191 + |> Jsont.Object.opt_mem "available" (Jsont.list Jsont.json) ~enc:(fun r -> r.available) 4192 + |> Jsont.Object.skip_unknown 4193 + |> Jsont.Object.finish 4194 + end 4195 + 4196 + (** Get account available auto tags 4197 + 4198 + **PeerTube >= 6.2** 4199 + @param account_name account name to get auto tag policies 4200 + *) 4201 + let get_api_v1_automatic_tags_accounts_available ~account_name client () = 4202 + let op_name = "get_api_v1_automatic_tags_accounts_available" in 4203 + let url_path = Openapi.Runtime.Path.render ~params:[("accountName", account_name)] "/api/v1/automatic-tags/accounts/{accountName}/available" in 4204 + let query = "" in 4205 + let url = client.base_url ^ url_path ^ query in 4206 + let response = 4207 + try Requests.get client.session url 4208 + with Eio.Io _ as ex -> 4209 + let bt = Printexc.get_raw_backtrace () in 4210 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4211 + in 4212 + if Requests.Response.ok response then 4213 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4214 + else 4215 + raise (Openapi.Runtime.Api_error { 4216 + operation = op_name; 4217 + method_ = "GET"; 4218 + url; 4219 + status = Requests.Response.status_code response; 4220 + body = Requests.Response.text response; 4221 + }) 4222 + 4223 + (** Get server available auto tags 4224 + 4225 + **PeerTube >= 6.2** *) 4226 + let get_api_v1_automatic_tags_server_available client () = 4227 + let op_name = "get_api_v1_automatic_tags_server_available" in 4228 + let url_path = "/api/v1/automatic-tags/server/available" in 4229 + let query = "" in 4230 + let url = client.base_url ^ url_path ^ query in 4231 + let response = 4232 + try Requests.get client.session url 4233 + with Eio.Io _ as ex -> 4234 + let bt = Printexc.get_raw_backtrace () in 4235 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4236 + in 4237 + if Requests.Response.ok response then 4238 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4239 + else 4240 + raise (Openapi.Runtime.Api_error { 4241 + operation = op_name; 4242 + method_ = "GET"; 4243 + url; 4244 + status = Requests.Response.status_code response; 4245 + body = Requests.Response.text response; 4246 + }) 4247 + end 4248 + 4249 + module AddVideoPasswords = struct 4250 + module T = struct 4251 + type t = Jsont.json 4252 + 4253 + let jsont = Jsont.json 4254 + 4255 + let v () = Jsont.Null ((), Jsont.Meta.none) 4256 + end 4257 + end 4258 + 4259 + module VideoUploadRequestResumable = struct 4260 + module T = struct 4261 + type t = { 4262 + category : VideoCategorySet.T.t option; 4263 + channel_id : int; (** Channel id that will contain this video *) 4264 + comments_policy : VideoCommentsPolicySet.T.t option; 4265 + description : string option; (** Video description *) 4266 + download_enabled : bool option; (** Enable or disable downloading for this video *) 4267 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 4268 + language : VideoLanguageSet.T.t option; 4269 + licence : VideoLicenceSet.T.t option; 4270 + name : string; (** Video name *) 4271 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 4272 + nsfw_flags : Nsfwflag.T.t option; 4273 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 4274 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 4275 + privacy : VideoPrivacySet.T.t option; 4276 + schedule_update : VideoScheduled.Update.t option; 4277 + support : string option; (** A text tell the audience how to support the video creator *) 4278 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 4279 + video_passwords : AddVideoPasswords.T.t option; 4280 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 4281 + filename : string; (** Video filename including extension *) 4282 + thumbnailfile : string option; (** Video thumbnail file *) 4283 + previewfile : string option; (** Video preview file *) 4284 + } 4285 + 4286 + let v ~channel_id ~name ~filename ?category ?comments_policy ?description ?download_enabled ?generate_transcription ?language ?licence ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?privacy ?schedule_update ?support ?tags ?video_passwords ?wait_transcoding ?thumbnailfile ?previewfile () = { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; privacy; schedule_update; support; tags; video_passwords; wait_transcoding; filename; thumbnailfile; previewfile } 4287 + 4288 + let category t = t.category 4289 + let channel_id t = t.channel_id 4290 + let comments_policy t = t.comments_policy 4291 + let description t = t.description 4292 + let download_enabled t = t.download_enabled 4293 + let generate_transcription t = t.generate_transcription 4294 + let language t = t.language 4295 + let licence t = t.licence 4296 + let name t = t.name 4297 + let nsfw t = t.nsfw 4298 + let nsfw_flags t = t.nsfw_flags 4299 + let nsfw_summary t = t.nsfw_summary 4300 + let originally_published_at t = t.originally_published_at 4301 + let privacy t = t.privacy 4302 + let schedule_update t = t.schedule_update 4303 + let support t = t.support 4304 + let tags t = t.tags 4305 + let video_passwords t = t.video_passwords 4306 + let wait_transcoding t = t.wait_transcoding 4307 + let filename t = t.filename 4308 + let thumbnailfile t = t.thumbnailfile 4309 + let previewfile t = t.previewfile 4310 + 4311 + let jsont : t Jsont.t = 4312 + Jsont.Object.map ~kind:"VideoUploadRequestResumable" 4313 + (fun category channel_id comments_policy description download_enabled generate_transcription language licence name nsfw nsfw_flags nsfw_summary originally_published_at privacy schedule_update support tags video_passwords wait_transcoding filename thumbnailfile previewfile -> { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; privacy; schedule_update; support; tags; video_passwords; wait_transcoding; filename; thumbnailfile; previewfile }) 4314 + |> Jsont.Object.opt_mem "category" VideoCategorySet.T.jsont ~enc:(fun r -> r.category) 4315 + |> Jsont.Object.mem "channelId" Jsont.int ~enc:(fun r -> r.channel_id) 4316 + |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4317 + |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4318 + |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4319 + |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4320 + |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4321 + |> Jsont.Object.opt_mem "licence" VideoLicenceSet.T.jsont ~enc:(fun r -> r.licence) 4322 + |> Jsont.Object.mem "name" Jsont.string ~enc:(fun r -> r.name) 4323 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4324 + |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4325 + |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) 4326 + |> Jsont.Object.opt_mem "originallyPublishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.originally_published_at) 4327 + |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4328 + |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4329 + |> Jsont.Object.opt_mem "support" Jsont.string ~enc:(fun r -> r.support) 4330 + |> Jsont.Object.opt_mem "tags" (Jsont.list Jsont.string) ~enc:(fun r -> r.tags) 4331 + |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4332 + |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 4333 + |> Jsont.Object.mem "filename" Jsont.string ~enc:(fun r -> r.filename) 4334 + |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4335 + |> Jsont.Object.opt_mem "previewfile" Jsont.string ~enc:(fun r -> r.previewfile) 4336 + |> Jsont.Object.skip_unknown 4337 + |> Jsont.Object.finish 4338 + end 4339 + end 4340 + 4341 + module VideoUploadRequestLegacy = struct 4342 + module T = struct 4343 + type t = { 4344 + category : VideoCategorySet.T.t option; 4345 + channel_id : int; (** Channel id that will contain this video *) 4346 + comments_policy : VideoCommentsPolicySet.T.t option; 4347 + description : string option; (** Video description *) 4348 + download_enabled : bool option; (** Enable or disable downloading for this video *) 4349 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 4350 + language : VideoLanguageSet.T.t option; 4351 + licence : VideoLicenceSet.T.t option; 4352 + name : string; (** Video name *) 4353 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 4354 + nsfw_flags : Nsfwflag.T.t option; 4355 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 4356 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 4357 + previewfile : string option; (** Video preview file *) 4358 + privacy : VideoPrivacySet.T.t option; 4359 + schedule_update : VideoScheduled.Update.t option; 4360 + support : string option; (** A text tell the audience how to support the video creator *) 4361 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 4362 + thumbnailfile : string option; (** Video thumbnail file *) 4363 + video_passwords : AddVideoPasswords.T.t option; 4364 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 4365 + videofile : string; (** Video file *) 4366 + } 4367 + 4368 + let v ~channel_id ~name ~videofile ?category ?comments_policy ?description ?download_enabled ?generate_transcription ?language ?licence ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?previewfile ?privacy ?schedule_update ?support ?tags ?thumbnailfile ?video_passwords ?wait_transcoding () = { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding; videofile } 4369 + 4370 + let category t = t.category 4371 + let channel_id t = t.channel_id 4372 + let comments_policy t = t.comments_policy 4373 + let description t = t.description 4374 + let download_enabled t = t.download_enabled 4375 + let generate_transcription t = t.generate_transcription 4376 + let language t = t.language 4377 + let licence t = t.licence 4378 + let name t = t.name 4379 + let nsfw t = t.nsfw 4380 + let nsfw_flags t = t.nsfw_flags 4381 + let nsfw_summary t = t.nsfw_summary 4382 + let originally_published_at t = t.originally_published_at 4383 + let previewfile t = t.previewfile 4384 + let privacy t = t.privacy 4385 + let schedule_update t = t.schedule_update 4386 + let support t = t.support 4387 + let tags t = t.tags 4388 + let thumbnailfile t = t.thumbnailfile 4389 + let video_passwords t = t.video_passwords 4390 + let wait_transcoding t = t.wait_transcoding 4391 + let videofile t = t.videofile 4392 + 4393 + let jsont : t Jsont.t = 4394 + Jsont.Object.map ~kind:"VideoUploadRequestLegacy" 4395 + (fun category channel_id comments_policy description download_enabled generate_transcription language licence name nsfw nsfw_flags nsfw_summary originally_published_at previewfile privacy schedule_update support tags thumbnailfile video_passwords wait_transcoding videofile -> { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding; videofile }) 4396 + |> Jsont.Object.opt_mem "category" VideoCategorySet.T.jsont ~enc:(fun r -> r.category) 4397 + |> Jsont.Object.mem "channelId" Jsont.int ~enc:(fun r -> r.channel_id) 4398 + |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4399 + |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4400 + |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4401 + |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4402 + |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4403 + |> Jsont.Object.opt_mem "licence" VideoLicenceSet.T.jsont ~enc:(fun r -> r.licence) 4404 + |> Jsont.Object.mem "name" Jsont.string ~enc:(fun r -> r.name) 4405 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4406 + |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4407 + |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) 4408 + |> Jsont.Object.opt_mem "originallyPublishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.originally_published_at) 4409 + |> Jsont.Object.opt_mem "previewfile" Jsont.string ~enc:(fun r -> r.previewfile) 4410 + |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4411 + |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4412 + |> Jsont.Object.opt_mem "support" Jsont.string ~enc:(fun r -> r.support) 4413 + |> Jsont.Object.opt_mem "tags" (Jsont.list Jsont.string) ~enc:(fun r -> r.tags) 4414 + |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4415 + |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4416 + |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 4417 + |> Jsont.Object.mem "videofile" Jsont.string ~enc:(fun r -> r.videofile) 4418 + |> Jsont.Object.skip_unknown 4419 + |> Jsont.Object.finish 4420 + end 4421 + end 4422 + 4423 + module VideoUploadRequestCommon = struct 4424 + module T = struct 4425 + type t = { 4426 + category : VideoCategorySet.T.t option; 4427 + channel_id : int; (** Channel id that will contain this video *) 4428 + comments_policy : VideoCommentsPolicySet.T.t option; 4429 + description : string option; (** Video description *) 4430 + download_enabled : bool option; (** Enable or disable downloading for this video *) 4431 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 4432 + language : VideoLanguageSet.T.t option; 4433 + licence : VideoLicenceSet.T.t option; 4434 + name : string; (** Video name *) 4435 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 4436 + nsfw_flags : Nsfwflag.T.t option; 4437 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 4438 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 4439 + previewfile : string option; (** Video preview file *) 4440 + privacy : VideoPrivacySet.T.t option; 4441 + schedule_update : VideoScheduled.Update.t option; 4442 + support : string option; (** A text tell the audience how to support the video creator *) 4443 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 4444 + thumbnailfile : string option; (** Video thumbnail file *) 4445 + video_passwords : AddVideoPasswords.T.t option; 4446 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 4447 + } 4448 + 4449 + let v ~channel_id ~name ?category ?comments_policy ?description ?download_enabled ?generate_transcription ?language ?licence ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?previewfile ?privacy ?schedule_update ?support ?tags ?thumbnailfile ?video_passwords ?wait_transcoding () = { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding } 4450 + 4451 + let category t = t.category 4452 + let channel_id t = t.channel_id 4453 + let comments_policy t = t.comments_policy 4454 + let description t = t.description 4455 + let download_enabled t = t.download_enabled 4456 + let generate_transcription t = t.generate_transcription 4457 + let language t = t.language 4458 + let licence t = t.licence 4459 + let name t = t.name 4460 + let nsfw t = t.nsfw 4461 + let nsfw_flags t = t.nsfw_flags 4462 + let nsfw_summary t = t.nsfw_summary 4463 + let originally_published_at t = t.originally_published_at 4464 + let previewfile t = t.previewfile 4465 + let privacy t = t.privacy 4466 + let schedule_update t = t.schedule_update 4467 + let support t = t.support 4468 + let tags t = t.tags 4469 + let thumbnailfile t = t.thumbnailfile 4470 + let video_passwords t = t.video_passwords 4471 + let wait_transcoding t = t.wait_transcoding 4472 + 4473 + let jsont : t Jsont.t = 4474 + Jsont.Object.map ~kind:"VideoUploadRequestCommon" 4475 + (fun category channel_id comments_policy description download_enabled generate_transcription language licence name nsfw nsfw_flags nsfw_summary originally_published_at previewfile privacy schedule_update support tags thumbnailfile video_passwords wait_transcoding -> { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding }) 4476 + |> Jsont.Object.opt_mem "category" VideoCategorySet.T.jsont ~enc:(fun r -> r.category) 4477 + |> Jsont.Object.mem "channelId" Jsont.int ~enc:(fun r -> r.channel_id) 4478 + |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4479 + |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4480 + |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4481 + |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4482 + |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4483 + |> Jsont.Object.opt_mem "licence" VideoLicenceSet.T.jsont ~enc:(fun r -> r.licence) 4484 + |> Jsont.Object.mem "name" Jsont.string ~enc:(fun r -> r.name) 4485 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4486 + |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4487 + |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) 4488 + |> Jsont.Object.opt_mem "originallyPublishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.originally_published_at) 4489 + |> Jsont.Object.opt_mem "previewfile" Jsont.string ~enc:(fun r -> r.previewfile) 4490 + |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4491 + |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4492 + |> Jsont.Object.opt_mem "support" Jsont.string ~enc:(fun r -> r.support) 4493 + |> Jsont.Object.opt_mem "tags" (Jsont.list Jsont.string) ~enc:(fun r -> r.tags) 4494 + |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4495 + |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4496 + |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 4497 + |> Jsont.Object.skip_unknown 4498 + |> Jsont.Object.finish 4499 + end 4500 + end 4501 + 4502 + module VideoCreateImport = struct 4503 + module T = struct 4504 + type t = { 4505 + category : VideoCategorySet.T.t option; 4506 + channel_id : int; (** Channel id that will contain this video *) 4507 + comments_policy : VideoCommentsPolicySet.T.t option; 4508 + description : string option; (** Video description *) 4509 + download_enabled : bool option; (** Enable or disable downloading for this video *) 4510 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 4511 + language : VideoLanguageSet.T.t option; 4512 + licence : VideoLicenceSet.T.t option; 4513 + name : string; (** Video name *) 4514 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 4515 + nsfw_flags : Nsfwflag.T.t option; 4516 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 4517 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 4518 + previewfile : string option; (** Video preview file *) 4519 + privacy : VideoPrivacySet.T.t option; 4520 + schedule_update : VideoScheduled.Update.t option; 4521 + support : string option; (** A text tell the audience how to support the video creator *) 4522 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 4523 + thumbnailfile : string option; (** Video thumbnail file *) 4524 + video_passwords : AddVideoPasswords.T.t option; 4525 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 4526 + } 4527 + 4528 + let v ~channel_id ~name ?category ?comments_policy ?description ?download_enabled ?generate_transcription ?language ?licence ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?previewfile ?privacy ?schedule_update ?support ?tags ?thumbnailfile ?video_passwords ?wait_transcoding () = { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding } 4529 + 4530 + let category t = t.category 4531 + let channel_id t = t.channel_id 4532 + let comments_policy t = t.comments_policy 4533 + let description t = t.description 4534 + let download_enabled t = t.download_enabled 4535 + let generate_transcription t = t.generate_transcription 4536 + let language t = t.language 4537 + let licence t = t.licence 4538 + let name t = t.name 4539 + let nsfw t = t.nsfw 4540 + let nsfw_flags t = t.nsfw_flags 4541 + let nsfw_summary t = t.nsfw_summary 4542 + let originally_published_at t = t.originally_published_at 4543 + let previewfile t = t.previewfile 4544 + let privacy t = t.privacy 4545 + let schedule_update t = t.schedule_update 4546 + let support t = t.support 4547 + let tags t = t.tags 4548 + let thumbnailfile t = t.thumbnailfile 4549 + let video_passwords t = t.video_passwords 4550 + let wait_transcoding t = t.wait_transcoding 4551 + 4552 + let jsont : t Jsont.t = 4553 + Jsont.Object.map ~kind:"VideoCreateImport" 4554 + (fun category channel_id comments_policy description download_enabled generate_transcription language licence name nsfw nsfw_flags nsfw_summary originally_published_at previewfile privacy schedule_update support tags thumbnailfile video_passwords wait_transcoding -> { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding }) 4555 + |> Jsont.Object.opt_mem "category" VideoCategorySet.T.jsont ~enc:(fun r -> r.category) 4556 + |> Jsont.Object.mem "channelId" Jsont.int ~enc:(fun r -> r.channel_id) 4557 + |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4558 + |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4559 + |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4560 + |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4561 + |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4562 + |> Jsont.Object.opt_mem "licence" VideoLicenceSet.T.jsont ~enc:(fun r -> r.licence) 4563 + |> Jsont.Object.mem "name" Jsont.string ~enc:(fun r -> r.name) 4564 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4565 + |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4566 + |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) 4567 + |> Jsont.Object.opt_mem "originallyPublishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.originally_published_at) 4568 + |> Jsont.Object.opt_mem "previewfile" Jsont.string ~enc:(fun r -> r.previewfile) 4569 + |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4570 + |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4571 + |> Jsont.Object.opt_mem "support" Jsont.string ~enc:(fun r -> r.support) 4572 + |> Jsont.Object.opt_mem "tags" (Jsont.list Jsont.string) ~enc:(fun r -> r.tags) 4573 + |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4574 + |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4575 + |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 4576 + |> Jsont.Object.skip_unknown 4577 + |> Jsont.Object.finish 4578 + end 4579 + end 4580 + 4581 + module ActorImage = struct 4582 + module T = struct 4583 + type t = { 4584 + created_at : Ptime.t option; 4585 + file_url : string option; (** **PeerTube >= 7.1** *) 4586 + height : int option; (** **PeerTube >= 7.3** *) 4587 + path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 4588 + updated_at : Ptime.t option; 4589 + width : int option; 4590 + } 4591 + 4592 + let v ?created_at ?file_url ?height ?path ?updated_at ?width () = { created_at; file_url; height; path; updated_at; width } 4593 + 4594 + let created_at t = t.created_at 4595 + let file_url t = t.file_url 4596 + let height t = t.height 4597 + let path t = t.path 4598 + let updated_at t = t.updated_at 4599 + let width t = t.width 4600 + 4601 + let jsont : t Jsont.t = 4602 + Jsont.Object.map ~kind:"ActorImage" 4603 + (fun created_at file_url height path updated_at width -> { created_at; file_url; height; path; updated_at; width }) 4604 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 4605 + |> Jsont.Object.opt_mem "fileUrl" Jsont.string ~enc:(fun r -> r.file_url) 4606 + |> Jsont.Object.opt_mem "height" Jsont.int ~enc:(fun r -> r.height) 4607 + |> Jsont.Object.opt_mem "path" Jsont.string ~enc:(fun r -> r.path) 4608 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 4609 + |> Jsont.Object.opt_mem "width" Jsont.int ~enc:(fun r -> r.width) 4610 + |> Jsont.Object.skip_unknown 4611 + |> Jsont.Object.finish 4612 + end 4613 + end 4614 + 4615 + module VideoChannelSummary = struct 4616 + module T = struct 4617 + type t = { 4618 + avatars : ActorImage.T.t list option; 4619 + display_name : string option; 4620 + host : string option; 4621 + id : Id.T.t option; 4622 + name : string option; 4623 + url : string option; 4624 + } 4625 + 4626 + let v ?avatars ?display_name ?host ?id ?name ?url () = { avatars; display_name; host; id; name; url } 4627 + 4628 + let avatars t = t.avatars 4629 + let display_name t = t.display_name 4630 + let host t = t.host 4631 + let id t = t.id 4632 + let name t = t.name 4633 + let url t = t.url 4634 + 4635 + let jsont : t Jsont.t = 4636 + Jsont.Object.map ~kind:"VideoChannelSummary" 4637 + (fun avatars display_name host id name url -> { avatars; display_name; host; id; name; url }) 4638 + |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 4639 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 4640 + |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 4641 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4642 + |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 4643 + |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 4644 + |> Jsont.Object.skip_unknown 4645 + |> Jsont.Object.finish 4646 + end 4647 + end 4648 + 4649 + module Actor = struct 4650 + module Info = struct 4651 + type t = { 4652 + avatars : ActorImage.T.t list option; 4653 + display_name : string option; 4654 + host : string option; 4655 + id : Id.T.t option; 4656 + name : string option; 4657 + } 4658 + 4659 + let v ?avatars ?display_name ?host ?id ?name () = { avatars; display_name; host; id; name } 4660 + 4661 + let avatars t = t.avatars 4662 + let display_name t = t.display_name 4663 + let host t = t.host 4664 + let id t = t.id 4665 + let name t = t.name 4666 + 4667 + let jsont : t Jsont.t = 4668 + Jsont.Object.map ~kind:"ActorInfo" 4669 + (fun avatars display_name host id name -> { avatars; display_name; host; id; name }) 4670 + |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 4671 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 4672 + |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 4673 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4674 + |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 4675 + |> Jsont.Object.skip_unknown 4676 + |> Jsont.Object.finish 4677 + end 4678 + 4679 + module T = struct 4680 + type t = { 4681 + avatars : ActorImage.T.t list option; 4682 + created_at : Ptime.t option; 4683 + followers_count : int option; (** number of followers of this actor, as seen by this instance *) 4684 + following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 4685 + host : string option; (** server on which the actor is resident *) 4686 + host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 4687 + id : Id.T.t option; 4688 + name : Username.T.t option; (** immutable name of the actor, used to find or mention it *) 4689 + updated_at : Ptime.t option; 4690 + url : string option; 4691 + } 4692 + 4693 + let v ?avatars ?created_at ?followers_count ?following_count ?host ?host_redundancy_allowed ?id ?name ?updated_at ?url () = { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; updated_at; url } 4694 + 4695 + let avatars t = t.avatars 4696 + let created_at t = t.created_at 4697 + let followers_count t = t.followers_count 4698 + let following_count t = t.following_count 4699 + let host t = t.host 4700 + let host_redundancy_allowed t = t.host_redundancy_allowed 4701 + let id t = t.id 4702 + let name t = t.name 4703 + let updated_at t = t.updated_at 4704 + let url t = t.url 4705 + 4706 + let jsont : t Jsont.t = 4707 + Jsont.Object.map ~kind:"Actor" 4708 + (fun avatars created_at followers_count following_count host host_redundancy_allowed id name updated_at url -> { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; updated_at; url }) 4709 + |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 4710 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 4711 + |> Jsont.Object.opt_mem "followersCount" Jsont.int ~enc:(fun r -> r.followers_count) 4712 + |> Jsont.Object.opt_mem "followingCount" Jsont.int ~enc:(fun r -> r.following_count) 4713 + |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 4714 + |> Jsont.Object.mem "hostRedundancyAllowed" Openapi.Runtime.nullable_bool 4715 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.host_redundancy_allowed) 4716 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4717 + |> Jsont.Object.opt_mem "name" Username.T.jsont ~enc:(fun r -> r.name) 4718 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 4719 + |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 4720 + |> Jsont.Object.skip_unknown 4721 + |> Jsont.Object.finish 4722 + end 4723 + end 4724 + 4725 + module Follow = struct 4726 + module T = struct 4727 + type t = { 4728 + created_at : Ptime.t option; 4729 + follower : Actor.T.t option; 4730 + following : Actor.T.t option; 4731 + id : Id.T.t option; 4732 + score : float option; (** score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. *) 4733 + state : string option; 4734 + updated_at : Ptime.t option; 4735 + } 4736 + 4737 + let v ?created_at ?follower ?following ?id ?score ?state ?updated_at () = { created_at; follower; following; id; score; state; updated_at } 4738 + 4739 + let created_at t = t.created_at 4740 + let follower t = t.follower 4741 + let following t = t.following 4742 + let id t = t.id 4743 + let score t = t.score 4744 + let state t = t.state 4745 + let updated_at t = t.updated_at 4746 + 4747 + let jsont : t Jsont.t = 4748 + Jsont.Object.map ~kind:"Follow" 4749 + (fun created_at follower following id score state updated_at -> { created_at; follower; following; id; score; state; updated_at }) 4750 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 4751 + |> Jsont.Object.opt_mem "follower" Actor.T.jsont ~enc:(fun r -> r.follower) 4752 + |> Jsont.Object.opt_mem "following" Actor.T.jsont ~enc:(fun r -> r.following) 4753 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4754 + |> Jsont.Object.opt_mem "score" Jsont.number ~enc:(fun r -> r.score) 4755 + |> Jsont.Object.opt_mem "state" Jsont.string ~enc:(fun r -> r.state) 4756 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 4757 + |> Jsont.Object.skip_unknown 4758 + |> Jsont.Object.finish 4759 + end 4760 + end 4761 + 4762 + module AccountSummary = struct 4763 + module T = struct 4764 + type t = { 4765 + avatars : ActorImage.T.t list option; 4766 + display_name : string option; 4767 + host : string option; 4768 + id : int option; 4769 + name : string option; 4770 + url : string option; 4771 + } 4772 + 4773 + let v ?avatars ?display_name ?host ?id ?name ?url () = { avatars; display_name; host; id; name; url } 4774 + 4775 + let avatars t = t.avatars 4776 + let display_name t = t.display_name 4777 + let host t = t.host 4778 + let id t = t.id 4779 + let name t = t.name 4780 + let url t = t.url 4781 + 4782 + let jsont : t Jsont.t = 4783 + Jsont.Object.map ~kind:"AccountSummary" 4784 + (fun avatars display_name host id name url -> { avatars; display_name; host; id; name; url }) 4785 + |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 4786 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 4787 + |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 4788 + |> Jsont.Object.opt_mem "id" Jsont.int ~enc:(fun r -> r.id) 4789 + |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 4790 + |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 4791 + |> Jsont.Object.skip_unknown 4792 + |> Jsont.Object.finish 4793 + end 4794 + end 4795 + 4796 + module VideoPlaylist = struct 4797 + module T = struct 4798 + type t = { 4799 + created_at : Ptime.t option; 4800 + description : string option; 4801 + display_name : string option; 4802 + id : Id.T.t option; 4803 + is_local : bool option; 4804 + owner_account : AccountSummary.T.t option; 4805 + privacy : VideoPlaylistPrivacyConstant.T.t option; 4806 + short_uuid : ShortUuid.T.t option; 4807 + thumbnail_path : string option; 4808 + type_ : VideoPlaylistTypeConstant.T.t option; 4809 + updated_at : Ptime.t option; 4810 + uuid : Uuidv4.T.t option; 4811 + video_channel : VideoChannelSummary.T.t option; 4812 + video_channel_position : int option; (** Position of the playlist in the channel *) 4813 + video_length : int option; 4814 + } 4815 + 4816 + let v ?created_at ?description ?display_name ?id ?is_local ?owner_account ?privacy ?short_uuid ?thumbnail_path ?type_ ?updated_at ?uuid ?video_channel ?video_channel_position ?video_length () = { created_at; description; display_name; id; is_local; owner_account; privacy; short_uuid; thumbnail_path; type_; updated_at; uuid; video_channel; video_channel_position; video_length } 4817 + 4818 + let created_at t = t.created_at 4819 + let description t = t.description 4820 + let display_name t = t.display_name 4821 + let id t = t.id 4822 + let is_local t = t.is_local 4823 + let owner_account t = t.owner_account 4824 + let privacy t = t.privacy 4825 + let short_uuid t = t.short_uuid 4826 + let thumbnail_path t = t.thumbnail_path 4827 + let type_ t = t.type_ 4828 + let updated_at t = t.updated_at 4829 + let uuid t = t.uuid 4830 + let video_channel t = t.video_channel 4831 + let video_channel_position t = t.video_channel_position 4832 + let video_length t = t.video_length 4833 + 4834 + let jsont : t Jsont.t = 4835 + Jsont.Object.map ~kind:"VideoPlaylist" 4836 + (fun created_at description display_name id is_local owner_account privacy short_uuid thumbnail_path type_ updated_at uuid video_channel video_channel_position video_length -> { created_at; description; display_name; id; is_local; owner_account; privacy; short_uuid; thumbnail_path; type_; updated_at; uuid; video_channel; video_channel_position; video_length }) 4837 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 4838 + |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4839 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 4840 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4841 + |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 4842 + |> Jsont.Object.opt_mem "ownerAccount" AccountSummary.T.jsont ~enc:(fun r -> r.owner_account) 4843 + |> Jsont.Object.opt_mem "privacy" VideoPlaylistPrivacyConstant.T.jsont ~enc:(fun r -> r.privacy) 4844 + |> Jsont.Object.opt_mem "shortUUID" ShortUuid.T.jsont ~enc:(fun r -> r.short_uuid) 4845 + |> Jsont.Object.opt_mem "thumbnailPath" Jsont.string ~enc:(fun r -> r.thumbnail_path) 4846 + |> Jsont.Object.opt_mem "type" VideoPlaylistTypeConstant.T.jsont ~enc:(fun r -> r.type_) 4847 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 4848 + |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 4849 + |> Jsont.Object.opt_mem "videoChannel" VideoChannelSummary.T.jsont ~enc:(fun r -> r.video_channel) 4850 + |> Jsont.Object.opt_mem "videoChannelPosition" Jsont.int ~enc:(fun r -> r.video_channel_position) 4851 + |> Jsont.Object.opt_mem "videoLength" Jsont.int ~enc:(fun r -> r.video_length) 4852 + |> Jsont.Object.skip_unknown 4853 + |> Jsont.Object.finish 4854 + end 4855 + 4856 + (** Get a video playlist 4857 + @param playlist_id Playlist id 4858 + *) 4859 + let get_api_v1_video_playlists ~playlist_id client () = 4860 + let op_name = "get_api_v1_video_playlists" in 4861 + let url_path = Openapi.Runtime.Path.render ~params:[("playlistId", playlist_id)] "/api/v1/video-playlists/{playlistId}" in 4862 + let query = "" in 4863 + let url = client.base_url ^ url_path ^ query in 4864 + let response = 4865 + try Requests.get client.session url 4866 + with Eio.Io _ as ex -> 4867 + let bt = Printexc.get_raw_backtrace () in 4868 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 4869 + in 4870 + if Requests.Response.ok response then 4871 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4872 + else 4873 + raise (Openapi.Runtime.Api_error { 4874 + operation = op_name; 4875 + method_ = "GET"; 4876 + url; 4877 + status = Requests.Response.status_code response; 4878 + body = Requests.Response.text response; 4879 + }) 4880 + end 4881 + 4882 + module VideoChannelCollaborator = struct 4883 + module T = struct 4884 + (** Representation of a channel collaboration *) 4885 + type t = { 4886 + account : AccountSummary.T.t option; 4887 + created_at : Ptime.t option; 4888 + id : Id.T.t option; 4889 + state : Jsont.json option; 4890 + updated_at : Ptime.t option; 4891 + } 4892 + 4893 + let v ?account ?created_at ?id ?state ?updated_at () = { account; created_at; id; state; updated_at } 4894 + 4895 + let account t = t.account 4896 + let created_at t = t.created_at 4897 + let id t = t.id 4898 + let state t = t.state 4899 + let updated_at t = t.updated_at 4900 + 4901 + let jsont : t Jsont.t = 4902 + Jsont.Object.map ~kind:"VideoChannelCollaborator" 4903 + (fun account created_at id state updated_at -> { account; created_at; id; state; updated_at }) 4904 + |> Jsont.Object.opt_mem "account" AccountSummary.T.jsont ~enc:(fun r -> r.account) 4905 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 4906 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4907 + |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 4908 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 4909 + |> Jsont.Object.skip_unknown 4910 + |> Jsont.Object.finish 4911 + end 4912 + end 4913 + 4914 + module Video = struct 4915 + module Info = struct 4916 + type t = { 4917 + id : Jsont.json option; 4918 + name : Jsont.json option; 4919 + state : Jsont.json option; 4920 + uuid : Jsont.json option; 4921 + } 4922 + 4923 + let v ?id ?name ?state ?uuid () = { id; name; state; uuid } 4924 + 4925 + let id t = t.id 4926 + let name t = t.name 4927 + let state t = t.state 4928 + let uuid t = t.uuid 4929 + 4930 + let jsont : t Jsont.t = 4931 + Jsont.Object.map ~kind:"VideoInfo" 4932 + (fun id name state uuid -> { id; name; state; uuid }) 4933 + |> Jsont.Object.opt_mem "id" Jsont.json ~enc:(fun r -> r.id) 4934 + |> Jsont.Object.opt_mem "name" Jsont.json ~enc:(fun r -> r.name) 4935 + |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 4936 + |> Jsont.Object.opt_mem "uuid" Jsont.json ~enc:(fun r -> r.uuid) 4937 + |> Jsont.Object.skip_unknown 4938 + |> Jsont.Object.finish 4939 + end 4940 + 4941 + module T = struct 4942 + type t = { 4943 + account : AccountSummary.T.t option; 4944 + aspect_ratio : float option; (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 4945 + blacklisted : bool option; 4946 + blacklisted_reason : string option; 4947 + category : VideoConstantNumberCategory.T.t option; (** category in which the video is classified *) 4948 + channel : VideoChannelSummary.T.t option; 4949 + comments : int option; (** **PeerTube >= 7.2** Number of comments on the video *) 4950 + created_at : Ptime.t option; (** time at which the video object was first drafted *) 4951 + dislikes : int option; 4952 + duration : int option; (** duration of the video in seconds *) 4953 + embed_path : string option; 4954 + id : Id.T.t option; (** object id for the video *) 4955 + is_live : bool option; 4956 + is_local : bool option; 4957 + language : VideoConstantStringLanguage.T.t option; (** main language used in the video *) 4958 + licence : VideoConstantNumberLicence.T.t option; (** licence under which the video is distributed *) 4959 + likes : int option; 4960 + live_schedules : LiveSchedule.T.t list option; 4961 + name : string option; (** title of the video *) 4962 + nsfw : bool option; 4963 + nsfw_flags : Nsfwflag.T.t option; 4964 + nsfw_summary : string option; (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 4965 + originally_published_at : Ptime.t option; (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 4966 + preview_path : string option; 4967 + privacy : VideoPrivacyConstant.T.t option; (** privacy policy used to distribute the video *) 4968 + published_at : Ptime.t option; (** time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. *) 4969 + scheduled_update : VideoScheduled.Update.t option; 4970 + short_uuid : ShortUuid.T.t option; 4971 + state : VideoStateConstant.T.t option; (** represents the internal state of the video processing within the PeerTube instance *) 4972 + thumbnail_path : string option; 4973 + truncated_description : string option; (** truncated description of the video, written in Markdown. 4974 + *) 4975 + updated_at : Ptime.t option; (** last time the video's metadata was modified *) 4976 + user_history : Jsont.json option; 4977 + uuid : Uuidv4.T.t option; (** universal identifier for the video, that can be used across instances *) 4978 + views : int option; 4979 + wait_transcoding : bool option; 4980 + } 4981 + 4982 + let v ?account ?aspect_ratio ?blacklisted ?blacklisted_reason ?category ?channel ?comments ?created_at ?dislikes ?duration ?embed_path ?id ?is_live ?is_local ?language ?licence ?likes ?live_schedules ?name ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?preview_path ?privacy ?published_at ?scheduled_update ?short_uuid ?state ?thumbnail_path ?truncated_description ?updated_at ?user_history ?uuid ?views ?wait_transcoding () = { account; aspect_ratio; blacklisted; blacklisted_reason; category; channel; comments; created_at; dislikes; duration; embed_path; id; is_live; is_local; language; licence; likes; live_schedules; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; preview_path; privacy; published_at; scheduled_update; short_uuid; state; thumbnail_path; truncated_description; updated_at; user_history; uuid; views; wait_transcoding } 4983 + 4984 + let account t = t.account 4985 + let aspect_ratio t = t.aspect_ratio 4986 + let blacklisted t = t.blacklisted 4987 + let blacklisted_reason t = t.blacklisted_reason 4988 + let category t = t.category 4989 + let channel t = t.channel 4990 + let comments t = t.comments 4991 + let created_at t = t.created_at 4992 + let dislikes t = t.dislikes 4993 + let duration t = t.duration 4994 + let embed_path t = t.embed_path 4995 + let id t = t.id 4996 + let is_live t = t.is_live 4997 + let is_local t = t.is_local 4998 + let language t = t.language 4999 + let licence t = t.licence 5000 + let likes t = t.likes 5001 + let live_schedules t = t.live_schedules 5002 + let name t = t.name 5003 + let nsfw t = t.nsfw 5004 + let nsfw_flags t = t.nsfw_flags 5005 + let nsfw_summary t = t.nsfw_summary 5006 + let originally_published_at t = t.originally_published_at 5007 + let preview_path t = t.preview_path 5008 + let privacy t = t.privacy 5009 + let published_at t = t.published_at 5010 + let scheduled_update t = t.scheduled_update 5011 + let short_uuid t = t.short_uuid 5012 + let state t = t.state 5013 + let thumbnail_path t = t.thumbnail_path 5014 + let truncated_description t = t.truncated_description 5015 + let updated_at t = t.updated_at 5016 + let user_history t = t.user_history 5017 + let uuid t = t.uuid 5018 + let views t = t.views 5019 + let wait_transcoding t = t.wait_transcoding 5020 + 5021 + let jsont : t Jsont.t = 5022 + Jsont.Object.map ~kind:"Video" 5023 + (fun account aspect_ratio blacklisted blacklisted_reason category channel comments created_at dislikes duration embed_path id is_live is_local language licence likes live_schedules name nsfw nsfw_flags nsfw_summary originally_published_at preview_path privacy published_at scheduled_update short_uuid state thumbnail_path truncated_description updated_at user_history uuid views wait_transcoding -> { account; aspect_ratio; blacklisted; blacklisted_reason; category; channel; comments; created_at; dislikes; duration; embed_path; id; is_live; is_local; language; licence; likes; live_schedules; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; preview_path; privacy; published_at; scheduled_update; short_uuid; state; thumbnail_path; truncated_description; updated_at; user_history; uuid; views; wait_transcoding }) 5024 + |> Jsont.Object.opt_mem "account" AccountSummary.T.jsont ~enc:(fun r -> r.account) 5025 + |> Jsont.Object.mem "aspectRatio" Openapi.Runtime.nullable_float 5026 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.aspect_ratio) 5027 + |> Jsont.Object.mem "blacklisted" Openapi.Runtime.nullable_bool 5028 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.blacklisted) 5029 + |> Jsont.Object.mem "blacklistedReason" Openapi.Runtime.nullable_string 5030 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.blacklisted_reason) 5031 + |> Jsont.Object.opt_mem "category" VideoConstantNumberCategory.T.jsont ~enc:(fun r -> r.category) 5032 + |> Jsont.Object.opt_mem "channel" VideoChannelSummary.T.jsont ~enc:(fun r -> r.channel) 5033 + |> Jsont.Object.opt_mem "comments" Jsont.int ~enc:(fun r -> r.comments) 5034 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 5035 + |> Jsont.Object.opt_mem "dislikes" Jsont.int ~enc:(fun r -> r.dislikes) 5036 + |> Jsont.Object.opt_mem "duration" Jsont.int ~enc:(fun r -> r.duration) 5037 + |> Jsont.Object.opt_mem "embedPath" Jsont.string ~enc:(fun r -> r.embed_path) 5038 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 5039 + |> Jsont.Object.opt_mem "isLive" Jsont.bool ~enc:(fun r -> r.is_live) 5040 + |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 5041 + |> Jsont.Object.opt_mem "language" VideoConstantStringLanguage.T.jsont ~enc:(fun r -> r.language) 5042 + |> Jsont.Object.opt_mem "licence" VideoConstantNumberLicence.T.jsont ~enc:(fun r -> r.licence) 5043 + |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 5044 + |> Jsont.Object.opt_mem "liveSchedules" (Jsont.list LiveSchedule.T.jsont) ~enc:(fun r -> r.live_schedules) 5045 + |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 5046 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 5047 + |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 5048 + |> Jsont.Object.opt_mem "nsfwSummary" Jsont.string ~enc:(fun r -> r.nsfw_summary) 5049 + |> Jsont.Object.mem "originallyPublishedAt" Openapi.Runtime.nullable_ptime 5050 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.originally_published_at) 5051 + |> Jsont.Object.opt_mem "previewPath" Jsont.string ~enc:(fun r -> r.preview_path) 5052 + |> Jsont.Object.opt_mem "privacy" VideoPrivacyConstant.T.jsont ~enc:(fun r -> r.privacy) 5053 + |> Jsont.Object.opt_mem "publishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.published_at) 5054 + |> Jsont.Object.opt_mem "scheduledUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.scheduled_update) 5055 + |> Jsont.Object.opt_mem "shortUUID" ShortUuid.T.jsont ~enc:(fun r -> r.short_uuid) 5056 + |> Jsont.Object.opt_mem "state" VideoStateConstant.T.jsont ~enc:(fun r -> r.state) 5057 + |> Jsont.Object.opt_mem "thumbnailPath" Jsont.string ~enc:(fun r -> r.thumbnail_path) 5058 + |> Jsont.Object.mem "truncatedDescription" Openapi.Runtime.nullable_string 5059 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.truncated_description) 5060 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 5061 + |> Jsont.Object.mem "userHistory" (Openapi.Runtime.nullable_any Jsont.json) 5062 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.user_history) 5063 + |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 5064 + |> Jsont.Object.opt_mem "views" Jsont.int ~enc:(fun r -> r.views) 5065 + |> Jsont.Object.mem "waitTranscoding" Openapi.Runtime.nullable_bool 5066 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.wait_transcoding) 5067 + |> Jsont.Object.skip_unknown 5068 + |> Jsont.Object.finish 5069 + end 5070 + end 5071 + 5072 + module VideoRating = struct 5073 + module T = struct 5074 + type t = { 5075 + rating : string; (** Rating of the video *) 5076 + video : Video.T.t; 5077 + } 5078 + 5079 + let v ~rating ~video () = { rating; video } 5080 + 5081 + let rating t = t.rating 5082 + let video t = t.video 5083 + 5084 + let jsont : t Jsont.t = 5085 + Jsont.Object.map ~kind:"VideoRating" 5086 + (fun rating video -> { rating; video }) 5087 + |> Jsont.Object.mem "rating" Jsont.string ~enc:(fun r -> r.rating) 5088 + |> Jsont.Object.mem "video" Video.T.jsont ~enc:(fun r -> r.video) 5089 + |> Jsont.Object.skip_unknown 5090 + |> Jsont.Object.finish 5091 + end 5092 + 5093 + (** List ratings of an account 5094 + @param name The username or handle of the account 5095 + @param start Offset used to paginate results 5096 + @param count Number of items to return 5097 + @param sort Sort column 5098 + @param rating Optionally filter which ratings to retrieve 5099 + *) 5100 + let get_api_v1_accounts_ratings ~name ?start ?count ?sort ?rating client () = 5101 + let op_name = "get_api_v1_accounts_ratings" in 5102 + let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/ratings" in 5103 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"rating" ~value:rating]) in 5104 + let url = client.base_url ^ url_path ^ query in 5105 + let response = 5106 + try Requests.get client.session url 5107 + with Eio.Io _ as ex -> 5108 + let bt = Printexc.get_raw_backtrace () in 5109 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5110 + in 5111 + if Requests.Response.ok response then 5112 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 5113 + else 5114 + raise (Openapi.Runtime.Api_error { 5115 + operation = op_name; 5116 + method_ = "GET"; 5117 + url; 5118 + status = Requests.Response.status_code response; 5119 + body = Requests.Response.text response; 5120 + }) 5121 + end 5122 + 5123 + module VideoList = struct 5124 + module Response = struct 5125 + type t = { 5126 + data : Video.T.t list option; 5127 + total : int option; 5128 + } 5129 + 5130 + let v ?data ?total () = { data; total } 5131 + 5132 + let data t = t.data 5133 + let total t = t.total 5134 + 5135 + let jsont : t Jsont.t = 5136 + Jsont.Object.map ~kind:"VideoListResponse" 5137 + (fun data total -> { data; total }) 5138 + |> Jsont.Object.opt_mem "data" (Jsont.list Video.T.jsont) ~enc:(fun r -> r.data) 5139 + |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 5140 + |> Jsont.Object.skip_unknown 5141 + |> Jsont.Object.finish 5142 + end 5143 + 5144 + (** List videos of an account 5145 + @param name The username or handle of the account 5146 + @param start Offset used to paginate results 5147 + @param count Number of items to return 5148 + @param skip_count if you don't need the `total` in the response 5149 + @param nsfw whether to include nsfw videos, if any 5150 + @param is_live whether or not the video is a live 5151 + @param include_scheduled_live whether or not include live that are scheduled for later 5152 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5153 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5154 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5155 + @param tags_one_of tag(s) of the video 5156 + @param tags_all_of tag(s) of the video, where all should be present in the video 5157 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 5158 + @param include_ **Only administrators and moderators can use this parameter** 5159 + 5160 + Include additional videos in results (can be combined using bitwise or operator) 5161 + - `0` NONE 5162 + - `1` NOT_PUBLISHED_STATE 5163 + - `2` BLACKLISTED 5164 + - `4` BLOCKED_OWNER 5165 + - `8` FILES 5166 + - `16` CAPTIONS 5167 + - `32` VIDEO SOURCE 5168 + 5169 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5170 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5171 + @param host Find elements owned by this host 5172 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5173 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5174 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5175 + @param search Plain text search, applied to various parts of the model depending on endpoint 5176 + *) 5177 + let get_account_videos ~name ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 5178 + let op_name = "get_account_videos" in 5179 + let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/videos" in 5180 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 5181 + let url = client.base_url ^ url_path ^ query in 5182 + let response = 5183 + try Requests.get client.session url 5184 + with Eio.Io _ as ex -> 5185 + let bt = Printexc.get_raw_backtrace () in 5186 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5187 + in 5188 + if Requests.Response.ok response then 5189 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5190 + else 5191 + raise (Openapi.Runtime.Api_error { 5192 + operation = op_name; 5193 + method_ = "GET"; 5194 + url; 5195 + status = Requests.Response.status_code response; 5196 + body = Requests.Response.text response; 5197 + }) 5198 + 5199 + (** Search videos 5200 + @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it. 5201 + 5202 + @param uuids Find elements with specific UUIDs 5203 + @param search_target If the administrator enabled search index support, you can override the default search target. 5204 + 5205 + **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information: 5206 + * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), 5207 + then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. 5208 + After that, you can use the classic REST API endpoints to fetch the complete object or interact with it 5209 + * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch 5210 + the data from the origin instance API 5211 + 5212 + @param start Offset used to paginate results 5213 + @param count Number of items to return 5214 + @param skip_count if you don't need the `total` in the response 5215 + @param nsfw whether to include nsfw videos, if any 5216 + @param is_live whether or not the video is a live 5217 + @param include_scheduled_live whether or not include live that are scheduled for later 5218 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5219 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5220 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5221 + @param tags_one_of tag(s) of the video 5222 + @param tags_all_of tag(s) of the video, where all should be present in the video 5223 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 5224 + @param include_ **Only administrators and moderators can use this parameter** 5225 + 5226 + Include additional videos in results (can be combined using bitwise or operator) 5227 + - `0` NONE 5228 + - `1` NOT_PUBLISHED_STATE 5229 + - `2` BLACKLISTED 5230 + - `4` BLOCKED_OWNER 5231 + - `8` FILES 5232 + - `16` CAPTIONS 5233 + - `32` VIDEO SOURCE 5234 + 5235 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5236 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5237 + @param host Find elements owned by this host 5238 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5239 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5240 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5241 + @param start_date Get videos that are published after this date 5242 + @param end_date Get videos that are published before this date 5243 + @param originally_published_start_date Get videos that are originally published after this date 5244 + @param originally_published_end_date Get videos that are originally published before this date 5245 + @param duration_min Get videos that have this minimum duration 5246 + @param duration_max Get videos that have this maximum duration 5247 + *) 5248 + let search_videos ~search ?uuids ?search_target ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?start_date ?end_date ?originally_published_start_date ?originally_published_end_date ?duration_min ?duration_max client () = 5249 + let op_name = "search_videos" in 5250 + let url_path = "/api/v1/search/videos" in 5251 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.singleton ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"uuids" ~value:uuids; Openapi.Runtime.Query.optional ~key:"searchTarget" ~value:search_target; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"startDate" ~value:start_date; Openapi.Runtime.Query.optional ~key:"endDate" ~value:end_date; Openapi.Runtime.Query.optional ~key:"originallyPublishedStartDate" ~value:originally_published_start_date; Openapi.Runtime.Query.optional ~key:"originallyPublishedEndDate" ~value:originally_published_end_date; Openapi.Runtime.Query.optional ~key:"durationMin" ~value:duration_min; Openapi.Runtime.Query.optional ~key:"durationMax" ~value:duration_max]) in 5252 + let url = client.base_url ^ url_path ^ query in 5253 + let response = 5254 + try Requests.get client.session url 5255 + with Eio.Io _ as ex -> 5256 + let bt = Printexc.get_raw_backtrace () in 5257 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5258 + in 5259 + if Requests.Response.ok response then 5260 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5261 + else 5262 + raise (Openapi.Runtime.Api_error { 5263 + operation = op_name; 5264 + method_ = "GET"; 5265 + url; 5266 + status = Requests.Response.status_code response; 5267 + body = Requests.Response.text response; 5268 + }) 5269 + 5270 + (** List watched videos history 5271 + @param start Offset used to paginate results 5272 + @param count Number of items to return 5273 + @param search Plain text search, applied to various parts of the model depending on endpoint 5274 + *) 5275 + let get_api_v1_users_me_history_videos ?start ?count ?search client () = 5276 + let op_name = "get_api_v1_users_me_history_videos" in 5277 + let url_path = "/api/v1/users/me/history/videos" in 5278 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 5279 + let url = client.base_url ^ url_path ^ query in 5280 + let response = 5281 + try Requests.get client.session url 5282 + with Eio.Io _ as ex -> 5283 + let bt = Printexc.get_raw_backtrace () in 5284 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5285 + in 5286 + if Requests.Response.ok response then 5287 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5288 + else 5289 + raise (Openapi.Runtime.Api_error { 5290 + operation = op_name; 5291 + method_ = "GET"; 5292 + url; 5293 + status = Requests.Response.status_code response; 5294 + body = Requests.Response.text response; 5295 + }) 5296 + 5297 + (** List videos of subscriptions of my user 5298 + @param start Offset used to paginate results 5299 + @param count Number of items to return 5300 + @param skip_count if you don't need the `total` in the response 5301 + @param nsfw whether to include nsfw videos, if any 5302 + @param is_live whether or not the video is a live 5303 + @param include_scheduled_live whether or not include live that are scheduled for later 5304 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5305 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5306 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5307 + @param tags_one_of tag(s) of the video 5308 + @param tags_all_of tag(s) of the video, where all should be present in the video 5309 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 5310 + @param include_ **Only administrators and moderators can use this parameter** 5311 + 5312 + Include additional videos in results (can be combined using bitwise or operator) 5313 + - `0` NONE 5314 + - `1` NOT_PUBLISHED_STATE 5315 + - `2` BLACKLISTED 5316 + - `4` BLOCKED_OWNER 5317 + - `8` FILES 5318 + - `16` CAPTIONS 5319 + - `32` VIDEO SOURCE 5320 + 5321 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5322 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5323 + @param host Find elements owned by this host 5324 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5325 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5326 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5327 + @param search Plain text search, applied to various parts of the model depending on endpoint 5328 + *) 5329 + let get_api_v1_users_me_subscriptions_videos ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 5330 + let op_name = "get_api_v1_users_me_subscriptions_videos" in 5331 + let url_path = "/api/v1/users/me/subscriptions/videos" in 5332 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 5333 + let url = client.base_url ^ url_path ^ query in 5334 + let response = 5335 + try Requests.get client.session url 5336 + with Eio.Io _ as ex -> 5337 + let bt = Printexc.get_raw_backtrace () in 5338 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5339 + in 5340 + if Requests.Response.ok response then 5341 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5342 + else 5343 + raise (Openapi.Runtime.Api_error { 5344 + operation = op_name; 5345 + method_ = "GET"; 5346 + url; 5347 + status = Requests.Response.status_code response; 5348 + body = Requests.Response.text response; 5349 + }) 5350 + 5351 + (** List videos of my user 5352 + @param channel_name_one_of **PeerTube >= 7.2** Filter on videos that are published by a channel with one of these names 5353 + @param start Offset used to paginate results 5354 + @param count Number of items to return 5355 + @param skip_count if you don't need the `total` in the response 5356 + @param nsfw whether to include nsfw videos, if any 5357 + @param is_live whether or not the video is a live 5358 + @param include_scheduled_live whether or not include live that are scheduled for later 5359 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5360 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5361 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5362 + @param tags_one_of tag(s) of the video 5363 + @param tags_all_of tag(s) of the video, where all should be present in the video 5364 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 5365 + @param include_ **Only administrators and moderators can use this parameter** 5366 + 5367 + Include additional videos in results (can be combined using bitwise or operator) 5368 + - `0` NONE 5369 + - `1` NOT_PUBLISHED_STATE 5370 + - `2` BLACKLISTED 5371 + - `4` BLOCKED_OWNER 5372 + - `8` FILES 5373 + - `16` CAPTIONS 5374 + - `32` VIDEO SOURCE 5375 + 5376 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5377 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5378 + @param host Find elements owned by this host 5379 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5380 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5381 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5382 + @param search Plain text search, applied to various parts of the model depending on endpoint 5383 + @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 5384 + *) 5385 + let get_api_v1_users_me_videos ?channel_name_one_of ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search ?include_collaborations client () = 5386 + let op_name = "get_api_v1_users_me_videos" in 5387 + let url_path = "/api/v1/users/me/videos" in 5388 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"channelNameOneOf" ~value:channel_name_one_of; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"includeCollaborations" ~value:include_collaborations]) in 5389 + let url = client.base_url ^ url_path ^ query in 5390 + let response = 5391 + try Requests.get client.session url 5392 + with Eio.Io _ as ex -> 5393 + let bt = Printexc.get_raw_backtrace () in 5394 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5395 + in 5396 + if Requests.Response.ok response then 5397 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5398 + else 5399 + raise (Openapi.Runtime.Api_error { 5400 + operation = op_name; 5401 + method_ = "GET"; 5402 + url; 5403 + status = Requests.Response.status_code response; 5404 + body = Requests.Response.text response; 5405 + }) 5406 + 5407 + (** List videos of a video channel 5408 + @param channel_handle The video channel handle 5409 + @param start Offset used to paginate results 5410 + @param count Number of items to return 5411 + @param skip_count if you don't need the `total` in the response 5412 + @param nsfw whether to include nsfw videos, if any 5413 + @param is_live whether or not the video is a live 5414 + @param include_scheduled_live whether or not include live that are scheduled for later 5415 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5416 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5417 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5418 + @param tags_one_of tag(s) of the video 5419 + @param tags_all_of tag(s) of the video, where all should be present in the video 5420 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 5421 + @param include_ **Only administrators and moderators can use this parameter** 5422 + 5423 + Include additional videos in results (can be combined using bitwise or operator) 5424 + - `0` NONE 5425 + - `1` NOT_PUBLISHED_STATE 5426 + - `2` BLACKLISTED 5427 + - `4` BLOCKED_OWNER 5428 + - `8` FILES 5429 + - `16` CAPTIONS 5430 + - `32` VIDEO SOURCE 5431 + 5432 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5433 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5434 + @param host Find elements owned by this host 5435 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5436 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5437 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5438 + @param search Plain text search, applied to various parts of the model depending on endpoint 5439 + *) 5440 + let get_video_channel_videos ~channel_handle ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 5441 + let op_name = "get_video_channel_videos" in 5442 + let url_path = Openapi.Runtime.Path.render ~params:[("channelHandle", channel_handle)] "/api/v1/video-channels/{channelHandle}/videos" in 5443 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 5444 + let url = client.base_url ^ url_path ^ query in 5445 + let response = 5446 + try Requests.get client.session url 5447 + with Eio.Io _ as ex -> 5448 + let bt = Printexc.get_raw_backtrace () in 5449 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5450 + in 5451 + if Requests.Response.ok response then 5452 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5453 + else 5454 + raise (Openapi.Runtime.Api_error { 5455 + operation = op_name; 5456 + method_ = "GET"; 5457 + url; 5458 + status = Requests.Response.status_code response; 5459 + body = Requests.Response.text response; 5460 + }) 5461 + 5462 + (** List videos 5463 + @param start Offset used to paginate results 5464 + @param count Number of items to return 5465 + @param skip_count if you don't need the `total` in the response 5466 + @param nsfw whether to include nsfw videos, if any 5467 + @param is_live whether or not the video is a live 5468 + @param include_scheduled_live whether or not include live that are scheduled for later 5469 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5470 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5471 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5472 + @param tags_one_of tag(s) of the video 5473 + @param tags_all_of tag(s) of the video, where all should be present in the video 5474 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 5475 + @param include_ **Only administrators and moderators can use this parameter** 5476 + 5477 + Include additional videos in results (can be combined using bitwise or operator) 5478 + - `0` NONE 5479 + - `1` NOT_PUBLISHED_STATE 5480 + - `2` BLACKLISTED 5481 + - `4` BLOCKED_OWNER 5482 + - `8` FILES 5483 + - `16` CAPTIONS 5484 + - `32` VIDEO SOURCE 5485 + 5486 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5487 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5488 + @param host Find elements owned by this host 5489 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5490 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5491 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5492 + @param search Plain text search, applied to various parts of the model depending on endpoint 5493 + *) 5494 + let get_videos ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 5495 + let op_name = "get_videos" in 5496 + let url_path = "/api/v1/videos" in 5497 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 5498 + let url = client.base_url ^ url_path ^ query in 5499 + let response = 5500 + try Requests.get client.session url 5501 + with Eio.Io _ as ex -> 5502 + let bt = Printexc.get_raw_backtrace () in 5503 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5504 + in 5505 + if Requests.Response.ok response then 5506 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5507 + else 5508 + raise (Openapi.Runtime.Api_error { 5509 + operation = op_name; 5510 + method_ = "GET"; 5511 + url; 5512 + status = Requests.Response.status_code response; 5513 + body = Requests.Response.text response; 5514 + }) 5515 + end 5516 + 3838 5517 module VideoImport = struct 3839 5518 module T = struct 3840 5519 type t = { ··· 3842 5521 error : string option; 3843 5522 id : Id.T.t option; 3844 5523 magnet_uri : string option; (** magnet URI allowing to resolve the import's source video *) 3845 - state : Jsont.json option; 5524 + state : VideoImportStateConstant.T.t option; 3846 5525 target_url : string option; (** remote URL where to find the import's source video *) 3847 5526 torrent_name : string option; 3848 5527 torrentfile : string option; (** Torrent file containing only the video file *) 3849 5528 updated_at : Ptime.t option; 3850 - video : Jsont.json option; 5529 + video : Video.T.t option; 3851 5530 } 3852 5531 3853 5532 let v ?created_at ?error ?id ?magnet_uri ?state ?target_url ?torrent_name ?torrentfile ?updated_at ?video () = { created_at; error; id; magnet_uri; state; target_url; torrent_name; torrentfile; updated_at; video } ··· 3870 5549 |> Jsont.Object.opt_mem "error" Jsont.string ~enc:(fun r -> r.error) 3871 5550 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3872 5551 |> Jsont.Object.opt_mem "magnetUri" Jsont.string ~enc:(fun r -> r.magnet_uri) 3873 - |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 5552 + |> Jsont.Object.opt_mem "state" VideoImportStateConstant.T.jsont ~enc:(fun r -> r.state) 3874 5553 |> Jsont.Object.opt_mem "targetUrl" Jsont.string ~enc:(fun r -> r.target_url) 3875 5554 |> Jsont.Object.opt_mem "torrentName" Jsont.string ~enc:(fun r -> r.torrent_name) 3876 5555 |> Jsont.Object.opt_mem "torrentfile" Jsont.string ~enc:(fun r -> r.torrentfile) 3877 5556 |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 3878 - |> Jsont.Object.opt_mem "video" Jsont.json ~enc:(fun r -> r.video) 5557 + |> Jsont.Object.opt_mem "video" Video.T.jsont ~enc:(fun r -> r.video) 3879 5558 |> Jsont.Object.skip_unknown 3880 5559 |> Jsont.Object.finish 3881 5560 end ··· 3936 5615 }) 3937 5616 end 3938 5617 5618 + module VideoCommentForOwnerOrAdmin = struct 5619 + module T = struct 5620 + type t = { 5621 + account : Jsont.json option; 5622 + automatic_tags : string list option; 5623 + created_at : Jsont.json option; 5624 + held_for_review : Jsont.json option; 5625 + id : Id.T.t option; 5626 + in_reply_to_comment_id : Jsont.json option; 5627 + text : Jsont.json option; 5628 + thread_id : Jsont.json option; 5629 + updated_at : Jsont.json option; 5630 + url : Jsont.json option; 5631 + video : Video.Info.t option; 5632 + } 5633 + 5634 + let v ?account ?automatic_tags ?created_at ?held_for_review ?id ?in_reply_to_comment_id ?text ?thread_id ?updated_at ?url ?video () = { account; automatic_tags; created_at; held_for_review; id; in_reply_to_comment_id; text; thread_id; updated_at; url; video } 5635 + 5636 + let account t = t.account 5637 + let automatic_tags t = t.automatic_tags 5638 + let created_at t = t.created_at 5639 + let held_for_review t = t.held_for_review 5640 + let id t = t.id 5641 + let in_reply_to_comment_id t = t.in_reply_to_comment_id 5642 + let text t = t.text 5643 + let thread_id t = t.thread_id 5644 + let updated_at t = t.updated_at 5645 + let url t = t.url 5646 + let video t = t.video 5647 + 5648 + let jsont : t Jsont.t = 5649 + Jsont.Object.map ~kind:"VideoCommentForOwnerOrAdmin" 5650 + (fun account automatic_tags created_at held_for_review id in_reply_to_comment_id text thread_id updated_at url video -> { account; automatic_tags; created_at; held_for_review; id; in_reply_to_comment_id; text; thread_id; updated_at; url; video }) 5651 + |> Jsont.Object.opt_mem "account" Jsont.json ~enc:(fun r -> r.account) 5652 + |> Jsont.Object.opt_mem "automaticTags" (Jsont.list Jsont.string) ~enc:(fun r -> r.automatic_tags) 5653 + |> Jsont.Object.opt_mem "createdAt" Jsont.json ~enc:(fun r -> r.created_at) 5654 + |> Jsont.Object.opt_mem "heldForReview" Jsont.json ~enc:(fun r -> r.held_for_review) 5655 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 5656 + |> Jsont.Object.opt_mem "inReplyToCommentId" Jsont.json ~enc:(fun r -> r.in_reply_to_comment_id) 5657 + |> Jsont.Object.opt_mem "text" Jsont.json ~enc:(fun r -> r.text) 5658 + |> Jsont.Object.opt_mem "threadId" Jsont.json ~enc:(fun r -> r.thread_id) 5659 + |> Jsont.Object.opt_mem "updatedAt" Jsont.json ~enc:(fun r -> r.updated_at) 5660 + |> Jsont.Object.opt_mem "url" Jsont.json ~enc:(fun r -> r.url) 5661 + |> Jsont.Object.opt_mem "video" Video.Info.jsont ~enc:(fun r -> r.video) 5662 + |> Jsont.Object.skip_unknown 5663 + |> Jsont.Object.finish 5664 + end 5665 + end 5666 + 5667 + module PlaylistElement = struct 5668 + module T = struct 5669 + type t = { 5670 + position : int option; 5671 + start_timestamp : int option; 5672 + stop_timestamp : int option; 5673 + video : Video.T.t option; 5674 + } 5675 + 5676 + let v ?position ?start_timestamp ?stop_timestamp ?video () = { position; start_timestamp; stop_timestamp; video } 5677 + 5678 + let position t = t.position 5679 + let start_timestamp t = t.start_timestamp 5680 + let stop_timestamp t = t.stop_timestamp 5681 + let video t = t.video 5682 + 5683 + let jsont : t Jsont.t = 5684 + Jsont.Object.map ~kind:"PlaylistElement" 5685 + (fun position start_timestamp stop_timestamp video -> { position; start_timestamp; stop_timestamp; video }) 5686 + |> Jsont.Object.opt_mem "position" Jsont.int ~enc:(fun r -> r.position) 5687 + |> Jsont.Object.opt_mem "startTimestamp" Jsont.int ~enc:(fun r -> r.start_timestamp) 5688 + |> Jsont.Object.opt_mem "stopTimestamp" Jsont.int ~enc:(fun r -> r.stop_timestamp) 5689 + |> Jsont.Object.opt_mem "video" Video.T.jsont ~enc:(fun r -> r.video) 5690 + |> Jsont.Object.skip_unknown 5691 + |> Jsont.Object.finish 5692 + end 5693 + end 5694 + 5695 + module Notification = struct 5696 + module Type = struct 5697 + (** Notification type. One of the following values: 5698 + 5699 + - `1` NEW_VIDEO_FROM_SUBSCRIPTION 5700 + 5701 + - `2` NEW_COMMENT_ON_MY_VIDEO 5702 + 5703 + - `3` NEW_ABUSE_FOR_MODERATORS 5704 + 5705 + - `4` BLACKLIST_ON_MY_VIDEO 5706 + 5707 + - `5` UNBLACKLIST_ON_MY_VIDEO 5708 + 5709 + - `6` MY_VIDEO_PUBLISHED 5710 + 5711 + - `7` MY_VIDEO_IMPORT_SUCCESS 5712 + 5713 + - `8` MY_VIDEO_IMPORT_ERROR 5714 + 5715 + - `9` NEW_USER_REGISTRATION 5716 + 5717 + - `10` NEW_FOLLOW 5718 + 5719 + - `11` COMMENT_MENTION 5720 + 5721 + - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS 5722 + 5723 + - `13` NEW_INSTANCE_FOLLOWER 5724 + 5725 + - `14` AUTO_INSTANCE_FOLLOWING 5726 + 5727 + - `15` ABUSE_STATE_CHANGE 5728 + 5729 + - `16` ABUSE_NEW_MESSAGE 5730 + 5731 + - `17` NEW_PLUGIN_VERSION 5732 + 5733 + - `18` NEW_PEERTUBE_VERSION 5734 + 5735 + - `19` MY_VIDEO_STUDIO_EDITION_FINISHED 5736 + 5737 + - `20` NEW_USER_REGISTRATION_REQUEST 5738 + 5739 + - `21` NEW_LIVE_FROM_SUBSCRIPTION 5740 + 5741 + - `22` MY_VIDEO_TRANSCRIPTION_GENERATED 5742 + *) 5743 + type t = string 5744 + 5745 + let jsont = Jsont.string 5746 + end 5747 + 5748 + module T = struct 5749 + type t = { 5750 + account : Actor.Info.t option; 5751 + actor_follow : Jsont.json option; 5752 + comment : Jsont.json option; 5753 + created_at : Ptime.t option; 5754 + id : Id.T.t option; 5755 + read : bool option; 5756 + type_ : Type.t option; 5757 + updated_at : Ptime.t option; 5758 + video : Video.Info.t option; 5759 + video_abuse : Jsont.json option; 5760 + video_blacklist : Jsont.json option; 5761 + video_import : Jsont.json option; 5762 + } 5763 + 5764 + let v ?account ?actor_follow ?comment ?created_at ?id ?read ?type_ ?updated_at ?video ?video_abuse ?video_blacklist ?video_import () = { account; actor_follow; comment; created_at; id; read; type_; updated_at; video; video_abuse; video_blacklist; video_import } 5765 + 5766 + let account t = t.account 5767 + let actor_follow t = t.actor_follow 5768 + let comment t = t.comment 5769 + let created_at t = t.created_at 5770 + let id t = t.id 5771 + let read t = t.read 5772 + let type_ t = t.type_ 5773 + let updated_at t = t.updated_at 5774 + let video t = t.video 5775 + let video_abuse t = t.video_abuse 5776 + let video_blacklist t = t.video_blacklist 5777 + let video_import t = t.video_import 5778 + 5779 + let jsont : t Jsont.t = 5780 + Jsont.Object.map ~kind:"Notification" 5781 + (fun account actor_follow comment created_at id read type_ updated_at video video_abuse video_blacklist video_import -> { account; actor_follow; comment; created_at; id; read; type_; updated_at; video; video_abuse; video_blacklist; video_import }) 5782 + |> Jsont.Object.opt_mem "account" Actor.Info.jsont ~enc:(fun r -> r.account) 5783 + |> Jsont.Object.mem "actorFollow" (Openapi.Runtime.nullable_any Jsont.json) 5784 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.actor_follow) 5785 + |> Jsont.Object.mem "comment" (Openapi.Runtime.nullable_any Jsont.json) 5786 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.comment) 5787 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 5788 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 5789 + |> Jsont.Object.opt_mem "read" Jsont.bool ~enc:(fun r -> r.read) 5790 + |> Jsont.Object.opt_mem "type" Type.jsont ~enc:(fun r -> r.type_) 5791 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 5792 + |> Jsont.Object.mem "video" (Openapi.Runtime.nullable_any Video.Info.jsont) 5793 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.video) 5794 + |> Jsont.Object.mem "videoAbuse" (Openapi.Runtime.nullable_any Jsont.json) 5795 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.video_abuse) 5796 + |> Jsont.Object.mem "videoBlacklist" (Openapi.Runtime.nullable_any Jsont.json) 5797 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.video_blacklist) 5798 + |> Jsont.Object.mem "videoImport" (Openapi.Runtime.nullable_any Jsont.json) 5799 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.video_import) 5800 + |> Jsont.Object.skip_unknown 5801 + |> Jsont.Object.finish 5802 + end 5803 + end 5804 + 5805 + module NotificationList = struct 5806 + module Response = struct 5807 + type t = { 5808 + data : Notification.T.t list option; 5809 + total : int option; 5810 + } 5811 + 5812 + let v ?data ?total () = { data; total } 5813 + 5814 + let data t = t.data 5815 + let total t = t.total 5816 + 5817 + let jsont : t Jsont.t = 5818 + Jsont.Object.map ~kind:"NotificationListResponse" 5819 + (fun data total -> { data; total }) 5820 + |> Jsont.Object.opt_mem "data" (Jsont.list Notification.T.jsont) ~enc:(fun r -> r.data) 5821 + |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 5822 + |> Jsont.Object.skip_unknown 5823 + |> Jsont.Object.finish 5824 + end 5825 + 5826 + (** List my notifications 5827 + @param type_one_of only list notifications of these types 5828 + @param unread only list unread notifications 5829 + @param start Offset used to paginate results 5830 + @param count Number of items to return 5831 + @param sort Sort column 5832 + *) 5833 + let get_api_v1_users_me_notifications ?type_one_of ?unread ?start ?count ?sort client () = 5834 + let op_name = "get_api_v1_users_me_notifications" in 5835 + let url_path = "/api/v1/users/me/notifications" in 5836 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"typeOneOf" ~value:type_one_of; Openapi.Runtime.Query.optional ~key:"unread" ~value:unread; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 5837 + let url = client.base_url ^ url_path ^ query in 5838 + let response = 5839 + try Requests.get client.session url 5840 + with Eio.Io _ as ex -> 5841 + let bt = Printexc.get_raw_backtrace () in 5842 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5843 + in 5844 + if Requests.Response.ok response then 5845 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5846 + else 5847 + raise (Openapi.Runtime.Api_error { 5848 + operation = op_name; 5849 + method_ = "GET"; 5850 + url; 5851 + status = Requests.Response.status_code response; 5852 + body = Requests.Response.text response; 5853 + }) 5854 + end 5855 + 5856 + module AbuseMessage = struct 5857 + module T = struct 5858 + type t = { 5859 + account : AccountSummary.T.t option; 5860 + by_moderator : bool option; 5861 + created_at : Ptime.t option; 5862 + id : Id.T.t option; 5863 + message : string option; 5864 + } 5865 + 5866 + let v ?account ?by_moderator ?created_at ?id ?message () = { account; by_moderator; created_at; id; message } 5867 + 5868 + let account t = t.account 5869 + let by_moderator t = t.by_moderator 5870 + let created_at t = t.created_at 5871 + let id t = t.id 5872 + let message t = t.message 5873 + 5874 + let jsont : t Jsont.t = 5875 + Jsont.Object.map ~kind:"AbuseMessage" 5876 + (fun account by_moderator created_at id message -> { account; by_moderator; created_at; id; message }) 5877 + |> Jsont.Object.opt_mem "account" AccountSummary.T.jsont ~enc:(fun r -> r.account) 5878 + |> Jsont.Object.opt_mem "byModerator" Jsont.bool ~enc:(fun r -> r.by_moderator) 5879 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 5880 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 5881 + |> Jsont.Object.opt_mem "message" Jsont.string ~enc:(fun r -> r.message) 5882 + |> Jsont.Object.skip_unknown 5883 + |> Jsont.Object.finish 5884 + end 5885 + end 5886 + 5887 + module Account = struct 5888 + module T = struct 5889 + type t = { 5890 + avatars : ActorImage.T.t list option; 5891 + created_at : Ptime.t option; 5892 + followers_count : int option; (** number of followers of this actor, as seen by this instance *) 5893 + following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 5894 + host : string option; (** server on which the actor is resident *) 5895 + host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 5896 + id : Id.T.t option; 5897 + name : Username.T.t option; (** immutable name of the actor, used to find or mention it *) 5898 + updated_at : Ptime.t option; 5899 + url : string option; 5900 + user_id : Jsont.json option; (** object id for the user tied to this account *) 5901 + display_name : string option; (** editable name of the account, displayed in its representations *) 5902 + description : string option; (** text or bio displayed on the account's profile *) 5903 + } 5904 + 5905 + let v ?avatars ?created_at ?followers_count ?following_count ?host ?host_redundancy_allowed ?id ?name ?updated_at ?url ?user_id ?display_name ?description () = { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; updated_at; url; user_id; display_name; description } 5906 + 5907 + let avatars t = t.avatars 5908 + let created_at t = t.created_at 5909 + let followers_count t = t.followers_count 5910 + let following_count t = t.following_count 5911 + let host t = t.host 5912 + let host_redundancy_allowed t = t.host_redundancy_allowed 5913 + let id t = t.id 5914 + let name t = t.name 5915 + let updated_at t = t.updated_at 5916 + let url t = t.url 5917 + let user_id t = t.user_id 5918 + let display_name t = t.display_name 5919 + let description t = t.description 5920 + 5921 + let jsont : t Jsont.t = 5922 + Jsont.Object.map ~kind:"Account" 5923 + (fun avatars created_at followers_count following_count host host_redundancy_allowed id name updated_at url user_id display_name description -> { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; updated_at; url; user_id; display_name; description }) 5924 + |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 5925 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 5926 + |> Jsont.Object.opt_mem "followersCount" Jsont.int ~enc:(fun r -> r.followers_count) 5927 + |> Jsont.Object.opt_mem "followingCount" Jsont.int ~enc:(fun r -> r.following_count) 5928 + |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 5929 + |> Jsont.Object.mem "hostRedundancyAllowed" Openapi.Runtime.nullable_bool 5930 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.host_redundancy_allowed) 5931 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 5932 + |> Jsont.Object.opt_mem "name" Username.T.jsont ~enc:(fun r -> r.name) 5933 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 5934 + |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 5935 + |> Jsont.Object.opt_mem "userId" Jsont.json ~enc:(fun r -> r.user_id) 5936 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 5937 + |> Jsont.Object.mem "description" Openapi.Runtime.nullable_string 5938 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.description) 5939 + |> Jsont.Object.skip_unknown 5940 + |> Jsont.Object.finish 5941 + end 5942 + 5943 + (** Get an account 5944 + @param name The username or handle of the account 5945 + *) 5946 + let get_account ~name client () = 5947 + let op_name = "get_account" in 5948 + let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}" in 5949 + let query = "" in 5950 + let url = client.base_url ^ url_path ^ query in 5951 + let response = 5952 + try Requests.get client.session url 5953 + with Eio.Io _ as ex -> 5954 + let bt = Printexc.get_raw_backtrace () in 5955 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 5956 + in 5957 + if Requests.Response.ok response then 5958 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 5959 + else 5960 + raise (Openapi.Runtime.Api_error { 5961 + operation = op_name; 5962 + method_ = "GET"; 5963 + url; 5964 + status = Requests.Response.status_code response; 5965 + body = Requests.Response.text response; 5966 + }) 5967 + end 5968 + 5969 + module VideoComment = struct 5970 + module T = struct 5971 + type t = { 5972 + account : Account.T.t option; 5973 + created_at : Ptime.t option; 5974 + deleted_at : Ptime.t option; 5975 + held_for_review : bool option; 5976 + id : Id.T.t option; 5977 + in_reply_to_comment_id : Id.T.t option; 5978 + is_deleted : bool option; 5979 + text : string option; (** Text of the comment *) 5980 + thread_id : Id.T.t option; 5981 + total_replies : int option; 5982 + total_replies_from_video_author : int option; 5983 + updated_at : Ptime.t option; 5984 + url : string option; 5985 + video_id : Jsont.json option; 5986 + } 5987 + 5988 + let v ?account ?created_at ?deleted_at ?held_for_review ?id ?in_reply_to_comment_id ?is_deleted ?text ?thread_id ?total_replies ?total_replies_from_video_author ?updated_at ?url ?video_id () = { account; created_at; deleted_at; held_for_review; id; in_reply_to_comment_id; is_deleted; text; thread_id; total_replies; total_replies_from_video_author; updated_at; url; video_id } 5989 + 5990 + let account t = t.account 5991 + let created_at t = t.created_at 5992 + let deleted_at t = t.deleted_at 5993 + let held_for_review t = t.held_for_review 5994 + let id t = t.id 5995 + let in_reply_to_comment_id t = t.in_reply_to_comment_id 5996 + let is_deleted t = t.is_deleted 5997 + let text t = t.text 5998 + let thread_id t = t.thread_id 5999 + let total_replies t = t.total_replies 6000 + let total_replies_from_video_author t = t.total_replies_from_video_author 6001 + let updated_at t = t.updated_at 6002 + let url t = t.url 6003 + let video_id t = t.video_id 6004 + 6005 + let jsont : t Jsont.t = 6006 + Jsont.Object.map ~kind:"VideoComment" 6007 + (fun account created_at deleted_at held_for_review id in_reply_to_comment_id is_deleted text thread_id total_replies total_replies_from_video_author updated_at url video_id -> { account; created_at; deleted_at; held_for_review; id; in_reply_to_comment_id; is_deleted; text; thread_id; total_replies; total_replies_from_video_author; updated_at; url; video_id }) 6008 + |> Jsont.Object.opt_mem "account" Account.T.jsont ~enc:(fun r -> r.account) 6009 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 6010 + |> Jsont.Object.mem "deletedAt" Openapi.Runtime.nullable_ptime 6011 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.deleted_at) 6012 + |> Jsont.Object.opt_mem "heldForReview" Jsont.bool ~enc:(fun r -> r.held_for_review) 6013 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 6014 + |> Jsont.Object.opt_mem "inReplyToCommentId" Id.T.jsont ~enc:(fun r -> r.in_reply_to_comment_id) 6015 + |> Jsont.Object.opt_mem "isDeleted" Jsont.bool ~enc:(fun r -> r.is_deleted) 6016 + |> Jsont.Object.opt_mem "text" Jsont.string ~enc:(fun r -> r.text) 6017 + |> Jsont.Object.opt_mem "threadId" Id.T.jsont ~enc:(fun r -> r.thread_id) 6018 + |> Jsont.Object.opt_mem "totalReplies" Jsont.int ~enc:(fun r -> r.total_replies) 6019 + |> Jsont.Object.opt_mem "totalRepliesFromVideoAuthor" Jsont.int ~enc:(fun r -> r.total_replies_from_video_author) 6020 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 6021 + |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 6022 + |> Jsont.Object.opt_mem "videoId" Jsont.json ~enc:(fun r -> r.video_id) 6023 + |> Jsont.Object.skip_unknown 6024 + |> Jsont.Object.finish 6025 + end 6026 + end 6027 + 6028 + module VideoCommentThreadTree = struct 6029 + module T = struct 6030 + type t = { 6031 + children : Jsont.json list option; 6032 + comment : VideoComment.T.t option; 6033 + } 6034 + 6035 + let v ?children ?comment () = { children; comment } 6036 + 6037 + let children t = t.children 6038 + let comment t = t.comment 6039 + 6040 + let jsont : t Jsont.t = 6041 + Jsont.Object.map ~kind:"VideoCommentThreadTree" 6042 + (fun children comment -> { children; comment }) 6043 + |> Jsont.Object.opt_mem "children" (Jsont.list Jsont.json) ~enc:(fun r -> r.children) 6044 + |> Jsont.Object.opt_mem "comment" VideoComment.T.jsont ~enc:(fun r -> r.comment) 6045 + |> Jsont.Object.skip_unknown 6046 + |> Jsont.Object.finish 6047 + end 6048 + 6049 + (** Get a thread 6050 + @param id The object id, uuid or short uuid 6051 + @param thread_id The thread id (root comment id) 6052 + *) 6053 + let get_api_v1_videos_comment_threads ~id ~thread_id client () = 6054 + let op_name = "get_api_v1_videos_comment_threads" in 6055 + let url_path = Openapi.Runtime.Path.render ~params:[("id", id); ("threadId", thread_id)] "/api/v1/videos/{id}/comment-threads/{threadId}" in 6056 + let query = "" in 6057 + let url = client.base_url ^ url_path ^ query in 6058 + let response = 6059 + try Requests.get client.session url 6060 + with Eio.Io _ as ex -> 6061 + let bt = Printexc.get_raw_backtrace () in 6062 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 6063 + in 6064 + if Requests.Response.ok response then 6065 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6066 + else 6067 + raise (Openapi.Runtime.Api_error { 6068 + operation = op_name; 6069 + method_ = "GET"; 6070 + url; 6071 + status = Requests.Response.status_code response; 6072 + body = Requests.Response.text response; 6073 + }) 6074 + end 6075 + 6076 + module CommentThreadPost = struct 6077 + module Response = struct 6078 + type t = { 6079 + comment : VideoComment.T.t option; 6080 + } 6081 + 6082 + let v ?comment () = { comment } 6083 + 6084 + let comment t = t.comment 6085 + 6086 + let jsont : t Jsont.t = 6087 + Jsont.Object.map ~kind:"CommentThreadPostResponse" 6088 + (fun comment -> { comment }) 6089 + |> Jsont.Object.opt_mem "comment" VideoComment.T.jsont ~enc:(fun r -> r.comment) 6090 + |> Jsont.Object.skip_unknown 6091 + |> Jsont.Object.finish 6092 + end 6093 + 6094 + (** Create a thread 6095 + @param id The object id, uuid or short uuid 6096 + *) 6097 + let post_api_v1_videos_comment_threads ~id client () = 6098 + let op_name = "post_api_v1_videos_comment_threads" in 6099 + let url_path = Openapi.Runtime.Path.render ~params:[("id", id)] "/api/v1/videos/{id}/comment-threads" in 6100 + let query = "" in 6101 + let url = client.base_url ^ url_path ^ query in 6102 + let response = 6103 + try Requests.post client.session url 6104 + with Eio.Io _ as ex -> 6105 + let bt = Printexc.get_raw_backtrace () in 6106 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "POST" url 6107 + in 6108 + if Requests.Response.ok response then 6109 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 6110 + else 6111 + raise (Openapi.Runtime.Api_error { 6112 + operation = op_name; 6113 + method_ = "POST"; 6114 + url; 6115 + status = Requests.Response.status_code response; 6116 + body = Requests.Response.text response; 6117 + }) 6118 + 6119 + (** Reply to a thread of a video 6120 + @param id The object id, uuid or short uuid 6121 + @param comment_id The comment id 6122 + *) 6123 + let post_api_v1_videos_comments ~id ~comment_id client () = 6124 + let op_name = "post_api_v1_videos_comments" in 6125 + let url_path = Openapi.Runtime.Path.render ~params:[("id", id); ("commentId", comment_id)] "/api/v1/videos/{id}/comments/{commentId}" in 6126 + let query = "" in 6127 + let url = client.base_url ^ url_path ^ query in 6128 + let response = 6129 + try Requests.post client.session url 6130 + with Eio.Io _ as ex -> 6131 + let bt = Printexc.get_raw_backtrace () in 6132 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "POST" url 6133 + in 6134 + if Requests.Response.ok response then 6135 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 6136 + else 6137 + raise (Openapi.Runtime.Api_error { 6138 + operation = op_name; 6139 + method_ = "POST"; 6140 + url; 6141 + status = Requests.Response.status_code response; 6142 + body = Requests.Response.text response; 6143 + }) 6144 + end 6145 + 6146 + module CommentThread = struct 6147 + module Response = struct 6148 + type t = { 6149 + data : VideoComment.T.t list option; 6150 + total : int option; (** Total threads (included deleted ones) on this video *) 6151 + total_not_deleted_comments : int option; (** Total not-deleted threads (included deleted ones) on this video *) 6152 + } 6153 + 6154 + let v ?data ?total ?total_not_deleted_comments () = { data; total; total_not_deleted_comments } 6155 + 6156 + let data t = t.data 6157 + let total t = t.total 6158 + let total_not_deleted_comments t = t.total_not_deleted_comments 6159 + 6160 + let jsont : t Jsont.t = 6161 + Jsont.Object.map ~kind:"CommentThreadResponse" 6162 + (fun data total total_not_deleted_comments -> { data; total; total_not_deleted_comments }) 6163 + |> Jsont.Object.opt_mem "data" (Jsont.list VideoComment.T.jsont) ~enc:(fun r -> r.data) 6164 + |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 6165 + |> Jsont.Object.opt_mem "totalNotDeletedComments" Jsont.int ~enc:(fun r -> r.total_not_deleted_comments) 6166 + |> Jsont.Object.skip_unknown 6167 + |> Jsont.Object.finish 6168 + end 6169 + 6170 + (** List threads of a video 6171 + @param id The object id, uuid or short uuid 6172 + @param start Offset used to paginate results 6173 + @param count Number of items to return 6174 + @param sort Sort comments by criteria 6175 + *) 6176 + let get_api_v1_videos_comment_threads ~id ?start ?count ?sort client () = 6177 + let op_name = "get_api_v1_videos_comment_threads" in 6178 + let url_path = Openapi.Runtime.Path.render ~params:[("id", id)] "/api/v1/videos/{id}/comment-threads" in 6179 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 6180 + let url = client.base_url ^ url_path ^ query in 6181 + let response = 6182 + try Requests.get client.session url 6183 + with Eio.Io _ as ex -> 6184 + let bt = Printexc.get_raw_backtrace () in 6185 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 6186 + in 6187 + if Requests.Response.ok response then 6188 + Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 6189 + else 6190 + raise (Openapi.Runtime.Api_error { 6191 + operation = op_name; 6192 + method_ = "GET"; 6193 + url; 6194 + status = Requests.Response.status_code response; 6195 + body = Requests.Response.text response; 6196 + }) 6197 + end 6198 + 6199 + module VideoChannel = struct 6200 + module Update = struct 6201 + type t = { 6202 + description : Jsont.json option; (** Channel description *) 6203 + display_name : Jsont.json option; (** Channel display name *) 6204 + support : Jsont.json option; (** How to support/fund the channel *) 6205 + bulk_videos_support_update : bool option; (** Update the support field for all videos of this channel *) 6206 + } 6207 + 6208 + let v ?description ?display_name ?support ?bulk_videos_support_update () = { description; display_name; support; bulk_videos_support_update } 6209 + 6210 + let description t = t.description 6211 + let display_name t = t.display_name 6212 + let support t = t.support 6213 + let bulk_videos_support_update t = t.bulk_videos_support_update 6214 + 6215 + let jsont : t Jsont.t = 6216 + Jsont.Object.map ~kind:"VideoChannelUpdate" 6217 + (fun description display_name support bulk_videos_support_update -> { description; display_name; support; bulk_videos_support_update }) 6218 + |> Jsont.Object.opt_mem "description" Jsont.json ~enc:(fun r -> r.description) 6219 + |> Jsont.Object.opt_mem "displayName" Jsont.json ~enc:(fun r -> r.display_name) 6220 + |> Jsont.Object.opt_mem "support" Jsont.json ~enc:(fun r -> r.support) 6221 + |> Jsont.Object.opt_mem "bulkVideosSupportUpdate" Jsont.bool ~enc:(fun r -> r.bulk_videos_support_update) 6222 + |> Jsont.Object.skip_unknown 6223 + |> Jsont.Object.finish 6224 + end 6225 + 6226 + module Create = struct 6227 + type t = { 6228 + description : Jsont.json option; (** Channel description *) 6229 + display_name : Jsont.json; (** Channel display name *) 6230 + support : Jsont.json option; (** How to support/fund the channel *) 6231 + name : UsernameChannel.T.t; (** username of the channel to create *) 6232 + } 6233 + 6234 + let v ~display_name ~name ?description ?support () = { description; display_name; support; name } 6235 + 6236 + let description t = t.description 6237 + let display_name t = t.display_name 6238 + let support t = t.support 6239 + let name t = t.name 6240 + 6241 + let jsont : t Jsont.t = 6242 + Jsont.Object.map ~kind:"VideoChannelCreate" 6243 + (fun description display_name support name -> { description; display_name; support; name }) 6244 + |> Jsont.Object.opt_mem "description" Jsont.json ~enc:(fun r -> r.description) 6245 + |> Jsont.Object.mem "displayName" Jsont.json ~enc:(fun r -> r.display_name) 6246 + |> Jsont.Object.opt_mem "support" Jsont.json ~enc:(fun r -> r.support) 6247 + |> Jsont.Object.mem "name" UsernameChannel.T.jsont ~enc:(fun r -> r.name) 6248 + |> Jsont.Object.skip_unknown 6249 + |> Jsont.Object.finish 6250 + end 6251 + 6252 + module T = struct 6253 + type t = { 6254 + avatars : ActorImage.T.t list option; 6255 + created_at : Ptime.t option; 6256 + followers_count : int option; (** number of followers of this actor, as seen by this instance *) 6257 + following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 6258 + host : string option; (** server on which the actor is resident *) 6259 + host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 6260 + id : Id.T.t option; 6261 + name : Username.T.t option; (** immutable name of the actor, used to find or mention it *) 6262 + url : string option; 6263 + display_name : string option; (** editable name of the channel, displayed in its representations *) 6264 + description : string option; 6265 + support : string option; (** text shown by default on all videos of this channel, to tell the audience how to support it *) 6266 + is_local : bool option; 6267 + updated_at : Ptime.t option; 6268 + banners : ActorImage.T.t list option; 6269 + owner_account : Account.T.t option; 6270 + } 6271 + 6272 + let v ?avatars ?created_at ?followers_count ?following_count ?host ?host_redundancy_allowed ?id ?name ?url ?display_name ?description ?support ?is_local ?updated_at ?banners ?owner_account () = { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; url; display_name; description; support; is_local; updated_at; banners; owner_account } 6273 + 6274 + let avatars t = t.avatars 6275 + let created_at t = t.created_at 6276 + let followers_count t = t.followers_count 6277 + let following_count t = t.following_count 6278 + let host t = t.host 6279 + let host_redundancy_allowed t = t.host_redundancy_allowed 6280 + let id t = t.id 6281 + let name t = t.name 6282 + let url t = t.url 6283 + let display_name t = t.display_name 6284 + let description t = t.description 6285 + let support t = t.support 6286 + let is_local t = t.is_local 6287 + let updated_at t = t.updated_at 6288 + let banners t = t.banners 6289 + let owner_account t = t.owner_account 6290 + 6291 + let jsont : t Jsont.t = 6292 + Jsont.Object.map ~kind:"VideoChannel" 6293 + (fun avatars created_at followers_count following_count host host_redundancy_allowed id name url display_name description support is_local updated_at banners owner_account -> { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; url; display_name; description; support; is_local; updated_at; banners; owner_account }) 6294 + |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 6295 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 6296 + |> Jsont.Object.opt_mem "followersCount" Jsont.int ~enc:(fun r -> r.followers_count) 6297 + |> Jsont.Object.opt_mem "followingCount" Jsont.int ~enc:(fun r -> r.following_count) 6298 + |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 6299 + |> Jsont.Object.mem "hostRedundancyAllowed" Openapi.Runtime.nullable_bool 6300 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.host_redundancy_allowed) 6301 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 6302 + |> Jsont.Object.opt_mem "name" Username.T.jsont ~enc:(fun r -> r.name) 6303 + |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 6304 + |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 6305 + |> Jsont.Object.mem "description" Openapi.Runtime.nullable_string 6306 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.description) 6307 + |> Jsont.Object.mem "support" Openapi.Runtime.nullable_string 6308 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.support) 6309 + |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 6310 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 6311 + |> Jsont.Object.opt_mem "banners" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.banners) 6312 + |> Jsont.Object.opt_mem "ownerAccount" Account.T.jsont ~enc:(fun r -> r.owner_account) 6313 + |> Jsont.Object.skip_unknown 6314 + |> Jsont.Object.finish 6315 + end 6316 + 6317 + (** Get subscription of my user 6318 + @param subscription_handle The subscription handle 6319 + *) 6320 + let get_api_v1_users_me_subscriptions ~subscription_handle client () = 6321 + let op_name = "get_api_v1_users_me_subscriptions" in 6322 + let url_path = Openapi.Runtime.Path.render ~params:[("subscriptionHandle", subscription_handle)] "/api/v1/users/me/subscriptions/{subscriptionHandle}" in 6323 + let query = "" in 6324 + let url = client.base_url ^ url_path ^ query in 6325 + let response = 6326 + try Requests.get client.session url 6327 + with Eio.Io _ as ex -> 6328 + let bt = Printexc.get_raw_backtrace () in 6329 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 6330 + in 6331 + if Requests.Response.ok response then 6332 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6333 + else 6334 + raise (Openapi.Runtime.Api_error { 6335 + operation = op_name; 6336 + method_ = "GET"; 6337 + url; 6338 + status = Requests.Response.status_code response; 6339 + body = Requests.Response.text response; 6340 + }) 6341 + 6342 + (** Get a video channel 6343 + @param channel_handle The video channel handle 6344 + *) 6345 + let get_video_channel ~channel_handle client () = 6346 + let op_name = "get_video_channel" in 6347 + let url_path = Openapi.Runtime.Path.render ~params:[("channelHandle", channel_handle)] "/api/v1/video-channels/{channelHandle}" in 6348 + let query = "" in 6349 + let url = client.base_url ^ url_path ^ query in 6350 + let response = 6351 + try Requests.get client.session url 6352 + with Eio.Io _ as ex -> 6353 + let bt = Printexc.get_raw_backtrace () in 6354 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 6355 + in 6356 + if Requests.Response.ok response then 6357 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6358 + else 6359 + raise (Openapi.Runtime.Api_error { 6360 + operation = op_name; 6361 + method_ = "GET"; 6362 + url; 6363 + status = Requests.Response.status_code response; 6364 + body = Requests.Response.text response; 6365 + }) 6366 + end 6367 + 6368 + module VideoDetails = struct 6369 + module T = struct 6370 + type t = { 6371 + aspect_ratio : float option; (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 6372 + blacklisted : bool option; 6373 + blacklisted_reason : string option; 6374 + category : VideoConstantNumberCategory.T.t option; (** category in which the video is classified *) 6375 + comments : int option; (** **PeerTube >= 7.2** Number of comments on the video *) 6376 + created_at : Ptime.t option; (** time at which the video object was first drafted *) 6377 + dislikes : int option; 6378 + duration : int option; (** duration of the video in seconds *) 6379 + embed_path : string option; 6380 + id : Id.T.t option; (** object id for the video *) 6381 + is_live : bool option; 6382 + is_local : bool option; 6383 + language : VideoConstantStringLanguage.T.t option; (** main language used in the video *) 6384 + licence : VideoConstantNumberLicence.T.t option; (** licence under which the video is distributed *) 6385 + likes : int option; 6386 + live_schedules : LiveSchedule.T.t list option; 6387 + name : string option; (** title of the video *) 6388 + nsfw : bool option; 6389 + nsfw_flags : Nsfwflag.T.t option; 6390 + nsfw_summary : string option; (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 6391 + originally_published_at : Ptime.t option; (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 6392 + preview_path : string option; 6393 + privacy : VideoPrivacyConstant.T.t option; (** privacy policy used to distribute the video *) 6394 + published_at : Ptime.t option; (** time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. *) 6395 + scheduled_update : VideoScheduled.Update.t option; 6396 + short_uuid : ShortUuid.T.t option; 6397 + state : VideoStateConstant.T.t option; (** represents the internal state of the video processing within the PeerTube instance *) 6398 + thumbnail_path : string option; 6399 + truncated_description : string option; (** truncated description of the video, written in Markdown. 6400 + *) 6401 + updated_at : Ptime.t option; (** last time the video's metadata was modified *) 6402 + user_history : Jsont.json option; 6403 + uuid : Uuidv4.T.t option; (** universal identifier for the video, that can be used across instances *) 6404 + views : int option; 6405 + wait_transcoding : bool option; 6406 + viewers : int option; (** If the video is a live, you have the amount of current viewers *) 6407 + description : string option; (** full description of the video, written in Markdown. 6408 + *) 6409 + support : string option; (** A text tell the audience how to support the video creator *) 6410 + channel : VideoChannel.T.t option; 6411 + account : Account.T.t option; 6412 + tags : string list option; 6413 + comments_policy : VideoCommentsPolicyConstant.T.t option; 6414 + download_enabled : bool option; 6415 + input_file_updated_at : Ptime.t option; (** Latest input file update. Null if the file has never been replaced since the original upload *) 6416 + tracker_urls : string list option; 6417 + files : VideoFile.T.t list option; (** Web compatible video files. If Web Video is disabled on the server: 6418 + 6419 + - field will be empty 6420 + - video files will be found in `streamingPlaylists[].files` field 6421 + *) 6422 + streaming_playlists : VideoStreamingPlaylists.T.t list option; (** HLS playlists/manifest files. If HLS is disabled on the server: 6423 + 6424 + - field will be empty 6425 + - video files will be found in `files` field 6426 + *) 6427 + } 6428 + 6429 + let v ?aspect_ratio ?blacklisted ?blacklisted_reason ?category ?comments ?created_at ?dislikes ?duration ?embed_path ?id ?is_live ?is_local ?language ?licence ?likes ?live_schedules ?name ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?preview_path ?privacy ?published_at ?scheduled_update ?short_uuid ?state ?thumbnail_path ?truncated_description ?updated_at ?user_history ?uuid ?views ?wait_transcoding ?viewers ?description ?support ?channel ?account ?tags ?comments_policy ?download_enabled ?input_file_updated_at ?tracker_urls ?files ?streaming_playlists () = { aspect_ratio; blacklisted; blacklisted_reason; category; comments; created_at; dislikes; duration; embed_path; id; is_live; is_local; language; licence; likes; live_schedules; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; preview_path; privacy; published_at; scheduled_update; short_uuid; state; thumbnail_path; truncated_description; updated_at; user_history; uuid; views; wait_transcoding; viewers; description; support; channel; account; tags; comments_policy; download_enabled; input_file_updated_at; tracker_urls; files; streaming_playlists } 6430 + 6431 + let aspect_ratio t = t.aspect_ratio 6432 + let blacklisted t = t.blacklisted 6433 + let blacklisted_reason t = t.blacklisted_reason 6434 + let category t = t.category 6435 + let comments t = t.comments 6436 + let created_at t = t.created_at 6437 + let dislikes t = t.dislikes 6438 + let duration t = t.duration 6439 + let embed_path t = t.embed_path 6440 + let id t = t.id 6441 + let is_live t = t.is_live 6442 + let is_local t = t.is_local 6443 + let language t = t.language 6444 + let licence t = t.licence 6445 + let likes t = t.likes 6446 + let live_schedules t = t.live_schedules 6447 + let name t = t.name 6448 + let nsfw t = t.nsfw 6449 + let nsfw_flags t = t.nsfw_flags 6450 + let nsfw_summary t = t.nsfw_summary 6451 + let originally_published_at t = t.originally_published_at 6452 + let preview_path t = t.preview_path 6453 + let privacy t = t.privacy 6454 + let published_at t = t.published_at 6455 + let scheduled_update t = t.scheduled_update 6456 + let short_uuid t = t.short_uuid 6457 + let state t = t.state 6458 + let thumbnail_path t = t.thumbnail_path 6459 + let truncated_description t = t.truncated_description 6460 + let updated_at t = t.updated_at 6461 + let user_history t = t.user_history 6462 + let uuid t = t.uuid 6463 + let views t = t.views 6464 + let wait_transcoding t = t.wait_transcoding 6465 + let viewers t = t.viewers 6466 + let description t = t.description 6467 + let support t = t.support 6468 + let channel t = t.channel 6469 + let account t = t.account 6470 + let tags t = t.tags 6471 + let comments_policy t = t.comments_policy 6472 + let download_enabled t = t.download_enabled 6473 + let input_file_updated_at t = t.input_file_updated_at 6474 + let tracker_urls t = t.tracker_urls 6475 + let files t = t.files 6476 + let streaming_playlists t = t.streaming_playlists 6477 + 6478 + let jsont : t Jsont.t = 6479 + Jsont.Object.map ~kind:"VideoDetails" 6480 + (fun aspect_ratio blacklisted blacklisted_reason category comments created_at dislikes duration embed_path id is_live is_local language licence likes live_schedules name nsfw nsfw_flags nsfw_summary originally_published_at preview_path privacy published_at scheduled_update short_uuid state thumbnail_path truncated_description updated_at user_history uuid views wait_transcoding viewers description support channel account tags comments_policy download_enabled input_file_updated_at tracker_urls files streaming_playlists -> { aspect_ratio; blacklisted; blacklisted_reason; category; comments; created_at; dislikes; duration; embed_path; id; is_live; is_local; language; licence; likes; live_schedules; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; preview_path; privacy; published_at; scheduled_update; short_uuid; state; thumbnail_path; truncated_description; updated_at; user_history; uuid; views; wait_transcoding; viewers; description; support; channel; account; tags; comments_policy; download_enabled; input_file_updated_at; tracker_urls; files; streaming_playlists }) 6481 + |> Jsont.Object.mem "aspectRatio" Openapi.Runtime.nullable_float 6482 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.aspect_ratio) 6483 + |> Jsont.Object.mem "blacklisted" Openapi.Runtime.nullable_bool 6484 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.blacklisted) 6485 + |> Jsont.Object.mem "blacklistedReason" Openapi.Runtime.nullable_string 6486 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.blacklisted_reason) 6487 + |> Jsont.Object.opt_mem "category" VideoConstantNumberCategory.T.jsont ~enc:(fun r -> r.category) 6488 + |> Jsont.Object.opt_mem "comments" Jsont.int ~enc:(fun r -> r.comments) 6489 + |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 6490 + |> Jsont.Object.opt_mem "dislikes" Jsont.int ~enc:(fun r -> r.dislikes) 6491 + |> Jsont.Object.opt_mem "duration" Jsont.int ~enc:(fun r -> r.duration) 6492 + |> Jsont.Object.opt_mem "embedPath" Jsont.string ~enc:(fun r -> r.embed_path) 6493 + |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 6494 + |> Jsont.Object.opt_mem "isLive" Jsont.bool ~enc:(fun r -> r.is_live) 6495 + |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 6496 + |> Jsont.Object.opt_mem "language" VideoConstantStringLanguage.T.jsont ~enc:(fun r -> r.language) 6497 + |> Jsont.Object.opt_mem "licence" VideoConstantNumberLicence.T.jsont ~enc:(fun r -> r.licence) 6498 + |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 6499 + |> Jsont.Object.opt_mem "liveSchedules" (Jsont.list LiveSchedule.T.jsont) ~enc:(fun r -> r.live_schedules) 6500 + |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 6501 + |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 6502 + |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 6503 + |> Jsont.Object.opt_mem "nsfwSummary" Jsont.string ~enc:(fun r -> r.nsfw_summary) 6504 + |> Jsont.Object.mem "originallyPublishedAt" Openapi.Runtime.nullable_ptime 6505 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.originally_published_at) 6506 + |> Jsont.Object.opt_mem "previewPath" Jsont.string ~enc:(fun r -> r.preview_path) 6507 + |> Jsont.Object.opt_mem "privacy" VideoPrivacyConstant.T.jsont ~enc:(fun r -> r.privacy) 6508 + |> Jsont.Object.opt_mem "publishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.published_at) 6509 + |> Jsont.Object.opt_mem "scheduledUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.scheduled_update) 6510 + |> Jsont.Object.opt_mem "shortUUID" ShortUuid.T.jsont ~enc:(fun r -> r.short_uuid) 6511 + |> Jsont.Object.opt_mem "state" VideoStateConstant.T.jsont ~enc:(fun r -> r.state) 6512 + |> Jsont.Object.opt_mem "thumbnailPath" Jsont.string ~enc:(fun r -> r.thumbnail_path) 6513 + |> Jsont.Object.mem "truncatedDescription" Openapi.Runtime.nullable_string 6514 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.truncated_description) 6515 + |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 6516 + |> Jsont.Object.mem "userHistory" (Openapi.Runtime.nullable_any Jsont.json) 6517 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.user_history) 6518 + |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 6519 + |> Jsont.Object.opt_mem "views" Jsont.int ~enc:(fun r -> r.views) 6520 + |> Jsont.Object.mem "waitTranscoding" Openapi.Runtime.nullable_bool 6521 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.wait_transcoding) 6522 + |> Jsont.Object.opt_mem "viewers" Jsont.int ~enc:(fun r -> r.viewers) 6523 + |> Jsont.Object.mem "description" Openapi.Runtime.nullable_string 6524 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.description) 6525 + |> Jsont.Object.mem "support" Openapi.Runtime.nullable_string 6526 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.support) 6527 + |> Jsont.Object.opt_mem "channel" VideoChannel.T.jsont ~enc:(fun r -> r.channel) 6528 + |> Jsont.Object.opt_mem "account" Account.T.jsont ~enc:(fun r -> r.account) 6529 + |> Jsont.Object.opt_mem "tags" (Jsont.list Jsont.string) ~enc:(fun r -> r.tags) 6530 + |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicyConstant.T.jsont ~enc:(fun r -> r.comments_policy) 6531 + |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 6532 + |> Jsont.Object.mem "inputFileUpdatedAt" Openapi.Runtime.nullable_ptime 6533 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.input_file_updated_at) 6534 + |> Jsont.Object.opt_mem "trackerUrls" (Jsont.list Jsont.string) ~enc:(fun r -> r.tracker_urls) 6535 + |> Jsont.Object.opt_mem "files" (Jsont.list VideoFile.T.jsont) ~enc:(fun r -> r.files) 6536 + |> Jsont.Object.opt_mem "streamingPlaylists" (Jsont.list VideoStreamingPlaylists.T.jsont) ~enc:(fun r -> r.streaming_playlists) 6537 + |> Jsont.Object.skip_unknown 6538 + |> Jsont.Object.finish 6539 + end 6540 + 6541 + (** Get a video 6542 + @param id The object id, uuid or short uuid 6543 + *) 6544 + let get_video ~id client () = 6545 + let op_name = "get_video" in 6546 + let url_path = Openapi.Runtime.Path.render ~params:[("id", id)] "/api/v1/videos/{id}" in 6547 + let query = "" in 6548 + let url = client.base_url ^ url_path ^ query in 6549 + let response = 6550 + try Requests.get client.session url 6551 + with Eio.Io _ as ex -> 6552 + let bt = Printexc.get_raw_backtrace () in 6553 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 6554 + in 6555 + if Requests.Response.ok response then 6556 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6557 + else 6558 + raise (Openapi.Runtime.Api_error { 6559 + operation = op_name; 6560 + method_ = "GET"; 6561 + url; 6562 + status = Requests.Response.status_code response; 6563 + body = Requests.Response.text response; 6564 + }) 6565 + end 6566 + 3939 6567 module VideoChannelSync = struct 3940 6568 module Create = struct 3941 6569 type t = { ··· 3983 6611 |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 3984 6612 |> Jsont.Object.opt_mem "externalChannelUrl" Jsont.string ~enc:(fun r -> r.external_channel_url) 3985 6613 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3986 - |> Jsont.Object.opt_mem "lastSyncAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.last_sync_at) 6614 + |> Jsont.Object.mem "lastSyncAt" Openapi.Runtime.nullable_ptime 6615 + ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.last_sync_at) 3987 6616 |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 3988 6617 |> Jsont.Object.skip_unknown 3989 6618 |> Jsont.Object.finish 3990 6619 end 6620 + end 6621 + 6622 + module VideoChannelSyncList = struct 6623 + module T = struct 6624 + type t = { 6625 + data : VideoChannelSync.T.t list option; 6626 + total : int option; 6627 + } 6628 + 6629 + let v ?data ?total () = { data; total } 6630 + 6631 + let data t = t.data 6632 + let total t = t.total 6633 + 6634 + let jsont : t Jsont.t = 6635 + Jsont.Object.map ~kind:"VideoChannelSyncList" 6636 + (fun data total -> { data; total }) 6637 + |> Jsont.Object.opt_mem "data" (Jsont.list VideoChannelSync.T.jsont) ~enc:(fun r -> r.data) 6638 + |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 6639 + |> Jsont.Object.skip_unknown 6640 + |> Jsont.Object.finish 6641 + end 6642 + 6643 + (** List the synchronizations of video channels of an account 6644 + @param name The username or handle of the account 6645 + @param start Offset used to paginate results 6646 + @param count Number of items to return 6647 + @param sort Sort column 6648 + @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 6649 + *) 6650 + let get_api_v1_accounts_video_channel_syncs ~name ?start ?count ?sort ?include_collaborations client () = 6651 + let op_name = "get_api_v1_accounts_video_channel_syncs" in 6652 + let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/video-channel-syncs" in 6653 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"includeCollaborations" ~value:include_collaborations]) in 6654 + let url = client.base_url ^ url_path ^ query in 6655 + let response = 6656 + try Requests.get client.session url 6657 + with Eio.Io _ as ex -> 6658 + let bt = Printexc.get_raw_backtrace () in 6659 + Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 6660 + in 6661 + if Requests.Response.ok response then 6662 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6663 + else 6664 + raise (Openapi.Runtime.Api_error { 6665 + operation = op_name; 6666 + method_ = "GET"; 6667 + url; 6668 + status = Requests.Response.status_code response; 6669 + body = Requests.Response.text response; 6670 + }) 3991 6671 end 3992 6672 3993 6673 module Client = struct ··· 9180 11860 }) 9181 11861 end 9182 11862 9183 - module VideoBlacklist = struct 9184 - module T = struct 9185 - type t = { 9186 - created_at : Ptime.t option; 9187 - description : string option; 9188 - dislikes : int option; 9189 - duration : int option; 9190 - id : Id.T.t option; 9191 - likes : int option; 9192 - name : string option; 9193 - nsfw : bool option; 9194 - updated_at : Ptime.t option; 9195 - uuid : Uuidv4.T.t option; 9196 - video_id : Jsont.json option; 9197 - views : int option; 9198 - } 9199 - 9200 - let v ?created_at ?description ?dislikes ?duration ?id ?likes ?name ?nsfw ?updated_at ?uuid ?video_id ?views () = { created_at; description; dislikes; duration; id; likes; name; nsfw; updated_at; uuid; video_id; views } 9201 - 9202 - let created_at t = t.created_at 9203 - let description t = t.description 9204 - let dislikes t = t.dislikes 9205 - let duration t = t.duration 9206 - let id t = t.id 9207 - let likes t = t.likes 9208 - let name t = t.name 9209 - let nsfw t = t.nsfw 9210 - let updated_at t = t.updated_at 9211 - let uuid t = t.uuid 9212 - let video_id t = t.video_id 9213 - let views t = t.views 9214 - 9215 - let jsont : t Jsont.t = 9216 - Jsont.Object.map ~kind:"VideoBlacklist" 9217 - (fun created_at description dislikes duration id likes name nsfw updated_at uuid video_id views -> { created_at; description; dislikes; duration; id; likes; name; nsfw; updated_at; uuid; video_id; views }) 9218 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 9219 - |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 9220 - |> Jsont.Object.opt_mem "dislikes" Jsont.int ~enc:(fun r -> r.dislikes) 9221 - |> Jsont.Object.opt_mem "duration" Jsont.int ~enc:(fun r -> r.duration) 9222 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9223 - |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 9224 - |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 9225 - |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 9226 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 9227 - |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 9228 - |> Jsont.Object.opt_mem "videoId" Jsont.json ~enc:(fun r -> r.video_id) 9229 - |> Jsont.Object.opt_mem "views" Jsont.int ~enc:(fun r -> r.views) 9230 - |> Jsont.Object.skip_unknown 9231 - |> Jsont.Object.finish 9232 - end 9233 - end 9234 - 9235 - module UserRegistration = struct 9236 - module Request = struct 9237 - type t = Jsont.json 9238 - 9239 - let jsont = Jsont.json 9240 - 9241 - let v () = Jsont.Null ((), Jsont.Meta.none) 9242 - end 9243 - 11863 + module VideoChannelList = struct 9244 11864 module T = struct 9245 11865 type t = { 9246 - account_display_name : string option; 9247 - channel_display_name : string option; 9248 - channel_handle : string option; 9249 - created_at : Ptime.t option; 9250 - email : string option; 9251 - email_verified : bool option; 9252 - id : Id.T.t option; 9253 - moderation_response : string option; 9254 - registration_reason : string option; 9255 - state : Jsont.json option; 9256 - updated_at : Ptime.t option; 9257 - user : Jsont.json option; (** If the registration has been accepted, this is a partial user object created by the registration *) 9258 - username : string option; 9259 - } 9260 - 9261 - let v ?account_display_name ?channel_display_name ?channel_handle ?created_at ?email ?email_verified ?id ?moderation_response ?registration_reason ?state ?updated_at ?user ?username () = { account_display_name; channel_display_name; channel_handle; created_at; email; email_verified; id; moderation_response; registration_reason; state; updated_at; user; username } 9262 - 9263 - let account_display_name t = t.account_display_name 9264 - let channel_display_name t = t.channel_display_name 9265 - let channel_handle t = t.channel_handle 9266 - let created_at t = t.created_at 9267 - let email t = t.email 9268 - let email_verified t = t.email_verified 9269 - let id t = t.id 9270 - let moderation_response t = t.moderation_response 9271 - let registration_reason t = t.registration_reason 9272 - let state t = t.state 9273 - let updated_at t = t.updated_at 9274 - let user t = t.user 9275 - let username t = t.username 9276 - 9277 - let jsont : t Jsont.t = 9278 - Jsont.Object.map ~kind:"UserRegistration" 9279 - (fun account_display_name channel_display_name channel_handle created_at email email_verified id moderation_response registration_reason state updated_at user username -> { account_display_name; channel_display_name; channel_handle; created_at; email; email_verified; id; moderation_response; registration_reason; state; updated_at; user; username }) 9280 - |> Jsont.Object.opt_mem "accountDisplayName" Jsont.string ~enc:(fun r -> r.account_display_name) 9281 - |> Jsont.Object.opt_mem "channelDisplayName" Jsont.string ~enc:(fun r -> r.channel_display_name) 9282 - |> Jsont.Object.opt_mem "channelHandle" Jsont.string ~enc:(fun r -> r.channel_handle) 9283 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 9284 - |> Jsont.Object.opt_mem "email" Jsont.string ~enc:(fun r -> r.email) 9285 - |> Jsont.Object.opt_mem "emailVerified" Jsont.bool ~enc:(fun r -> r.email_verified) 9286 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9287 - |> Jsont.Object.opt_mem "moderationResponse" Jsont.string ~enc:(fun r -> r.moderation_response) 9288 - |> Jsont.Object.opt_mem "registrationReason" Jsont.string ~enc:(fun r -> r.registration_reason) 9289 - |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 9290 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 9291 - |> Jsont.Object.opt_mem "user" Jsont.json ~enc:(fun r -> r.user) 9292 - |> Jsont.Object.opt_mem "username" Jsont.string ~enc:(fun r -> r.username) 9293 - |> Jsont.Object.skip_unknown 9294 - |> Jsont.Object.finish 9295 - end 9296 - 9297 - (** Request registration 9298 - 9299 - Signup has to be enabled and require approval on the instance *) 9300 - let request_registration ~body client () = 9301 - let op_name = "request_registration" in 9302 - let url_path = "/api/v1/users/registrations/request" in 9303 - let query = "" in 9304 - let url = client.base_url ^ url_path ^ query in 9305 - let response = 9306 - try Requests.post client.session ~body:(Requests.Body.json (Openapi.Runtime.Json.encode_json Request.jsont body)) url 9307 - with Eio.Io _ as ex -> 9308 - let bt = Printexc.get_raw_backtrace () in 9309 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "POST" url 9310 - in 9311 - if Requests.Response.ok response then 9312 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 9313 - else 9314 - raise (Openapi.Runtime.Api_error { 9315 - operation = op_name; 9316 - method_ = "POST"; 9317 - url; 9318 - status = Requests.Response.status_code response; 9319 - body = Requests.Response.text response; 9320 - }) 9321 - end 9322 - 9323 - module Notification = struct 9324 - module Type = struct 9325 - (** Notification type. One of the following values: 9326 - 9327 - - `1` NEW_VIDEO_FROM_SUBSCRIPTION 9328 - 9329 - - `2` NEW_COMMENT_ON_MY_VIDEO 9330 - 9331 - - `3` NEW_ABUSE_FOR_MODERATORS 9332 - 9333 - - `4` BLACKLIST_ON_MY_VIDEO 9334 - 9335 - - `5` UNBLACKLIST_ON_MY_VIDEO 9336 - 9337 - - `6` MY_VIDEO_PUBLISHED 9338 - 9339 - - `7` MY_VIDEO_IMPORT_SUCCESS 9340 - 9341 - - `8` MY_VIDEO_IMPORT_ERROR 9342 - 9343 - - `9` NEW_USER_REGISTRATION 9344 - 9345 - - `10` NEW_FOLLOW 9346 - 9347 - - `11` COMMENT_MENTION 9348 - 9349 - - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS 9350 - 9351 - - `13` NEW_INSTANCE_FOLLOWER 9352 - 9353 - - `14` AUTO_INSTANCE_FOLLOWING 9354 - 9355 - - `15` ABUSE_STATE_CHANGE 9356 - 9357 - - `16` ABUSE_NEW_MESSAGE 9358 - 9359 - - `17` NEW_PLUGIN_VERSION 9360 - 9361 - - `18` NEW_PEERTUBE_VERSION 9362 - 9363 - - `19` MY_VIDEO_STUDIO_EDITION_FINISHED 9364 - 9365 - - `20` NEW_USER_REGISTRATION_REQUEST 9366 - 9367 - - `21` NEW_LIVE_FROM_SUBSCRIPTION 9368 - 9369 - - `22` MY_VIDEO_TRANSCRIPTION_GENERATED 9370 - *) 9371 - type t = string 9372 - 9373 - let jsont = Jsont.string 9374 - end 9375 - 9376 - module T = struct 9377 - type t = { 9378 - account : Jsont.json option; 9379 - actor_follow : Jsont.json option; 9380 - comment : Jsont.json option; 9381 - created_at : Ptime.t option; 9382 - id : Id.T.t option; 9383 - read : bool option; 9384 - type_ : Type.t option; 9385 - updated_at : Ptime.t option; 9386 - video : Jsont.json option; 9387 - video_abuse : Jsont.json option; 9388 - video_blacklist : Jsont.json option; 9389 - video_import : Jsont.json option; 9390 - } 9391 - 9392 - let v ?account ?actor_follow ?comment ?created_at ?id ?read ?type_ ?updated_at ?video ?video_abuse ?video_blacklist ?video_import () = { account; actor_follow; comment; created_at; id; read; type_; updated_at; video; video_abuse; video_blacklist; video_import } 9393 - 9394 - let account t = t.account 9395 - let actor_follow t = t.actor_follow 9396 - let comment t = t.comment 9397 - let created_at t = t.created_at 9398 - let id t = t.id 9399 - let read t = t.read 9400 - let type_ t = t.type_ 9401 - let updated_at t = t.updated_at 9402 - let video t = t.video 9403 - let video_abuse t = t.video_abuse 9404 - let video_blacklist t = t.video_blacklist 9405 - let video_import t = t.video_import 9406 - 9407 - let jsont : t Jsont.t = 9408 - Jsont.Object.map ~kind:"Notification" 9409 - (fun account actor_follow comment created_at id read type_ updated_at video video_abuse video_blacklist video_import -> { account; actor_follow; comment; created_at; id; read; type_; updated_at; video; video_abuse; video_blacklist; video_import }) 9410 - |> Jsont.Object.opt_mem "account" Jsont.json ~enc:(fun r -> r.account) 9411 - |> Jsont.Object.opt_mem "actorFollow" Jsont.json ~enc:(fun r -> r.actor_follow) 9412 - |> Jsont.Object.opt_mem "comment" Jsont.json ~enc:(fun r -> r.comment) 9413 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 9414 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9415 - |> Jsont.Object.opt_mem "read" Jsont.bool ~enc:(fun r -> r.read) 9416 - |> Jsont.Object.opt_mem "type" Type.jsont ~enc:(fun r -> r.type_) 9417 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 9418 - |> Jsont.Object.opt_mem "video" Jsont.json ~enc:(fun r -> r.video) 9419 - |> Jsont.Object.opt_mem "videoAbuse" Jsont.json ~enc:(fun r -> r.video_abuse) 9420 - |> Jsont.Object.opt_mem "videoBlacklist" Jsont.json ~enc:(fun r -> r.video_blacklist) 9421 - |> Jsont.Object.opt_mem "videoImport" Jsont.json ~enc:(fun r -> r.video_import) 9422 - |> Jsont.Object.skip_unknown 9423 - |> Jsont.Object.finish 9424 - end 9425 - end 9426 - 9427 - module NotificationList = struct 9428 - module Response = struct 9429 - type t = { 9430 - data : Notification.T.t list option; 11866 + data : VideoChannel.T.t list option; 9431 11867 total : int option; 9432 11868 } 9433 11869 ··· 9437 11873 let total t = t.total 9438 11874 9439 11875 let jsont : t Jsont.t = 9440 - Jsont.Object.map ~kind:"NotificationListResponse" 11876 + Jsont.Object.map ~kind:"VideoChannelList" 9441 11877 (fun data total -> { data; total }) 9442 - |> Jsont.Object.opt_mem "data" (Jsont.list Notification.T.jsont) ~enc:(fun r -> r.data) 11878 + |> Jsont.Object.opt_mem "data" (Jsont.list VideoChannel.T.jsont) ~enc:(fun r -> r.data) 9443 11879 |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 9444 11880 |> Jsont.Object.skip_unknown 9445 11881 |> Jsont.Object.finish 9446 11882 end 9447 11883 9448 - (** List my notifications 9449 - @param type_one_of only list notifications of these types 9450 - @param unread only list unread notifications 9451 - @param start Offset used to paginate results 9452 - @param count Number of items to return 9453 - @param sort Sort column 9454 - *) 9455 - let get_api_v1_users_me_notifications ?type_one_of ?unread ?start ?count ?sort client () = 9456 - let op_name = "get_api_v1_users_me_notifications" in 9457 - let url_path = "/api/v1/users/me/notifications" in 9458 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"typeOneOf" ~value:type_one_of; Openapi.Runtime.Query.optional ~key:"unread" ~value:unread; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 9459 - let url = client.base_url ^ url_path ^ query in 9460 - let response = 9461 - try Requests.get client.session url 9462 - with Eio.Io _ as ex -> 9463 - let bt = Printexc.get_raw_backtrace () in 9464 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9465 - in 9466 - if Requests.Response.ok response then 9467 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 9468 - else 9469 - raise (Openapi.Runtime.Api_error { 9470 - operation = op_name; 9471 - method_ = "GET"; 9472 - url; 9473 - status = Requests.Response.status_code response; 9474 - body = Requests.Response.text response; 9475 - }) 9476 - end 9477 - 9478 - module Job = struct 9479 - module T = struct 9480 - type t = { 9481 - created_at : Ptime.t option; 9482 - data : Jsont.json option; 9483 - error : Jsont.json option; 9484 - finished_on : Ptime.t option; 9485 - id : Id.T.t option; 9486 - processed_on : Ptime.t option; 9487 - state : string option; 9488 - type_ : string option; 9489 - } 9490 - 9491 - let v ?created_at ?data ?error ?finished_on ?id ?processed_on ?state ?type_ () = { created_at; data; error; finished_on; id; processed_on; state; type_ } 9492 - 9493 - let created_at t = t.created_at 9494 - let data t = t.data 9495 - let error t = t.error 9496 - let finished_on t = t.finished_on 9497 - let id t = t.id 9498 - let processed_on t = t.processed_on 9499 - let state t = t.state 9500 - let type_ t = t.type_ 9501 - 9502 - let jsont : t Jsont.t = 9503 - Jsont.Object.map ~kind:"Job" 9504 - (fun created_at data error finished_on id processed_on state type_ -> { created_at; data; error; finished_on; id; processed_on; state; type_ }) 9505 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 9506 - |> Jsont.Object.opt_mem "data" Jsont.json ~enc:(fun r -> r.data) 9507 - |> Jsont.Object.opt_mem "error" Jsont.json ~enc:(fun r -> r.error) 9508 - |> Jsont.Object.opt_mem "finishedOn" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.finished_on) 9509 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9510 - |> Jsont.Object.opt_mem "processedOn" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.processed_on) 9511 - |> Jsont.Object.opt_mem "state" Jsont.string ~enc:(fun r -> r.state) 9512 - |> Jsont.Object.opt_mem "type" Jsont.string ~enc:(fun r -> r.type_) 9513 - |> Jsont.Object.skip_unknown 9514 - |> Jsont.Object.finish 9515 - end 9516 - end 9517 - 9518 - module GetMeVideoRating = struct 9519 - module T = struct 9520 - type t = { 9521 - id : Id.T.t; 9522 - rating : string; (** Rating of the video *) 9523 - } 9524 - 9525 - let v ~id ~rating () = { id; rating } 9526 - 9527 - let id t = t.id 9528 - let rating t = t.rating 9529 - 9530 - let jsont : t Jsont.t = 9531 - Jsont.Object.map ~kind:"GetMeVideoRating" 9532 - (fun id rating -> { id; rating }) 9533 - |> Jsont.Object.mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9534 - |> Jsont.Object.mem "rating" Jsont.string ~enc:(fun r -> r.rating) 9535 - |> Jsont.Object.skip_unknown 9536 - |> Jsont.Object.finish 9537 - end 9538 - 9539 - (** Get rate of my user for a video 9540 - @param video_id The video id 9541 - *) 9542 - let get_api_v1_users_me_videos_rating ~video_id client () = 9543 - let op_name = "get_api_v1_users_me_videos_rating" in 9544 - let url_path = Openapi.Runtime.Path.render ~params:[("videoId", video_id)] "/api/v1/users/me/videos/{videoId}/rating" in 9545 - let query = "" in 9546 - let url = client.base_url ^ url_path ^ query in 9547 - let response = 9548 - try Requests.get client.session url 9549 - with Eio.Io _ as ex -> 9550 - let bt = Printexc.get_raw_backtrace () in 9551 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9552 - in 9553 - if Requests.Response.ok response then 9554 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 9555 - else 9556 - raise (Openapi.Runtime.Api_error { 9557 - operation = op_name; 9558 - method_ = "GET"; 9559 - url; 9560 - status = Requests.Response.status_code response; 9561 - body = Requests.Response.text response; 9562 - }) 9563 - end 9564 - 9565 - module FileRedundancyInformation = struct 9566 - module T = struct 9567 - type t = { 9568 - created_at : Ptime.t option; 9569 - expires_on : Ptime.t option; 9570 - file_url : string option; 9571 - id : Id.T.t option; 9572 - size : int option; 9573 - strategy : string option; 9574 - updated_at : Ptime.t option; 9575 - } 9576 - 9577 - let v ?created_at ?expires_on ?file_url ?id ?size ?strategy ?updated_at () = { created_at; expires_on; file_url; id; size; strategy; updated_at } 9578 - 9579 - let created_at t = t.created_at 9580 - let expires_on t = t.expires_on 9581 - let file_url t = t.file_url 9582 - let id t = t.id 9583 - let size t = t.size 9584 - let strategy t = t.strategy 9585 - let updated_at t = t.updated_at 9586 - 9587 - let jsont : t Jsont.t = 9588 - Jsont.Object.map ~kind:"FileRedundancyInformation" 9589 - (fun created_at expires_on file_url id size strategy updated_at -> { created_at; expires_on; file_url; id; size; strategy; updated_at }) 9590 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 9591 - |> Jsont.Object.opt_mem "expiresOn" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.expires_on) 9592 - |> Jsont.Object.opt_mem "fileUrl" Jsont.string ~enc:(fun r -> r.file_url) 9593 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9594 - |> Jsont.Object.opt_mem "size" Jsont.int ~enc:(fun r -> r.size) 9595 - |> Jsont.Object.opt_mem "strategy" Jsont.string ~enc:(fun r -> r.strategy) 9596 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 9597 - |> Jsont.Object.skip_unknown 9598 - |> Jsont.Object.finish 9599 - end 9600 - end 9601 - 9602 - module FileStorage = struct 9603 - module T = struct 9604 - (** The file storage type: 9605 - - `0` File system 9606 - - `1` Object storage 9607 - *) 9608 - type t = string 9609 - 9610 - let jsont = Jsont.string 9611 - end 9612 - end 9613 - 9614 - module VideoFile = struct 9615 - module T = struct 9616 - type t = { 9617 - file_download_url : string option; (** URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) *) 9618 - file_url : string option; (** Direct URL of the video *) 9619 - fps : float option; (** Frames per second of the video file *) 9620 - has_audio : bool option; (** **PeerTube >= 6.2** The file container has an audio stream *) 9621 - has_video : bool option; (** **PeerTube >= 6.2** The file container has a video stream *) 9622 - height : float option; (** **PeerTube >= 6.1** Video stream height *) 9623 - id : Id.T.t option; 9624 - magnet_uri : string option; (** magnet URI allowing to resolve the video via BitTorrent without a metainfo file *) 9625 - metadata_url : string option; (** URL dereferencing the output of ffprobe on the file *) 9626 - playlist_url : string option; (** Playlist URL of the file if it is owned by a playlist *) 9627 - resolution : VideoResolutionConstant.T.t option; 9628 - size : int option; (** Video file size in bytes *) 9629 - storage : FileStorage.T.t option; 9630 - torrent_download_url : string option; (** URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) *) 9631 - torrent_url : string option; (** Direct URL of the torrent file *) 9632 - width : float option; (** **PeerTube >= 6.1** Video stream width *) 9633 - } 9634 - 9635 - let v ?file_download_url ?file_url ?fps ?has_audio ?has_video ?height ?id ?magnet_uri ?metadata_url ?playlist_url ?resolution ?size ?storage ?torrent_download_url ?torrent_url ?width () = { file_download_url; file_url; fps; has_audio; has_video; height; id; magnet_uri; metadata_url; playlist_url; resolution; size; storage; torrent_download_url; torrent_url; width } 9636 - 9637 - let file_download_url t = t.file_download_url 9638 - let file_url t = t.file_url 9639 - let fps t = t.fps 9640 - let has_audio t = t.has_audio 9641 - let has_video t = t.has_video 9642 - let height t = t.height 9643 - let id t = t.id 9644 - let magnet_uri t = t.magnet_uri 9645 - let metadata_url t = t.metadata_url 9646 - let playlist_url t = t.playlist_url 9647 - let resolution t = t.resolution 9648 - let size t = t.size 9649 - let storage t = t.storage 9650 - let torrent_download_url t = t.torrent_download_url 9651 - let torrent_url t = t.torrent_url 9652 - let width t = t.width 9653 - 9654 - let jsont : t Jsont.t = 9655 - Jsont.Object.map ~kind:"VideoFile" 9656 - (fun file_download_url file_url fps has_audio has_video height id magnet_uri metadata_url playlist_url resolution size storage torrent_download_url torrent_url width -> { file_download_url; file_url; fps; has_audio; has_video; height; id; magnet_uri; metadata_url; playlist_url; resolution; size; storage; torrent_download_url; torrent_url; width }) 9657 - |> Jsont.Object.opt_mem "fileDownloadUrl" Jsont.string ~enc:(fun r -> r.file_download_url) 9658 - |> Jsont.Object.opt_mem "fileUrl" Jsont.string ~enc:(fun r -> r.file_url) 9659 - |> Jsont.Object.opt_mem "fps" Jsont.number ~enc:(fun r -> r.fps) 9660 - |> Jsont.Object.opt_mem "hasAudio" Jsont.bool ~enc:(fun r -> r.has_audio) 9661 - |> Jsont.Object.opt_mem "hasVideo" Jsont.bool ~enc:(fun r -> r.has_video) 9662 - |> Jsont.Object.opt_mem "height" Jsont.number ~enc:(fun r -> r.height) 9663 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 9664 - |> Jsont.Object.opt_mem "magnetUri" Jsont.string ~enc:(fun r -> r.magnet_uri) 9665 - |> Jsont.Object.opt_mem "metadataUrl" Jsont.string ~enc:(fun r -> r.metadata_url) 9666 - |> Jsont.Object.opt_mem "playlistUrl" Jsont.string ~enc:(fun r -> r.playlist_url) 9667 - |> Jsont.Object.opt_mem "resolution" VideoResolutionConstant.T.jsont ~enc:(fun r -> r.resolution) 9668 - |> Jsont.Object.opt_mem "size" Jsont.int ~enc:(fun r -> r.size) 9669 - |> Jsont.Object.opt_mem "storage" FileStorage.T.jsont ~enc:(fun r -> r.storage) 9670 - |> Jsont.Object.opt_mem "torrentDownloadUrl" Jsont.string ~enc:(fun r -> r.torrent_download_url) 9671 - |> Jsont.Object.opt_mem "torrentUrl" Jsont.string ~enc:(fun r -> r.torrent_url) 9672 - |> Jsont.Object.opt_mem "width" Jsont.number ~enc:(fun r -> r.width) 9673 - |> Jsont.Object.skip_unknown 9674 - |> Jsont.Object.finish 9675 - end 9676 - end 9677 - 9678 - module VideoStreamingPlaylistsHls = struct 9679 - module T = struct 9680 - type t = { 9681 - files : VideoFile.T.t list option; (** Video files associated to this playlist. 9682 - 9683 - The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 9684 - *) 9685 - playlist_url : string option; 9686 - redundancies : Jsont.json list option; 9687 - segments_sha256_url : string option; 9688 - } 9689 - 9690 - let v ?files ?playlist_url ?redundancies ?segments_sha256_url () = { files; playlist_url; redundancies; segments_sha256_url } 9691 - 9692 - let files t = t.files 9693 - let playlist_url t = t.playlist_url 9694 - let redundancies t = t.redundancies 9695 - let segments_sha256_url t = t.segments_sha256_url 9696 - 9697 - let jsont : t Jsont.t = 9698 - Jsont.Object.map ~kind:"VideoStreamingPlaylists-HLS" 9699 - (fun files playlist_url redundancies segments_sha256_url -> { files; playlist_url; redundancies; segments_sha256_url }) 9700 - |> Jsont.Object.opt_mem "files" (Jsont.list VideoFile.T.jsont) ~enc:(fun r -> r.files) 9701 - |> Jsont.Object.opt_mem "playlistUrl" Jsont.string ~enc:(fun r -> r.playlist_url) 9702 - |> Jsont.Object.opt_mem "redundancies" (Jsont.list Jsont.json) ~enc:(fun r -> r.redundancies) 9703 - |> Jsont.Object.opt_mem "segmentsSha256Url" Jsont.string ~enc:(fun r -> r.segments_sha256_url) 9704 - |> Jsont.Object.skip_unknown 9705 - |> Jsont.Object.finish 9706 - end 9707 - end 9708 - 9709 - module CustomHomepage = struct 9710 - module T = struct 9711 - type t = { 9712 - content : string option; 9713 - } 9714 - 9715 - let v ?content () = { content } 9716 - 9717 - let content t = t.content 9718 - 9719 - let jsont : t Jsont.t = 9720 - Jsont.Object.map ~kind:"CustomHomepage" 9721 - (fun content -> { content }) 9722 - |> Jsont.Object.opt_mem "content" Jsont.string ~enc:(fun r -> r.content) 9723 - |> Jsont.Object.skip_unknown 9724 - |> Jsont.Object.finish 9725 - end 9726 - 9727 - (** Get instance custom homepage *) 9728 - let get_api_v1_custom_pages_homepage_instance client () = 9729 - let op_name = "get_api_v1_custom_pages_homepage_instance" in 9730 - let url_path = "/api/v1/custom-pages/homepage/instance" in 9731 - let query = "" in 9732 - let url = client.base_url ^ url_path ^ query in 9733 - let response = 9734 - try Requests.get client.session url 9735 - with Eio.Io _ as ex -> 9736 - let bt = Printexc.get_raw_backtrace () in 9737 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9738 - in 9739 - if Requests.Response.ok response then 9740 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 9741 - else 9742 - raise (Openapi.Runtime.Api_error { 9743 - operation = op_name; 9744 - method_ = "GET"; 9745 - url; 9746 - status = Requests.Response.status_code response; 9747 - body = Requests.Response.text response; 9748 - }) 9749 - end 9750 - 9751 - module CommentAutoTagPolicies = struct 9752 - module T = struct 9753 - type t = { 9754 - review : string list option; (** Auto tags that automatically set the comment in review state *) 9755 - } 9756 - 9757 - let v ?review () = { review } 9758 - 9759 - let review t = t.review 9760 - 9761 - let jsont : t Jsont.t = 9762 - Jsont.Object.map ~kind:"CommentAutoTagPolicies" 9763 - (fun review -> { review }) 9764 - |> Jsont.Object.opt_mem "review" (Jsont.list Jsont.string) ~enc:(fun r -> r.review) 9765 - |> Jsont.Object.skip_unknown 9766 - |> Jsont.Object.finish 9767 - end 9768 - 9769 - (** Get account auto tag policies on comments 9770 - 9771 - **PeerTube >= 6.2** 9772 - @param account_name account name to get auto tag policies 9773 - *) 9774 - let get_api_v1_automatic_tags_policies_accounts_comments ~account_name client () = 9775 - let op_name = "get_api_v1_automatic_tags_policies_accounts_comments" in 9776 - let url_path = Openapi.Runtime.Path.render ~params:[("accountName", account_name)] "/api/v1/automatic-tags/policies/accounts/{accountName}/comments" in 9777 - let query = "" in 9778 - let url = client.base_url ^ url_path ^ query in 9779 - let response = 9780 - try Requests.get client.session url 9781 - with Eio.Io _ as ex -> 9782 - let bt = Printexc.get_raw_backtrace () in 9783 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9784 - in 9785 - if Requests.Response.ok response then 9786 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 9787 - else 9788 - raise (Openapi.Runtime.Api_error { 9789 - operation = op_name; 9790 - method_ = "GET"; 9791 - url; 9792 - status = Requests.Response.status_code response; 9793 - body = Requests.Response.text response; 9794 - }) 9795 - end 9796 - 9797 - module ChannelActivityList = struct 9798 - module Response = struct 9799 - type t = { 9800 - data : Jsont.json list option; 9801 - total : int option; 9802 - } 9803 - 9804 - let v ?data ?total () = { data; total } 9805 - 9806 - let data t = t.data 9807 - let total t = t.total 9808 - 9809 - let jsont : t Jsont.t = 9810 - Jsont.Object.map ~kind:"ChannelActivityListResponse" 9811 - (fun data total -> { data; total }) 9812 - |> Jsont.Object.opt_mem "data" (Jsont.list Jsont.json) ~enc:(fun r -> r.data) 9813 - |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 9814 - |> Jsont.Object.skip_unknown 9815 - |> Jsont.Object.finish 9816 - end 9817 - 9818 - (** List activities of a video channel 9819 - 9820 - **PeerTube >= 8.0** 9821 - @param channel_handle The video channel handle 9822 - @param start Offset used to paginate results 9823 - @param count Number of items to return 9824 - @param sort Sort column 9825 - *) 9826 - let list_video_channel_activities ~channel_handle ?start ?count ?sort client () = 9827 - let op_name = "list_video_channel_activities" in 9828 - let url_path = Openapi.Runtime.Path.render ~params:[("channelHandle", channel_handle)] "/api/v1/video-channels/{channelHandle}/activities" in 9829 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 9830 - let url = client.base_url ^ url_path ^ query in 9831 - let response = 9832 - try Requests.get client.session url 9833 - with Eio.Io _ as ex -> 9834 - let bt = Printexc.get_raw_backtrace () in 9835 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9836 - in 9837 - if Requests.Response.ok response then 9838 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 9839 - else 9840 - raise (Openapi.Runtime.Api_error { 9841 - operation = op_name; 9842 - method_ = "GET"; 9843 - url; 9844 - status = Requests.Response.status_code response; 9845 - body = Requests.Response.text response; 9846 - }) 9847 - end 9848 - 9849 - module Block = struct 9850 - module Status = struct 9851 - type t = { 9852 - accounts : Jsont.json option; 9853 - hosts : Jsont.json option; 9854 - } 9855 - 9856 - let v ?accounts ?hosts () = { accounts; hosts } 9857 - 9858 - let accounts t = t.accounts 9859 - let hosts t = t.hosts 9860 - 9861 - let jsont : t Jsont.t = 9862 - Jsont.Object.map ~kind:"BlockStatus" 9863 - (fun accounts hosts -> { accounts; hosts }) 9864 - |> Jsont.Object.opt_mem "accounts" Jsont.json ~enc:(fun r -> r.accounts) 9865 - |> Jsont.Object.opt_mem "hosts" Jsont.json ~enc:(fun r -> r.hosts) 9866 - |> Jsont.Object.skip_unknown 9867 - |> Jsont.Object.finish 9868 - end 9869 - 9870 - (** Get block status of accounts/hosts 9871 - @param accounts Check if these accounts are blocked 9872 - @param hosts Check if these hosts are blocked 9873 - *) 9874 - let get_api_v1_blocklist_status ?accounts ?hosts client () = 9875 - let op_name = "get_api_v1_blocklist_status" in 9876 - let url_path = "/api/v1/blocklist/status" in 9877 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"accounts" ~value:accounts; Openapi.Runtime.Query.optional ~key:"hosts" ~value:hosts]) in 9878 - let url = client.base_url ^ url_path ^ query in 9879 - let response = 9880 - try Requests.get client.session url 9881 - with Eio.Io _ as ex -> 9882 - let bt = Printexc.get_raw_backtrace () in 9883 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9884 - in 9885 - if Requests.Response.ok response then 9886 - Openapi.Runtime.Json.decode_json_exn Status.jsont (Requests.Response.json response) 9887 - else 9888 - raise (Openapi.Runtime.Api_error { 9889 - operation = op_name; 9890 - method_ = "GET"; 9891 - url; 9892 - status = Requests.Response.status_code response; 9893 - body = Requests.Response.text response; 9894 - }) 9895 - end 9896 - 9897 - module AutomaticTagAvailable = struct 9898 - module T = struct 9899 - type t = { 9900 - available : Jsont.json list option; (** Available auto tags that can be used to filter objects or set a comment in review state *) 9901 - } 9902 - 9903 - let v ?available () = { available } 9904 - 9905 - let available t = t.available 9906 - 9907 - let jsont : t Jsont.t = 9908 - Jsont.Object.map ~kind:"AutomaticTagAvailable" 9909 - (fun available -> { available }) 9910 - |> Jsont.Object.opt_mem "available" (Jsont.list Jsont.json) ~enc:(fun r -> r.available) 9911 - |> Jsont.Object.skip_unknown 9912 - |> Jsont.Object.finish 9913 - end 9914 - 9915 - (** Get account available auto tags 9916 - 9917 - **PeerTube >= 6.2** 9918 - @param account_name account name to get auto tag policies 9919 - *) 9920 - let get_api_v1_automatic_tags_accounts_available ~account_name client () = 9921 - let op_name = "get_api_v1_automatic_tags_accounts_available" in 9922 - let url_path = Openapi.Runtime.Path.render ~params:[("accountName", account_name)] "/api/v1/automatic-tags/accounts/{accountName}/available" in 9923 - let query = "" in 9924 - let url = client.base_url ^ url_path ^ query in 9925 - let response = 9926 - try Requests.get client.session url 9927 - with Eio.Io _ as ex -> 9928 - let bt = Printexc.get_raw_backtrace () in 9929 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9930 - in 9931 - if Requests.Response.ok response then 9932 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 9933 - else 9934 - raise (Openapi.Runtime.Api_error { 9935 - operation = op_name; 9936 - method_ = "GET"; 9937 - url; 9938 - status = Requests.Response.status_code response; 9939 - body = Requests.Response.text response; 9940 - }) 9941 - 9942 - (** Get server available auto tags 9943 - 9944 - **PeerTube >= 6.2** *) 9945 - let get_api_v1_automatic_tags_server_available client () = 9946 - let op_name = "get_api_v1_automatic_tags_server_available" in 9947 - let url_path = "/api/v1/automatic-tags/server/available" in 9948 - let query = "" in 9949 - let url = client.base_url ^ url_path ^ query in 9950 - let response = 9951 - try Requests.get client.session url 9952 - with Eio.Io _ as ex -> 9953 - let bt = Printexc.get_raw_backtrace () in 9954 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 9955 - in 9956 - if Requests.Response.ok response then 9957 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 9958 - else 9959 - raise (Openapi.Runtime.Api_error { 9960 - operation = op_name; 9961 - method_ = "GET"; 9962 - url; 9963 - status = Requests.Response.status_code response; 9964 - body = Requests.Response.text response; 9965 - }) 9966 - end 9967 - 9968 - module AddVideoPasswords = struct 9969 - module T = struct 9970 - type t = Jsont.json 9971 - 9972 - let jsont = Jsont.json 9973 - 9974 - let v () = Jsont.Null ((), Jsont.Meta.none) 9975 - end 9976 - end 9977 - 9978 - module VideoUploadRequestCommon = struct 9979 - module T = struct 9980 - type t = { 9981 - category : VideoCategorySet.T.t option; 9982 - channel_id : int; (** Channel id that will contain this video *) 9983 - comments_policy : VideoCommentsPolicySet.T.t option; 9984 - description : string option; (** Video description *) 9985 - download_enabled : bool option; (** Enable or disable downloading for this video *) 9986 - generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 9987 - language : VideoLanguageSet.T.t option; 9988 - licence : VideoLicenceSet.T.t option; 9989 - name : string; (** Video name *) 9990 - nsfw : bool option; (** Whether or not this video contains sensitive content *) 9991 - nsfw_flags : Nsfwflag.T.t option; 9992 - nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 9993 - originally_published_at : Ptime.t option; (** Date when the content was originally published *) 9994 - previewfile : string option; (** Video preview file *) 9995 - privacy : VideoPrivacySet.T.t option; 9996 - schedule_update : VideoScheduled.Update.t option; 9997 - support : string option; (** A text tell the audience how to support the video creator *) 9998 - tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 9999 - thumbnailfile : string option; (** Video thumbnail file *) 10000 - video_passwords : AddVideoPasswords.T.t option; 10001 - wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 10002 - } 10003 - 10004 - let v ~channel_id ~name ?category ?comments_policy ?description ?download_enabled ?generate_transcription ?language ?licence ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?previewfile ?privacy ?schedule_update ?support ?tags ?thumbnailfile ?video_passwords ?wait_transcoding () = { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding } 10005 - 10006 - let category t = t.category 10007 - let channel_id t = t.channel_id 10008 - let comments_policy t = t.comments_policy 10009 - let description t = t.description 10010 - let download_enabled t = t.download_enabled 10011 - let generate_transcription t = t.generate_transcription 10012 - let language t = t.language 10013 - let licence t = t.licence 10014 - let name t = t.name 10015 - let nsfw t = t.nsfw 10016 - let nsfw_flags t = t.nsfw_flags 10017 - let nsfw_summary t = t.nsfw_summary 10018 - let originally_published_at t = t.originally_published_at 10019 - let previewfile t = t.previewfile 10020 - let privacy t = t.privacy 10021 - let schedule_update t = t.schedule_update 10022 - let support t = t.support 10023 - let tags t = t.tags 10024 - let thumbnailfile t = t.thumbnailfile 10025 - let video_passwords t = t.video_passwords 10026 - let wait_transcoding t = t.wait_transcoding 10027 - 10028 - let jsont : t Jsont.t = 10029 - Jsont.Object.map ~kind:"VideoUploadRequestCommon" 10030 - (fun category channel_id comments_policy description download_enabled generate_transcription language licence name nsfw nsfw_flags nsfw_summary originally_published_at previewfile privacy schedule_update support tags thumbnailfile video_passwords wait_transcoding -> { category; channel_id; comments_policy; description; download_enabled; generate_transcription; language; licence; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; previewfile; privacy; schedule_update; support; tags; thumbnailfile; video_passwords; wait_transcoding }) 10031 - |> Jsont.Object.opt_mem "category" VideoCategorySet.T.jsont ~enc:(fun r -> r.category) 10032 - |> Jsont.Object.mem "channelId" Jsont.int ~enc:(fun r -> r.channel_id) 10033 - |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 10034 - |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 10035 - |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 10036 - |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 10037 - |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 10038 - |> Jsont.Object.opt_mem "licence" VideoLicenceSet.T.jsont ~enc:(fun r -> r.licence) 10039 - |> Jsont.Object.mem "name" Jsont.string ~enc:(fun r -> r.name) 10040 - |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 10041 - |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 10042 - |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) 10043 - |> Jsont.Object.opt_mem "originallyPublishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.originally_published_at) 10044 - |> Jsont.Object.opt_mem "previewfile" Jsont.string ~enc:(fun r -> r.previewfile) 10045 - |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 10046 - |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 10047 - |> Jsont.Object.opt_mem "support" Jsont.string ~enc:(fun r -> r.support) 10048 - |> Jsont.Object.opt_mem "tags" (Jsont.list Jsont.string) ~enc:(fun r -> r.tags) 10049 - |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 10050 - |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 10051 - |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 10052 - |> Jsont.Object.skip_unknown 10053 - |> Jsont.Object.finish 10054 - end 10055 - end 10056 - 10057 - module ActorImage = struct 10058 - module T = struct 10059 - type t = { 10060 - created_at : Ptime.t option; 10061 - file_url : string option; (** **PeerTube >= 7.1** *) 10062 - height : int option; (** **PeerTube >= 7.3** *) 10063 - path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 10064 - updated_at : Ptime.t option; 10065 - width : int option; 10066 - } 10067 - 10068 - let v ?created_at ?file_url ?height ?path ?updated_at ?width () = { created_at; file_url; height; path; updated_at; width } 10069 - 10070 - let created_at t = t.created_at 10071 - let file_url t = t.file_url 10072 - let height t = t.height 10073 - let path t = t.path 10074 - let updated_at t = t.updated_at 10075 - let width t = t.width 10076 - 10077 - let jsont : t Jsont.t = 10078 - Jsont.Object.map ~kind:"ActorImage" 10079 - (fun created_at file_url height path updated_at width -> { created_at; file_url; height; path; updated_at; width }) 10080 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 10081 - |> Jsont.Object.opt_mem "fileUrl" Jsont.string ~enc:(fun r -> r.file_url) 10082 - |> Jsont.Object.opt_mem "height" Jsont.int ~enc:(fun r -> r.height) 10083 - |> Jsont.Object.opt_mem "path" Jsont.string ~enc:(fun r -> r.path) 10084 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 10085 - |> Jsont.Object.opt_mem "width" Jsont.int ~enc:(fun r -> r.width) 10086 - |> Jsont.Object.skip_unknown 10087 - |> Jsont.Object.finish 10088 - end 10089 - end 10090 - 10091 - module VideoChannelSummary = struct 10092 - module T = struct 10093 - type t = { 10094 - avatars : ActorImage.T.t list option; 10095 - display_name : string option; 10096 - host : string option; 10097 - id : Id.T.t option; 10098 - name : string option; 10099 - url : string option; 10100 - } 10101 - 10102 - let v ?avatars ?display_name ?host ?id ?name ?url () = { avatars; display_name; host; id; name; url } 10103 - 10104 - let avatars t = t.avatars 10105 - let display_name t = t.display_name 10106 - let host t = t.host 10107 - let id t = t.id 10108 - let name t = t.name 10109 - let url t = t.url 10110 - 10111 - let jsont : t Jsont.t = 10112 - Jsont.Object.map ~kind:"VideoChannelSummary" 10113 - (fun avatars display_name host id name url -> { avatars; display_name; host; id; name; url }) 10114 - |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 10115 - |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 10116 - |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 10117 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 10118 - |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 10119 - |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 10120 - |> Jsont.Object.skip_unknown 10121 - |> Jsont.Object.finish 10122 - end 10123 - end 10124 - 10125 - module Actor = struct 10126 - module Info = struct 10127 - type t = { 10128 - avatars : ActorImage.T.t list option; 10129 - display_name : string option; 10130 - host : string option; 10131 - id : Id.T.t option; 10132 - name : string option; 10133 - } 10134 - 10135 - let v ?avatars ?display_name ?host ?id ?name () = { avatars; display_name; host; id; name } 10136 - 10137 - let avatars t = t.avatars 10138 - let display_name t = t.display_name 10139 - let host t = t.host 10140 - let id t = t.id 10141 - let name t = t.name 10142 - 10143 - let jsont : t Jsont.t = 10144 - Jsont.Object.map ~kind:"ActorInfo" 10145 - (fun avatars display_name host id name -> { avatars; display_name; host; id; name }) 10146 - |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 10147 - |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 10148 - |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 10149 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 10150 - |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 10151 - |> Jsont.Object.skip_unknown 10152 - |> Jsont.Object.finish 10153 - end 10154 - 10155 - module T = struct 10156 - type t = { 10157 - avatars : ActorImage.T.t list option; 10158 - created_at : Ptime.t option; 10159 - followers_count : int option; (** number of followers of this actor, as seen by this instance *) 10160 - following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 10161 - host : string option; (** server on which the actor is resident *) 10162 - host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 10163 - id : Id.T.t option; 10164 - name : Jsont.json option; (** immutable name of the actor, used to find or mention it *) 10165 - updated_at : Ptime.t option; 10166 - url : string option; 10167 - } 10168 - 10169 - let v ?avatars ?created_at ?followers_count ?following_count ?host ?host_redundancy_allowed ?id ?name ?updated_at ?url () = { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; updated_at; url } 10170 - 10171 - let avatars t = t.avatars 10172 - let created_at t = t.created_at 10173 - let followers_count t = t.followers_count 10174 - let following_count t = t.following_count 10175 - let host t = t.host 10176 - let host_redundancy_allowed t = t.host_redundancy_allowed 10177 - let id t = t.id 10178 - let name t = t.name 10179 - let updated_at t = t.updated_at 10180 - let url t = t.url 10181 - 10182 - let jsont : t Jsont.t = 10183 - Jsont.Object.map ~kind:"Actor" 10184 - (fun avatars created_at followers_count following_count host host_redundancy_allowed id name updated_at url -> { avatars; created_at; followers_count; following_count; host; host_redundancy_allowed; id; name; updated_at; url }) 10185 - |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 10186 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 10187 - |> Jsont.Object.opt_mem "followersCount" Jsont.int ~enc:(fun r -> r.followers_count) 10188 - |> Jsont.Object.opt_mem "followingCount" Jsont.int ~enc:(fun r -> r.following_count) 10189 - |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 10190 - |> Jsont.Object.opt_mem "hostRedundancyAllowed" Jsont.bool ~enc:(fun r -> r.host_redundancy_allowed) 10191 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 10192 - |> Jsont.Object.opt_mem "name" Jsont.json ~enc:(fun r -> r.name) 10193 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 10194 - |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 10195 - |> Jsont.Object.skip_unknown 10196 - |> Jsont.Object.finish 10197 - end 10198 - end 10199 - 10200 - module Follow = struct 10201 - module T = struct 10202 - type t = { 10203 - created_at : Ptime.t option; 10204 - follower : Actor.T.t option; 10205 - following : Actor.T.t option; 10206 - id : Id.T.t option; 10207 - score : float option; (** score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. *) 10208 - state : string option; 10209 - updated_at : Ptime.t option; 10210 - } 10211 - 10212 - let v ?created_at ?follower ?following ?id ?score ?state ?updated_at () = { created_at; follower; following; id; score; state; updated_at } 10213 - 10214 - let created_at t = t.created_at 10215 - let follower t = t.follower 10216 - let following t = t.following 10217 - let id t = t.id 10218 - let score t = t.score 10219 - let state t = t.state 10220 - let updated_at t = t.updated_at 10221 - 10222 - let jsont : t Jsont.t = 10223 - Jsont.Object.map ~kind:"Follow" 10224 - (fun created_at follower following id score state updated_at -> { created_at; follower; following; id; score; state; updated_at }) 10225 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 10226 - |> Jsont.Object.opt_mem "follower" Actor.T.jsont ~enc:(fun r -> r.follower) 10227 - |> Jsont.Object.opt_mem "following" Actor.T.jsont ~enc:(fun r -> r.following) 10228 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 10229 - |> Jsont.Object.opt_mem "score" Jsont.number ~enc:(fun r -> r.score) 10230 - |> Jsont.Object.opt_mem "state" Jsont.string ~enc:(fun r -> r.state) 10231 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 10232 - |> Jsont.Object.skip_unknown 10233 - |> Jsont.Object.finish 10234 - end 10235 - end 10236 - 10237 - module AccountSummary = struct 10238 - module T = struct 10239 - type t = { 10240 - avatars : ActorImage.T.t list option; 10241 - display_name : string option; 10242 - host : string option; 10243 - id : int option; 10244 - name : string option; 10245 - url : string option; 10246 - } 10247 - 10248 - let v ?avatars ?display_name ?host ?id ?name ?url () = { avatars; display_name; host; id; name; url } 10249 - 10250 - let avatars t = t.avatars 10251 - let display_name t = t.display_name 10252 - let host t = t.host 10253 - let id t = t.id 10254 - let name t = t.name 10255 - let url t = t.url 10256 - 10257 - let jsont : t Jsont.t = 10258 - Jsont.Object.map ~kind:"AccountSummary" 10259 - (fun avatars display_name host id name url -> { avatars; display_name; host; id; name; url }) 10260 - |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 10261 - |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 10262 - |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 10263 - |> Jsont.Object.opt_mem "id" Jsont.int ~enc:(fun r -> r.id) 10264 - |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 10265 - |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 10266 - |> Jsont.Object.skip_unknown 10267 - |> Jsont.Object.finish 10268 - end 10269 - end 10270 - 10271 - module VideoPlaylist = struct 10272 - module T = struct 10273 - type t = { 10274 - created_at : Ptime.t option; 10275 - description : string option; 10276 - display_name : string option; 10277 - id : Id.T.t option; 10278 - is_local : bool option; 10279 - owner_account : AccountSummary.T.t option; 10280 - privacy : VideoPlaylistPrivacyConstant.T.t option; 10281 - short_uuid : Jsont.json option; 10282 - thumbnail_path : string option; 10283 - type_ : VideoPlaylistTypeConstant.T.t option; 10284 - updated_at : Ptime.t option; 10285 - uuid : Uuidv4.T.t option; 10286 - video_channel : VideoChannelSummary.T.t option; 10287 - video_channel_position : int option; (** Position of the playlist in the channel *) 10288 - video_length : int option; 10289 - } 10290 - 10291 - let v ?created_at ?description ?display_name ?id ?is_local ?owner_account ?privacy ?short_uuid ?thumbnail_path ?type_ ?updated_at ?uuid ?video_channel ?video_channel_position ?video_length () = { created_at; description; display_name; id; is_local; owner_account; privacy; short_uuid; thumbnail_path; type_; updated_at; uuid; video_channel; video_channel_position; video_length } 10292 - 10293 - let created_at t = t.created_at 10294 - let description t = t.description 10295 - let display_name t = t.display_name 10296 - let id t = t.id 10297 - let is_local t = t.is_local 10298 - let owner_account t = t.owner_account 10299 - let privacy t = t.privacy 10300 - let short_uuid t = t.short_uuid 10301 - let thumbnail_path t = t.thumbnail_path 10302 - let type_ t = t.type_ 10303 - let updated_at t = t.updated_at 10304 - let uuid t = t.uuid 10305 - let video_channel t = t.video_channel 10306 - let video_channel_position t = t.video_channel_position 10307 - let video_length t = t.video_length 10308 - 10309 - let jsont : t Jsont.t = 10310 - Jsont.Object.map ~kind:"VideoPlaylist" 10311 - (fun created_at description display_name id is_local owner_account privacy short_uuid thumbnail_path type_ updated_at uuid video_channel video_channel_position video_length -> { created_at; description; display_name; id; is_local; owner_account; privacy; short_uuid; thumbnail_path; type_; updated_at; uuid; video_channel; video_channel_position; video_length }) 10312 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 10313 - |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 10314 - |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 10315 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 10316 - |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 10317 - |> Jsont.Object.opt_mem "ownerAccount" AccountSummary.T.jsont ~enc:(fun r -> r.owner_account) 10318 - |> Jsont.Object.opt_mem "privacy" VideoPlaylistPrivacyConstant.T.jsont ~enc:(fun r -> r.privacy) 10319 - |> Jsont.Object.opt_mem "shortUUID" Jsont.json ~enc:(fun r -> r.short_uuid) 10320 - |> Jsont.Object.opt_mem "thumbnailPath" Jsont.string ~enc:(fun r -> r.thumbnail_path) 10321 - |> Jsont.Object.opt_mem "type" VideoPlaylistTypeConstant.T.jsont ~enc:(fun r -> r.type_) 10322 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 10323 - |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 10324 - |> Jsont.Object.opt_mem "videoChannel" VideoChannelSummary.T.jsont ~enc:(fun r -> r.video_channel) 10325 - |> Jsont.Object.opt_mem "videoChannelPosition" Jsont.int ~enc:(fun r -> r.video_channel_position) 10326 - |> Jsont.Object.opt_mem "videoLength" Jsont.int ~enc:(fun r -> r.video_length) 10327 - |> Jsont.Object.skip_unknown 10328 - |> Jsont.Object.finish 10329 - end 10330 - 10331 - (** Get a video playlist 10332 - @param playlist_id Playlist id 10333 - *) 10334 - let get_api_v1_video_playlists ~playlist_id client () = 10335 - let op_name = "get_api_v1_video_playlists" in 10336 - let url_path = Openapi.Runtime.Path.render ~params:[("playlistId", playlist_id)] "/api/v1/video-playlists/{playlistId}" in 10337 - let query = "" in 10338 - let url = client.base_url ^ url_path ^ query in 10339 - let response = 10340 - try Requests.get client.session url 10341 - with Eio.Io _ as ex -> 10342 - let bt = Printexc.get_raw_backtrace () in 10343 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10344 - in 10345 - if Requests.Response.ok response then 10346 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 10347 - else 10348 - raise (Openapi.Runtime.Api_error { 10349 - operation = op_name; 10350 - method_ = "GET"; 10351 - url; 10352 - status = Requests.Response.status_code response; 10353 - body = Requests.Response.text response; 10354 - }) 10355 - end 10356 - 10357 - module VideoChannelCollaborator = struct 10358 - module T = struct 10359 - (** Representation of a channel collaboration *) 10360 - type t = { 10361 - account : AccountSummary.T.t option; 10362 - created_at : Ptime.t option; 10363 - id : Id.T.t option; 10364 - state : Jsont.json option; 10365 - updated_at : Ptime.t option; 10366 - } 10367 - 10368 - let v ?account ?created_at ?id ?state ?updated_at () = { account; created_at; id; state; updated_at } 10369 - 10370 - let account t = t.account 10371 - let created_at t = t.created_at 10372 - let id t = t.id 10373 - let state t = t.state 10374 - let updated_at t = t.updated_at 10375 - 10376 - let jsont : t Jsont.t = 10377 - Jsont.Object.map ~kind:"VideoChannelCollaborator" 10378 - (fun account created_at id state updated_at -> { account; created_at; id; state; updated_at }) 10379 - |> Jsont.Object.opt_mem "account" AccountSummary.T.jsont ~enc:(fun r -> r.account) 10380 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 10381 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 10382 - |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 10383 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 10384 - |> Jsont.Object.skip_unknown 10385 - |> Jsont.Object.finish 10386 - end 10387 - end 10388 - 10389 - module Video = struct 10390 - module Info = struct 10391 - type t = { 10392 - id : Jsont.json option; 10393 - name : Jsont.json option; 10394 - state : Jsont.json option; 10395 - uuid : Jsont.json option; 10396 - } 10397 - 10398 - let v ?id ?name ?state ?uuid () = { id; name; state; uuid } 10399 - 10400 - let id t = t.id 10401 - let name t = t.name 10402 - let state t = t.state 10403 - let uuid t = t.uuid 10404 - 10405 - let jsont : t Jsont.t = 10406 - Jsont.Object.map ~kind:"VideoInfo" 10407 - (fun id name state uuid -> { id; name; state; uuid }) 10408 - |> Jsont.Object.opt_mem "id" Jsont.json ~enc:(fun r -> r.id) 10409 - |> Jsont.Object.opt_mem "name" Jsont.json ~enc:(fun r -> r.name) 10410 - |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 10411 - |> Jsont.Object.opt_mem "uuid" Jsont.json ~enc:(fun r -> r.uuid) 10412 - |> Jsont.Object.skip_unknown 10413 - |> Jsont.Object.finish 10414 - end 10415 - 10416 - module T = struct 10417 - type t = { 10418 - account : AccountSummary.T.t option; 10419 - aspect_ratio : float option; (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 10420 - blacklisted : bool option; 10421 - blacklisted_reason : string option; 10422 - category : Jsont.json option; (** category in which the video is classified *) 10423 - channel : VideoChannelSummary.T.t option; 10424 - comments : int option; (** **PeerTube >= 7.2** Number of comments on the video *) 10425 - created_at : Ptime.t option; (** time at which the video object was first drafted *) 10426 - dislikes : int option; 10427 - duration : int option; (** duration of the video in seconds *) 10428 - embed_path : string option; 10429 - id : Jsont.json option; (** object id for the video *) 10430 - is_live : bool option; 10431 - is_local : bool option; 10432 - language : Jsont.json option; (** main language used in the video *) 10433 - licence : Jsont.json option; (** licence under which the video is distributed *) 10434 - likes : int option; 10435 - live_schedules : LiveSchedule.T.t list option; 10436 - name : string option; (** title of the video *) 10437 - nsfw : bool option; 10438 - nsfw_flags : Jsont.json option; 10439 - nsfw_summary : string option; (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 10440 - originally_published_at : Ptime.t option; (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 10441 - preview_path : string option; 10442 - privacy : Jsont.json option; (** privacy policy used to distribute the video *) 10443 - published_at : Ptime.t option; (** time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. *) 10444 - scheduled_update : Jsont.json option; 10445 - short_uuid : Jsont.json option; 10446 - state : Jsont.json option; (** represents the internal state of the video processing within the PeerTube instance *) 10447 - thumbnail_path : string option; 10448 - truncated_description : string option; (** truncated description of the video, written in Markdown. 10449 - *) 10450 - updated_at : Ptime.t option; (** last time the video's metadata was modified *) 10451 - user_history : Jsont.json option; 10452 - uuid : Jsont.json option; (** universal identifier for the video, that can be used across instances *) 10453 - views : int option; 10454 - wait_transcoding : bool option; 10455 - } 10456 - 10457 - let v ?account ?aspect_ratio ?blacklisted ?blacklisted_reason ?category ?channel ?comments ?created_at ?dislikes ?duration ?embed_path ?id ?is_live ?is_local ?language ?licence ?likes ?live_schedules ?name ?nsfw ?nsfw_flags ?nsfw_summary ?originally_published_at ?preview_path ?privacy ?published_at ?scheduled_update ?short_uuid ?state ?thumbnail_path ?truncated_description ?updated_at ?user_history ?uuid ?views ?wait_transcoding () = { account; aspect_ratio; blacklisted; blacklisted_reason; category; channel; comments; created_at; dislikes; duration; embed_path; id; is_live; is_local; language; licence; likes; live_schedules; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; preview_path; privacy; published_at; scheduled_update; short_uuid; state; thumbnail_path; truncated_description; updated_at; user_history; uuid; views; wait_transcoding } 10458 - 10459 - let account t = t.account 10460 - let aspect_ratio t = t.aspect_ratio 10461 - let blacklisted t = t.blacklisted 10462 - let blacklisted_reason t = t.blacklisted_reason 10463 - let category t = t.category 10464 - let channel t = t.channel 10465 - let comments t = t.comments 10466 - let created_at t = t.created_at 10467 - let dislikes t = t.dislikes 10468 - let duration t = t.duration 10469 - let embed_path t = t.embed_path 10470 - let id t = t.id 10471 - let is_live t = t.is_live 10472 - let is_local t = t.is_local 10473 - let language t = t.language 10474 - let licence t = t.licence 10475 - let likes t = t.likes 10476 - let live_schedules t = t.live_schedules 10477 - let name t = t.name 10478 - let nsfw t = t.nsfw 10479 - let nsfw_flags t = t.nsfw_flags 10480 - let nsfw_summary t = t.nsfw_summary 10481 - let originally_published_at t = t.originally_published_at 10482 - let preview_path t = t.preview_path 10483 - let privacy t = t.privacy 10484 - let published_at t = t.published_at 10485 - let scheduled_update t = t.scheduled_update 10486 - let short_uuid t = t.short_uuid 10487 - let state t = t.state 10488 - let thumbnail_path t = t.thumbnail_path 10489 - let truncated_description t = t.truncated_description 10490 - let updated_at t = t.updated_at 10491 - let user_history t = t.user_history 10492 - let uuid t = t.uuid 10493 - let views t = t.views 10494 - let wait_transcoding t = t.wait_transcoding 10495 - 10496 - let jsont : t Jsont.t = 10497 - Jsont.Object.map ~kind:"Video" 10498 - (fun account aspect_ratio blacklisted blacklisted_reason category channel comments created_at dislikes duration embed_path id is_live is_local language licence likes live_schedules name nsfw nsfw_flags nsfw_summary originally_published_at preview_path privacy published_at scheduled_update short_uuid state thumbnail_path truncated_description updated_at user_history uuid views wait_transcoding -> { account; aspect_ratio; blacklisted; blacklisted_reason; category; channel; comments; created_at; dislikes; duration; embed_path; id; is_live; is_local; language; licence; likes; live_schedules; name; nsfw; nsfw_flags; nsfw_summary; originally_published_at; preview_path; privacy; published_at; scheduled_update; short_uuid; state; thumbnail_path; truncated_description; updated_at; user_history; uuid; views; wait_transcoding }) 10499 - |> Jsont.Object.opt_mem "account" AccountSummary.T.jsont ~enc:(fun r -> r.account) 10500 - |> Jsont.Object.opt_mem "aspectRatio" Jsont.number ~enc:(fun r -> r.aspect_ratio) 10501 - |> Jsont.Object.opt_mem "blacklisted" Jsont.bool ~enc:(fun r -> r.blacklisted) 10502 - |> Jsont.Object.opt_mem "blacklistedReason" Jsont.string ~enc:(fun r -> r.blacklisted_reason) 10503 - |> Jsont.Object.opt_mem "category" Jsont.json ~enc:(fun r -> r.category) 10504 - |> Jsont.Object.opt_mem "channel" VideoChannelSummary.T.jsont ~enc:(fun r -> r.channel) 10505 - |> Jsont.Object.opt_mem "comments" Jsont.int ~enc:(fun r -> r.comments) 10506 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 10507 - |> Jsont.Object.opt_mem "dislikes" Jsont.int ~enc:(fun r -> r.dislikes) 10508 - |> Jsont.Object.opt_mem "duration" Jsont.int ~enc:(fun r -> r.duration) 10509 - |> Jsont.Object.opt_mem "embedPath" Jsont.string ~enc:(fun r -> r.embed_path) 10510 - |> Jsont.Object.opt_mem "id" Jsont.json ~enc:(fun r -> r.id) 10511 - |> Jsont.Object.opt_mem "isLive" Jsont.bool ~enc:(fun r -> r.is_live) 10512 - |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 10513 - |> Jsont.Object.opt_mem "language" Jsont.json ~enc:(fun r -> r.language) 10514 - |> Jsont.Object.opt_mem "licence" Jsont.json ~enc:(fun r -> r.licence) 10515 - |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 10516 - |> Jsont.Object.opt_mem "liveSchedules" (Jsont.list LiveSchedule.T.jsont) ~enc:(fun r -> r.live_schedules) 10517 - |> Jsont.Object.opt_mem "name" Jsont.string ~enc:(fun r -> r.name) 10518 - |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 10519 - |> Jsont.Object.opt_mem "nsfwFlags" Jsont.json ~enc:(fun r -> r.nsfw_flags) 10520 - |> Jsont.Object.opt_mem "nsfwSummary" Jsont.string ~enc:(fun r -> r.nsfw_summary) 10521 - |> Jsont.Object.opt_mem "originallyPublishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.originally_published_at) 10522 - |> Jsont.Object.opt_mem "previewPath" Jsont.string ~enc:(fun r -> r.preview_path) 10523 - |> Jsont.Object.opt_mem "privacy" Jsont.json ~enc:(fun r -> r.privacy) 10524 - |> Jsont.Object.opt_mem "publishedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.published_at) 10525 - |> Jsont.Object.opt_mem "scheduledUpdate" Jsont.json ~enc:(fun r -> r.scheduled_update) 10526 - |> Jsont.Object.opt_mem "shortUUID" Jsont.json ~enc:(fun r -> r.short_uuid) 10527 - |> Jsont.Object.opt_mem "state" Jsont.json ~enc:(fun r -> r.state) 10528 - |> Jsont.Object.opt_mem "thumbnailPath" Jsont.string ~enc:(fun r -> r.thumbnail_path) 10529 - |> Jsont.Object.opt_mem "truncatedDescription" Jsont.string ~enc:(fun r -> r.truncated_description) 10530 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 10531 - |> Jsont.Object.opt_mem "userHistory" Jsont.json ~enc:(fun r -> r.user_history) 10532 - |> Jsont.Object.opt_mem "uuid" Jsont.json ~enc:(fun r -> r.uuid) 10533 - |> Jsont.Object.opt_mem "views" Jsont.int ~enc:(fun r -> r.views) 10534 - |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 10535 - |> Jsont.Object.skip_unknown 10536 - |> Jsont.Object.finish 10537 - end 10538 - end 10539 - 10540 - module VideoRating = struct 10541 - module T = struct 10542 - type t = { 10543 - rating : string; (** Rating of the video *) 10544 - video : Video.T.t; 10545 - } 10546 - 10547 - let v ~rating ~video () = { rating; video } 10548 - 10549 - let rating t = t.rating 10550 - let video t = t.video 10551 - 10552 - let jsont : t Jsont.t = 10553 - Jsont.Object.map ~kind:"VideoRating" 10554 - (fun rating video -> { rating; video }) 10555 - |> Jsont.Object.mem "rating" Jsont.string ~enc:(fun r -> r.rating) 10556 - |> Jsont.Object.mem "video" Video.T.jsont ~enc:(fun r -> r.video) 10557 - |> Jsont.Object.skip_unknown 10558 - |> Jsont.Object.finish 10559 - end 10560 - 10561 - (** List ratings of an account 11884 + (** List video channels of an account 10562 11885 @param name The username or handle of the account 11886 + @param with_stats include daily view statistics for the last 30 days and total views (only if authenticated as the account user) 10563 11887 @param start Offset used to paginate results 10564 11888 @param count Number of items to return 11889 + @param search Plain text search, applied to various parts of the model depending on endpoint 10565 11890 @param sort Sort column 10566 - @param rating Optionally filter which ratings to retrieve 11891 + @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 10567 11892 *) 10568 - let get_api_v1_accounts_ratings ~name ?start ?count ?sort ?rating client () = 10569 - let op_name = "get_api_v1_accounts_ratings" in 10570 - let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/ratings" in 10571 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"rating" ~value:rating]) in 11893 + let get_api_v1_accounts_video_channels ~name ?with_stats ?start ?count ?search ?sort ?include_collaborations client () = 11894 + let op_name = "get_api_v1_accounts_video_channels" in 11895 + let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/video-channels" in 11896 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"withStats" ~value:with_stats; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"includeCollaborations" ~value:include_collaborations]) in 10572 11897 let url = client.base_url ^ url_path ^ query in 10573 11898 let response = 10574 11899 try Requests.get client.session url ··· 10586 11911 status = Requests.Response.status_code response; 10587 11912 body = Requests.Response.text response; 10588 11913 }) 10589 - end 10590 - 10591 - module VideoList = struct 10592 - module Response = struct 10593 - type t = { 10594 - data : Video.T.t list option; 10595 - total : int option; 10596 - } 10597 - 10598 - let v ?data ?total () = { data; total } 10599 - 10600 - let data t = t.data 10601 - let total t = t.total 10602 - 10603 - let jsont : t Jsont.t = 10604 - Jsont.Object.map ~kind:"VideoListResponse" 10605 - (fun data total -> { data; total }) 10606 - |> Jsont.Object.opt_mem "data" (Jsont.list Video.T.jsont) ~enc:(fun r -> r.data) 10607 - |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 10608 - |> Jsont.Object.skip_unknown 10609 - |> Jsont.Object.finish 10610 - end 10611 11914 10612 - (** List videos of an account 10613 - @param name The username or handle of the account 11915 + (** Search channels 11916 + @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it. 11917 + 10614 11918 @param start Offset used to paginate results 10615 11919 @param count Number of items to return 10616 - @param skip_count if you don't need the `total` in the response 10617 - @param nsfw whether to include nsfw videos, if any 10618 - @param is_live whether or not the video is a live 10619 - @param include_scheduled_live whether or not include live that are scheduled for later 10620 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 10621 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 10622 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 10623 - @param tags_one_of tag(s) of the video 10624 - @param tags_all_of tag(s) of the video, where all should be present in the video 10625 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 10626 - @param include_ **Only administrators and moderators can use this parameter** 10627 - 10628 - Include additional videos in results (can be combined using bitwise or operator) 10629 - - `0` NONE 10630 - - `1` NOT_PUBLISHED_STATE 10631 - - `2` BLACKLISTED 10632 - - `4` BLOCKED_OWNER 10633 - - `8` FILES 10634 - - `16` CAPTIONS 10635 - - `32` VIDEO SOURCE 10636 - 10637 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 10638 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 10639 - @param host Find elements owned by this host 10640 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 10641 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 10642 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 10643 - @param search Plain text search, applied to various parts of the model depending on endpoint 10644 - *) 10645 - let get_account_videos ~name ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 10646 - let op_name = "get_account_videos" in 10647 - let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}/videos" in 10648 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 10649 - let url = client.base_url ^ url_path ^ query in 10650 - let response = 10651 - try Requests.get client.session url 10652 - with Eio.Io _ as ex -> 10653 - let bt = Printexc.get_raw_backtrace () in 10654 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10655 - in 10656 - if Requests.Response.ok response then 10657 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 10658 - else 10659 - raise (Openapi.Runtime.Api_error { 10660 - operation = op_name; 10661 - method_ = "GET"; 10662 - url; 10663 - status = Requests.Response.status_code response; 10664 - body = Requests.Response.text response; 10665 - }) 10666 - 10667 - (** Search videos 10668 - @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it. 10669 - 10670 - @param uuids Find elements with specific UUIDs 10671 11920 @param search_target If the administrator enabled search index support, you can override the default search target. 10672 11921 10673 11922 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information: ··· 10677 11926 * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch 10678 11927 the data from the origin instance API 10679 11928 10680 - @param start Offset used to paginate results 10681 - @param count Number of items to return 10682 - @param skip_count if you don't need the `total` in the response 10683 - @param nsfw whether to include nsfw videos, if any 10684 - @param is_live whether or not the video is a live 10685 - @param include_scheduled_live whether or not include live that are scheduled for later 10686 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 10687 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 10688 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 10689 - @param tags_one_of tag(s) of the video 10690 - @param tags_all_of tag(s) of the video, where all should be present in the video 10691 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 10692 - @param include_ **Only administrators and moderators can use this parameter** 10693 - 10694 - Include additional videos in results (can be combined using bitwise or operator) 10695 - - `0` NONE 10696 - - `1` NOT_PUBLISHED_STATE 10697 - - `2` BLACKLISTED 10698 - - `4` BLOCKED_OWNER 10699 - - `8` FILES 10700 - - `16` CAPTIONS 10701 - - `32` VIDEO SOURCE 10702 - 10703 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 10704 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 11929 + @param sort Sort column 10705 11930 @param host Find elements owned by this host 10706 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 10707 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 10708 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 10709 - @param start_date Get videos that are published after this date 10710 - @param end_date Get videos that are published before this date 10711 - @param originally_published_start_date Get videos that are originally published after this date 10712 - @param originally_published_end_date Get videos that are originally published before this date 10713 - @param duration_min Get videos that have this minimum duration 10714 - @param duration_max Get videos that have this maximum duration 11931 + @param handles Find elements with these handles 10715 11932 *) 10716 - let search_videos ~search ?uuids ?search_target ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?start_date ?end_date ?originally_published_start_date ?originally_published_end_date ?duration_min ?duration_max client () = 10717 - let op_name = "search_videos" in 10718 - let url_path = "/api/v1/search/videos" in 10719 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.singleton ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"uuids" ~value:uuids; Openapi.Runtime.Query.optional ~key:"searchTarget" ~value:search_target; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"startDate" ~value:start_date; Openapi.Runtime.Query.optional ~key:"endDate" ~value:end_date; Openapi.Runtime.Query.optional ~key:"originallyPublishedStartDate" ~value:originally_published_start_date; Openapi.Runtime.Query.optional ~key:"originallyPublishedEndDate" ~value:originally_published_end_date; Openapi.Runtime.Query.optional ~key:"durationMin" ~value:duration_min; Openapi.Runtime.Query.optional ~key:"durationMax" ~value:duration_max]) in 11933 + let search_channels ~search ?start ?count ?search_target ?sort ?host ?handles client () = 11934 + let op_name = "search_channels" in 11935 + let url_path = "/api/v1/search/video-channels" in 11936 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.singleton ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"searchTarget" ~value:search_target; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"handles" ~value:handles]) in 10720 11937 let url = client.base_url ^ url_path ^ query in 10721 11938 let response = 10722 11939 try Requests.get client.session url ··· 10725 11942 Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10726 11943 in 10727 11944 if Requests.Response.ok response then 10728 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 11945 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 10729 11946 else 10730 11947 raise (Openapi.Runtime.Api_error { 10731 11948 operation = op_name; ··· 10735 11952 body = Requests.Response.text response; 10736 11953 }) 10737 11954 10738 - (** List watched videos history 11955 + (** List my user subscriptions 10739 11956 @param start Offset used to paginate results 10740 11957 @param count Number of items to return 10741 - @param search Plain text search, applied to various parts of the model depending on endpoint 10742 11958 *) 10743 - let get_api_v1_users_me_history_videos ?start ?count ?search client () = 10744 - let op_name = "get_api_v1_users_me_history_videos" in 10745 - let url_path = "/api/v1/users/me/history/videos" in 10746 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 11959 + let get_api_v1_users_me_subscriptions ?start ?count ?sort client () = 11960 + let op_name = "get_api_v1_users_me_subscriptions" in 11961 + let url_path = "/api/v1/users/me/subscriptions" in 11962 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 10747 11963 let url = client.base_url ^ url_path ^ query in 10748 11964 let response = 10749 11965 try Requests.get client.session url ··· 10752 11968 Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10753 11969 in 10754 11970 if Requests.Response.ok response then 10755 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 11971 + Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 10756 11972 else 10757 11973 raise (Openapi.Runtime.Api_error { 10758 11974 operation = op_name; ··· 10762 11978 body = Requests.Response.text response; 10763 11979 }) 10764 11980 10765 - (** List videos of subscriptions of my user 11981 + (** List video channels 10766 11982 @param start Offset used to paginate results 10767 11983 @param count Number of items to return 10768 - @param skip_count if you don't need the `total` in the response 10769 - @param nsfw whether to include nsfw videos, if any 10770 - @param is_live whether or not the video is a live 10771 - @param include_scheduled_live whether or not include live that are scheduled for later 10772 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 10773 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 10774 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 10775 - @param tags_one_of tag(s) of the video 10776 - @param tags_all_of tag(s) of the video, where all should be present in the video 10777 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 10778 - @param include_ **Only administrators and moderators can use this parameter** 10779 - 10780 - Include additional videos in results (can be combined using bitwise or operator) 10781 - - `0` NONE 10782 - - `1` NOT_PUBLISHED_STATE 10783 - - `2` BLACKLISTED 10784 - - `4` BLOCKED_OWNER 10785 - - `8` FILES 10786 - - `16` CAPTIONS 10787 - - `32` VIDEO SOURCE 10788 - 10789 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 10790 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 10791 - @param host Find elements owned by this host 10792 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 10793 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 10794 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 10795 - @param search Plain text search, applied to various parts of the model depending on endpoint 11984 + @param sort Sort column 10796 11985 *) 10797 - let get_api_v1_users_me_subscriptions_videos ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 10798 - let op_name = "get_api_v1_users_me_subscriptions_videos" in 10799 - let url_path = "/api/v1/users/me/subscriptions/videos" in 10800 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 10801 - let url = client.base_url ^ url_path ^ query in 10802 - let response = 10803 - try Requests.get client.session url 10804 - with Eio.Io _ as ex -> 10805 - let bt = Printexc.get_raw_backtrace () in 10806 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10807 - in 10808 - if Requests.Response.ok response then 10809 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 10810 - else 10811 - raise (Openapi.Runtime.Api_error { 10812 - operation = op_name; 10813 - method_ = "GET"; 10814 - url; 10815 - status = Requests.Response.status_code response; 10816 - body = Requests.Response.text response; 10817 - }) 10818 - 10819 - (** List videos of my user 10820 - @param channel_name_one_of **PeerTube >= 7.2** Filter on videos that are published by a channel with one of these names 10821 - @param start Offset used to paginate results 10822 - @param count Number of items to return 10823 - @param skip_count if you don't need the `total` in the response 10824 - @param nsfw whether to include nsfw videos, if any 10825 - @param is_live whether or not the video is a live 10826 - @param include_scheduled_live whether or not include live that are scheduled for later 10827 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 10828 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 10829 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 10830 - @param tags_one_of tag(s) of the video 10831 - @param tags_all_of tag(s) of the video, where all should be present in the video 10832 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 10833 - @param include_ **Only administrators and moderators can use this parameter** 10834 - 10835 - Include additional videos in results (can be combined using bitwise or operator) 10836 - - `0` NONE 10837 - - `1` NOT_PUBLISHED_STATE 10838 - - `2` BLACKLISTED 10839 - - `4` BLOCKED_OWNER 10840 - - `8` FILES 10841 - - `16` CAPTIONS 10842 - - `32` VIDEO SOURCE 10843 - 10844 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 10845 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 10846 - @param host Find elements owned by this host 10847 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 10848 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 10849 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 10850 - @param search Plain text search, applied to various parts of the model depending on endpoint 10851 - @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 10852 - *) 10853 - let get_api_v1_users_me_videos ?channel_name_one_of ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search ?include_collaborations client () = 10854 - let op_name = "get_api_v1_users_me_videos" in 10855 - let url_path = "/api/v1/users/me/videos" in 10856 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"channelNameOneOf" ~value:channel_name_one_of; Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search; Openapi.Runtime.Query.optional ~key:"includeCollaborations" ~value:include_collaborations]) in 10857 - let url = client.base_url ^ url_path ^ query in 10858 - let response = 10859 - try Requests.get client.session url 10860 - with Eio.Io _ as ex -> 10861 - let bt = Printexc.get_raw_backtrace () in 10862 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10863 - in 10864 - if Requests.Response.ok response then 10865 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 10866 - else 10867 - raise (Openapi.Runtime.Api_error { 10868 - operation = op_name; 10869 - method_ = "GET"; 10870 - url; 10871 - status = Requests.Response.status_code response; 10872 - body = Requests.Response.text response; 10873 - }) 10874 - 10875 - (** List videos of a video channel 10876 - @param channel_handle The video channel handle 10877 - @param start Offset used to paginate results 10878 - @param count Number of items to return 10879 - @param skip_count if you don't need the `total` in the response 10880 - @param nsfw whether to include nsfw videos, if any 10881 - @param is_live whether or not the video is a live 10882 - @param include_scheduled_live whether or not include live that are scheduled for later 10883 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 10884 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 10885 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 10886 - @param tags_one_of tag(s) of the video 10887 - @param tags_all_of tag(s) of the video, where all should be present in the video 10888 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 10889 - @param include_ **Only administrators and moderators can use this parameter** 10890 - 10891 - Include additional videos in results (can be combined using bitwise or operator) 10892 - - `0` NONE 10893 - - `1` NOT_PUBLISHED_STATE 10894 - - `2` BLACKLISTED 10895 - - `4` BLOCKED_OWNER 10896 - - `8` FILES 10897 - - `16` CAPTIONS 10898 - - `32` VIDEO SOURCE 10899 - 10900 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 10901 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 10902 - @param host Find elements owned by this host 10903 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 10904 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 10905 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 10906 - @param search Plain text search, applied to various parts of the model depending on endpoint 10907 - *) 10908 - let get_video_channel_videos ~channel_handle ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 10909 - let op_name = "get_video_channel_videos" in 10910 - let url_path = Openapi.Runtime.Path.render ~params:[("channelHandle", channel_handle)] "/api/v1/video-channels/{channelHandle}/videos" in 10911 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 10912 - let url = client.base_url ^ url_path ^ query in 10913 - let response = 10914 - try Requests.get client.session url 10915 - with Eio.Io _ as ex -> 10916 - let bt = Printexc.get_raw_backtrace () in 10917 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10918 - in 10919 - if Requests.Response.ok response then 10920 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 10921 - else 10922 - raise (Openapi.Runtime.Api_error { 10923 - operation = op_name; 10924 - method_ = "GET"; 10925 - url; 10926 - status = Requests.Response.status_code response; 10927 - body = Requests.Response.text response; 10928 - }) 10929 - 10930 - (** List videos 10931 - @param start Offset used to paginate results 10932 - @param count Number of items to return 10933 - @param skip_count if you don't need the `total` in the response 10934 - @param nsfw whether to include nsfw videos, if any 10935 - @param is_live whether or not the video is a live 10936 - @param include_scheduled_live whether or not include live that are scheduled for later 10937 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 10938 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 10939 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 10940 - @param tags_one_of tag(s) of the video 10941 - @param tags_all_of tag(s) of the video, where all should be present in the video 10942 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 10943 - @param include_ **Only administrators and moderators can use this parameter** 10944 - 10945 - Include additional videos in results (can be combined using bitwise or operator) 10946 - - `0` NONE 10947 - - `1` NOT_PUBLISHED_STATE 10948 - - `2` BLACKLISTED 10949 - - `4` BLOCKED_OWNER 10950 - - `8` FILES 10951 - - `16` CAPTIONS 10952 - - `32` VIDEO SOURCE 10953 - 10954 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 10955 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 10956 - @param host Find elements owned by this host 10957 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 10958 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 10959 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 10960 - @param search Plain text search, applied to various parts of the model depending on endpoint 10961 - *) 10962 - let get_videos ?start ?count ?skip_count ?sort ?nsfw ?nsfw_flags_included ?nsfw_flags_excluded ?is_live ?include_scheduled_live ?category_one_of ?licence_one_of ?language_one_of ?tags_one_of ?tags_all_of ?is_local ?include_ ?has_hlsfiles ?has_web_video_files ?host ?auto_tag_one_of ?privacy_one_of ?exclude_already_watched ?search client () = 10963 - let op_name = "get_videos" in 10964 - let url_path = "/api/v1/videos" in 10965 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"skipCount" ~value:skip_count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort; Openapi.Runtime.Query.optional ~key:"nsfw" ~value:nsfw; Openapi.Runtime.Query.optional ~key:"nsfwFlagsIncluded" ~value:nsfw_flags_included; Openapi.Runtime.Query.optional ~key:"nsfwFlagsExcluded" ~value:nsfw_flags_excluded; Openapi.Runtime.Query.optional ~key:"isLive" ~value:is_live; Openapi.Runtime.Query.optional ~key:"includeScheduledLive" ~value:include_scheduled_live; Openapi.Runtime.Query.optional ~key:"categoryOneOf" ~value:category_one_of; Openapi.Runtime.Query.optional ~key:"licenceOneOf" ~value:licence_one_of; Openapi.Runtime.Query.optional ~key:"languageOneOf" ~value:language_one_of; Openapi.Runtime.Query.optional ~key:"tagsOneOf" ~value:tags_one_of; Openapi.Runtime.Query.optional ~key:"tagsAllOf" ~value:tags_all_of; Openapi.Runtime.Query.optional ~key:"isLocal" ~value:is_local; Openapi.Runtime.Query.optional ~key:"include" ~value:include_; Openapi.Runtime.Query.optional ~key:"hasHLSFiles" ~value:has_hlsfiles; Openapi.Runtime.Query.optional ~key:"hasWebVideoFiles" ~value:has_web_video_files; Openapi.Runtime.Query.optional ~key:"host" ~value:host; Openapi.Runtime.Query.optional ~key:"autoTagOneOf" ~value:auto_tag_one_of; Openapi.Runtime.Query.optional ~key:"privacyOneOf" ~value:privacy_one_of; Openapi.Runtime.Query.optional ~key:"excludeAlreadyWatched" ~value:exclude_already_watched; Openapi.Runtime.Query.optional ~key:"search" ~value:search]) in 10966 - let url = client.base_url ^ url_path ^ query in 10967 - let response = 10968 - try Requests.get client.session url 10969 - with Eio.Io _ as ex -> 10970 - let bt = Printexc.get_raw_backtrace () in 10971 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 10972 - in 10973 - if Requests.Response.ok response then 10974 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 10975 - else 10976 - raise (Openapi.Runtime.Api_error { 10977 - operation = op_name; 10978 - method_ = "GET"; 10979 - url; 10980 - status = Requests.Response.status_code response; 10981 - body = Requests.Response.text response; 10982 - }) 10983 - end 10984 - 10985 - module VideoCommentForOwnerOrAdmin = struct 10986 - module T = struct 10987 - type t = { 10988 - account : Jsont.json option; 10989 - automatic_tags : string list option; 10990 - created_at : Jsont.json option; 10991 - held_for_review : Jsont.json option; 10992 - id : Id.T.t option; 10993 - in_reply_to_comment_id : Jsont.json option; 10994 - text : Jsont.json option; 10995 - thread_id : Jsont.json option; 10996 - updated_at : Jsont.json option; 10997 - url : Jsont.json option; 10998 - video : Video.Info.t option; 10999 - } 11000 - 11001 - let v ?account ?automatic_tags ?created_at ?held_for_review ?id ?in_reply_to_comment_id ?text ?thread_id ?updated_at ?url ?video () = { account; automatic_tags; created_at; held_for_review; id; in_reply_to_comment_id; text; thread_id; updated_at; url; video } 11002 - 11003 - let account t = t.account 11004 - let automatic_tags t = t.automatic_tags 11005 - let created_at t = t.created_at 11006 - let held_for_review t = t.held_for_review 11007 - let id t = t.id 11008 - let in_reply_to_comment_id t = t.in_reply_to_comment_id 11009 - let text t = t.text 11010 - let thread_id t = t.thread_id 11011 - let updated_at t = t.updated_at 11012 - let url t = t.url 11013 - let video t = t.video 11014 - 11015 - let jsont : t Jsont.t = 11016 - Jsont.Object.map ~kind:"VideoCommentForOwnerOrAdmin" 11017 - (fun account automatic_tags created_at held_for_review id in_reply_to_comment_id text thread_id updated_at url video -> { account; automatic_tags; created_at; held_for_review; id; in_reply_to_comment_id; text; thread_id; updated_at; url; video }) 11018 - |> Jsont.Object.opt_mem "account" Jsont.json ~enc:(fun r -> r.account) 11019 - |> Jsont.Object.opt_mem "automaticTags" (Jsont.list Jsont.string) ~enc:(fun r -> r.automatic_tags) 11020 - |> Jsont.Object.opt_mem "createdAt" Jsont.json ~enc:(fun r -> r.created_at) 11021 - |> Jsont.Object.opt_mem "heldForReview" Jsont.json ~enc:(fun r -> r.held_for_review) 11022 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 11023 - |> Jsont.Object.opt_mem "inReplyToCommentId" Jsont.json ~enc:(fun r -> r.in_reply_to_comment_id) 11024 - |> Jsont.Object.opt_mem "text" Jsont.json ~enc:(fun r -> r.text) 11025 - |> Jsont.Object.opt_mem "threadId" Jsont.json ~enc:(fun r -> r.thread_id) 11026 - |> Jsont.Object.opt_mem "updatedAt" Jsont.json ~enc:(fun r -> r.updated_at) 11027 - |> Jsont.Object.opt_mem "url" Jsont.json ~enc:(fun r -> r.url) 11028 - |> Jsont.Object.opt_mem "video" Video.Info.jsont ~enc:(fun r -> r.video) 11029 - |> Jsont.Object.skip_unknown 11030 - |> Jsont.Object.finish 11031 - end 11032 - end 11033 - 11034 - module AbuseMessage = struct 11035 - module T = struct 11036 - type t = { 11037 - account : AccountSummary.T.t option; 11038 - by_moderator : bool option; 11039 - created_at : Ptime.t option; 11040 - id : Id.T.t option; 11041 - message : string option; 11042 - } 11043 - 11044 - let v ?account ?by_moderator ?created_at ?id ?message () = { account; by_moderator; created_at; id; message } 11045 - 11046 - let account t = t.account 11047 - let by_moderator t = t.by_moderator 11048 - let created_at t = t.created_at 11049 - let id t = t.id 11050 - let message t = t.message 11051 - 11052 - let jsont : t Jsont.t = 11053 - Jsont.Object.map ~kind:"AbuseMessage" 11054 - (fun account by_moderator created_at id message -> { account; by_moderator; created_at; id; message }) 11055 - |> Jsont.Object.opt_mem "account" AccountSummary.T.jsont ~enc:(fun r -> r.account) 11056 - |> Jsont.Object.opt_mem "byModerator" Jsont.bool ~enc:(fun r -> r.by_moderator) 11057 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 11058 - |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 11059 - |> Jsont.Object.opt_mem "message" Jsont.string ~enc:(fun r -> r.message) 11060 - |> Jsont.Object.skip_unknown 11061 - |> Jsont.Object.finish 11062 - end 11063 - end 11064 - 11065 - module Account = struct 11066 - module T = struct 11067 - type t = Jsont.json 11068 - 11069 - let jsont = Jsont.json 11070 - 11071 - let v () = Jsont.Null ((), Jsont.Meta.none) 11072 - end 11073 - 11074 - (** Get an account 11075 - @param name The username or handle of the account 11076 - *) 11077 - let get_account ~name client () = 11078 - let op_name = "get_account" in 11079 - let url_path = Openapi.Runtime.Path.render ~params:[("name", name)] "/api/v1/accounts/{name}" in 11080 - let query = "" in 11986 + let get_video_channels ?start ?count ?sort client () = 11987 + let op_name = "get_video_channels" in 11988 + let url_path = "/api/v1/video-channels" in 11989 + let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 11081 11990 let url = client.base_url ^ url_path ^ query in 11082 11991 let response = 11083 11992 try Requests.get client.session url ··· 11097 12006 }) 11098 12007 end 11099 12008 11100 - module VideoComment = struct 12009 + module UserWithStats = struct 11101 12010 module T = struct 11102 12011 type t = { 11103 12012 account : Account.T.t option; 11104 - created_at : Ptime.t option; 11105 - deleted_at : Ptime.t option; 11106 - held_for_review : bool option; 12013 + admin_flags : UserAdminFlags.T.t option; 12014 + auto_play_next_video : bool option; (** Automatically start playing the upcoming video after the currently playing video *) 12015 + auto_play_next_video_playlist : bool option; (** Automatically start playing the video on the playlist after the currently playing video *) 12016 + auto_play_video : bool option; (** Automatically start playing the video on the watch page *) 12017 + blocked : bool option; 12018 + blocked_reason : string option; 12019 + created_at : string option; 12020 + email : string option; (** The user email *) 12021 + email_public : bool option; (** Has the user accepted to display the email publicly? *) 12022 + email_verified : bool option; (** Has the user confirmed their email address? *) 11107 12023 id : Id.T.t option; 11108 - in_reply_to_comment_id : Jsont.json option; 11109 - is_deleted : bool option; 11110 - text : string option; (** Text of the comment *) 11111 - thread_id : Id.T.t option; 11112 - total_replies : int option; 11113 - total_replies_from_video_author : int option; 11114 - updated_at : Ptime.t option; 11115 - url : string option; 11116 - video_id : Jsont.json option; 12024 + language : string option; (** default language for this user *) 12025 + last_login_date : Ptime.t option; 12026 + new_features_info_read : float option; (** New features information the user has read *) 12027 + no_account_setup_warning_modal : bool option; 12028 + no_instance_config_warning_modal : bool option; 12029 + no_welcome_modal : bool option; 12030 + notification_settings : UserNotificationSettings.T.t option; 12031 + nsfw_flags_blurred : Nsfwflag.T.t option; 12032 + nsfw_flags_displayed : Nsfwflag.T.t option; 12033 + nsfw_flags_hidden : Nsfwflag.T.t option; 12034 + nsfw_flags_warned : Nsfwflag.T.t option; 12035 + nsfw_policy : Nsfwpolicy.T.t option; 12036 + p2p_enabled : bool option; (** whether to enable P2P in the player or not *) 12037 + plugin_auth : string option; (** Auth plugin to use to authenticate the user *) 12038 + role : Jsont.json option; 12039 + theme : string option; (** Theme enabled by this user *) 12040 + two_factor_enabled : bool option; (** Whether the user has enabled two-factor authentication or not *) 12041 + username : Username.T.t option; 12042 + video_channels : VideoChannel.T.t list option; 12043 + video_languages : string list option; (** list of languages to filter videos down to *) 12044 + video_quota : int option; (** The user video quota in bytes *) 12045 + video_quota_daily : int option; (** The user daily video quota in bytes *) 12046 + videos_history_enabled : bool option; (** whether to keep track of watched history or not *) 12047 + videos_count : int option; (** Count of videos published *) 12048 + abuses_count : int option; (** Count of reports/abuses of which the user is a target *) 12049 + abuses_accepted_count : int option; (** Count of reports/abuses created by the user and accepted/acted upon by the moderation team *) 12050 + abuses_created_count : int option; (** Count of reports/abuses created by the user *) 12051 + video_comments_count : int option; (** Count of comments published *) 11117 12052 } 11118 12053 11119 - let v ?account ?created_at ?deleted_at ?held_for_review ?id ?in_reply_to_comment_id ?is_deleted ?text ?thread_id ?total_replies ?total_replies_from_video_author ?updated_at ?url ?video_id () = { account; created_at; deleted_at; held_for_review; id; in_reply_to_comment_id; is_deleted; text; thread_id; total_replies; total_replies_from_video_author; updated_at; url; video_id } 12054 + let v ?account ?admin_flags ?auto_play_next_video ?auto_play_next_video_playlist ?auto_play_video ?blocked ?blocked_reason ?created_at ?email ?email_public ?email_verified ?id ?language ?last_login_date ?new_features_info_read ?no_account_setup_warning_modal ?no_instance_config_warning_modal ?no_welcome_modal ?notification_settings ?nsfw_flags_blurred ?nsfw_flags_displayed ?nsfw_flags_hidden ?nsfw_flags_warned ?nsfw_policy ?p2p_enabled ?plugin_auth ?role ?theme ?two_factor_enabled ?username ?video_channels ?video_languages ?video_quota ?video_quota_daily ?videos_history_enabled ?videos_count ?abuses_count ?abuses_accepted_count ?abuses_created_count ?video_comments_count () = { account; admin_flags; auto_play_next_video; auto_play_next_video_playlist; auto_play_video; blocked; blocked_reason; created_at; email; email_public; email_verified; id; language; last_login_date; new_features_info_read; no_account_setup_warning_modal; no_instance_config_warning_modal; no_welcome_modal; notification_settings; nsfw_flags_blurred; nsfw_flags_displayed; nsfw_flags_hidden; nsfw_flags_warned; nsfw_policy; p2p_enabled; plugin_auth; role; theme; two_factor_enabled; username; video_channels; video_languages; video_quota; video_quota_daily; videos_history_enabled; videos_count; abuses_count; abuses_accepted_count; abuses_created_count; video_comments_count } 11120 12055 11121 12056 let account t = t.account 12057 + let admin_flags t = t.admin_flags 12058 + let auto_play_next_video t = t.auto_play_next_video 12059 + let auto_play_next_video_playlist t = t.auto_play_next_video_playlist 12060 + let auto_play_video t = t.auto_play_video 12061 + let blocked t = t.blocked 12062 + let blocked_reason t = t.blocked_reason 11122 12063 let created_at t = t.created_at 11123 - let deleted_at t = t.deleted_at 11124 - let held_for_review t = t.held_for_review 12064 + let email t = t.email 12065 + let email_public t = t.email_public 12066 + let email_verified t = t.email_verified 11125 12067 let id t = t.id 11126 - let in_reply_to_comment_id t = t.in_reply_to_comment_id 11127 - let is_deleted t = t.is_deleted 11128 - let text t = t.text 11129 - let thread_id t = t.thread_id 11130 - let total_replies t = t.total_replies 11131 - let total_replies_from_video_author t = t.total_replies_from_video_author 11132 - let updated_at t = t.updated_at 11133 - let url t = t.url 11134 - let video_id t = t.video_id 12068 + let language t = t.language 12069 + let last_login_date t = t.last_login_date 12070 + let new_features_info_read t = t.new_features_info_read 12071 + let no_account_setup_warning_modal t = t.no_account_setup_warning_modal 12072 + let no_instance_config_warning_modal t = t.no_instance_config_warning_modal 12073 + let no_welcome_modal t = t.no_welcome_modal 12074 + let notification_settings t = t.notification_settings 12075 + let nsfw_flags_blurred t = t.nsfw_flags_blurred 12076 + let nsfw_flags_displayed t = t.nsfw_flags_displayed 12077 + let nsfw_flags_hidden t = t.nsfw_flags_hidden 12078 + let nsfw_flags_warned t = t.nsfw_flags_warned 12079 + let nsfw_policy t = t.nsfw_policy 12080 + let p2p_enabled t = t.p2p_enabled 12081 + let plugin_auth t = t.plugin_auth 12082 + let role t = t.role 12083 + let theme t = t.theme 12084 + let two_factor_enabled t = t.two_factor_enabled 12085 + let username t = t.username 12086 + let video_channels t = t.video_channels 12087 + let video_languages t = t.video_languages 12088 + let video_quota t = t.video_quota 12089 + let video_quota_daily t = t.video_quota_daily 12090 + let videos_history_enabled t = t.videos_history_enabled 12091 + let videos_count t = t.videos_count 12092 + let abuses_count t = t.abuses_count 12093 + let abuses_accepted_count t = t.abuses_accepted_count 12094 + let abuses_created_count t = t.abuses_created_count 12095 + let video_comments_count t = t.video_comments_count 11135 12096 11136 12097 let jsont : t Jsont.t = 11137 - Jsont.Object.map ~kind:"VideoComment" 11138 - (fun account created_at deleted_at held_for_review id in_reply_to_comment_id is_deleted text thread_id total_replies total_replies_from_video_author updated_at url video_id -> { account; created_at; deleted_at; held_for_review; id; in_reply_to_comment_id; is_deleted; text; thread_id; total_replies; total_replies_from_video_author; updated_at; url; video_id }) 12098 + Jsont.Object.map ~kind:"UserWithStats" 12099 + (fun account admin_flags auto_play_next_video auto_play_next_video_playlist auto_play_video blocked blocked_reason created_at email email_public email_verified id language last_login_date new_features_info_read no_account_setup_warning_modal no_instance_config_warning_modal no_welcome_modal notification_settings nsfw_flags_blurred nsfw_flags_displayed nsfw_flags_hidden nsfw_flags_warned nsfw_policy p2p_enabled plugin_auth role theme two_factor_enabled username video_channels video_languages video_quota video_quota_daily videos_history_enabled videos_count abuses_count abuses_accepted_count abuses_created_count video_comments_count -> { account; admin_flags; auto_play_next_video; auto_play_next_video_playlist; auto_play_video; blocked; blocked_reason; created_at; email; email_public; email_verified; id; language; last_login_date; new_features_info_read; no_account_setup_warning_modal; no_instance_config_warning_modal; no_welcome_modal; notification_settings; nsfw_flags_blurred; nsfw_flags_displayed; nsfw_flags_hidden; nsfw_flags_warned; nsfw_policy; p2p_enabled; plugin_auth; role; theme; two_factor_enabled; username; video_channels; video_languages; video_quota; video_quota_daily; videos_history_enabled; videos_count; abuses_count; abuses_accepted_count; abuses_created_count; video_comments_count }) 11139 12100 |> Jsont.Object.opt_mem "account" Account.T.jsont ~enc:(fun r -> r.account) 11140 - |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 11141 - |> Jsont.Object.opt_mem "deletedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.deleted_at) 11142 - |> Jsont.Object.opt_mem "heldForReview" Jsont.bool ~enc:(fun r -> r.held_for_review) 12101 + |> Jsont.Object.opt_mem "adminFlags" UserAdminFlags.T.jsont ~enc:(fun r -> r.admin_flags) 12102 + |> Jsont.Object.opt_mem "autoPlayNextVideo" Jsont.bool ~enc:(fun r -> r.auto_play_next_video) 12103 + |> Jsont.Object.opt_mem "autoPlayNextVideoPlaylist" Jsont.bool ~enc:(fun r -> r.auto_play_next_video_playlist) 12104 + |> Jsont.Object.opt_mem "autoPlayVideo" Jsont.bool ~enc:(fun r -> r.auto_play_video) 12105 + |> Jsont.Object.opt_mem "blocked" Jsont.bool ~enc:(fun r -> r.blocked) 12106 + |> Jsont.Object.opt_mem "blockedReason" Jsont.string ~enc:(fun r -> r.blocked_reason) 12107 + |> Jsont.Object.opt_mem "createdAt" Jsont.string ~enc:(fun r -> r.created_at) 12108 + |> Jsont.Object.opt_mem "email" Jsont.string ~enc:(fun r -> r.email) 12109 + |> Jsont.Object.opt_mem "emailPublic" Jsont.bool ~enc:(fun r -> r.email_public) 12110 + |> Jsont.Object.opt_mem "emailVerified" Jsont.bool ~enc:(fun r -> r.email_verified) 11143 12111 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 11144 - |> Jsont.Object.opt_mem "inReplyToCommentId" Jsont.json ~enc:(fun r -> r.in_reply_to_comment_id) 11145 - |> Jsont.Object.opt_mem "isDeleted" Jsont.bool ~enc:(fun r -> r.is_deleted) 11146 - |> Jsont.Object.opt_mem "text" Jsont.string ~enc:(fun r -> r.text) 11147 - |> Jsont.Object.opt_mem "threadId" Id.T.jsont ~enc:(fun r -> r.thread_id) 11148 - |> Jsont.Object.opt_mem "totalReplies" Jsont.int ~enc:(fun r -> r.total_replies) 11149 - |> Jsont.Object.opt_mem "totalRepliesFromVideoAuthor" Jsont.int ~enc:(fun r -> r.total_replies_from_video_author) 11150 - |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 11151 - |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 11152 - |> Jsont.Object.opt_mem "videoId" Jsont.json ~enc:(fun r -> r.video_id) 11153 - |> Jsont.Object.skip_unknown 11154 - |> Jsont.Object.finish 11155 - end 11156 - end 11157 - 11158 - module VideoCommentThreadTree = struct 11159 - module T = struct 11160 - type t = { 11161 - children : Jsont.json list option; 11162 - comment : VideoComment.T.t option; 11163 - } 11164 - 11165 - let v ?children ?comment () = { children; comment } 11166 - 11167 - let children t = t.children 11168 - let comment t = t.comment 11169 - 11170 - let jsont : t Jsont.t = 11171 - Jsont.Object.map ~kind:"VideoCommentThreadTree" 11172 - (fun children comment -> { children; comment }) 11173 - |> Jsont.Object.opt_mem "children" (Jsont.list Jsont.json) ~enc:(fun r -> r.children) 11174 - |> Jsont.Object.opt_mem "comment" VideoComment.T.jsont ~enc:(fun r -> r.comment) 11175 - |> Jsont.Object.skip_unknown 11176 - |> Jsont.Object.finish 11177 - end 11178 - 11179 - (** Get a thread 11180 - @param id The object id, uuid or short uuid 11181 - @param thread_id The thread id (root comment id) 11182 - *) 11183 - let get_api_v1_videos_comment_threads ~id ~thread_id client () = 11184 - let op_name = "get_api_v1_videos_comment_threads" in 11185 - let url_path = Openapi.Runtime.Path.render ~params:[("id", id); ("threadId", thread_id)] "/api/v1/videos/{id}/comment-threads/{threadId}" in 11186 - let query = "" in 11187 - let url = client.base_url ^ url_path ^ query in 11188 - let response = 11189 - try Requests.get client.session url 11190 - with Eio.Io _ as ex -> 11191 - let bt = Printexc.get_raw_backtrace () in 11192 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 11193 - in 11194 - if Requests.Response.ok response then 11195 - Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 11196 - else 11197 - raise (Openapi.Runtime.Api_error { 11198 - operation = op_name; 11199 - method_ = "GET"; 11200 - url; 11201 - status = Requests.Response.status_code response; 11202 - body = Requests.Response.text response; 11203 - }) 11204 - end 11205 - 11206 - module CommentThreadPost = struct 11207 - module Response = struct 11208 - type t = { 11209 - comment : VideoComment.T.t option; 11210 - } 11211 - 11212 - let v ?comment () = { comment } 11213 - 11214 - let comment t = t.comment 11215 - 11216 - let jsont : t Jsont.t = 11217 - Jsont.Object.map ~kind:"CommentThreadPostResponse" 11218 - (fun comment -> { comment }) 11219 - |> Jsont.Object.opt_mem "comment" VideoComment.T.jsont ~enc:(fun r -> r.comment) 12112 + |> Jsont.Object.opt_mem "language" Jsont.string ~enc:(fun r -> r.language) 12113 + |> Jsont.Object.opt_mem "lastLoginDate" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.last_login_date) 12114 + |> Jsont.Object.opt_mem "newFeaturesInfoRead" Jsont.number ~enc:(fun r -> r.new_features_info_read) 12115 + |> Jsont.Object.opt_mem "noAccountSetupWarningModal" Jsont.bool ~enc:(fun r -> r.no_account_setup_warning_modal) 12116 + |> Jsont.Object.opt_mem "noInstanceConfigWarningModal" Jsont.bool ~enc:(fun r -> r.no_instance_config_warning_modal) 12117 + |> Jsont.Object.opt_mem "noWelcomeModal" Jsont.bool ~enc:(fun r -> r.no_welcome_modal) 12118 + |> Jsont.Object.opt_mem "notificationSettings" UserNotificationSettings.T.jsont ~enc:(fun r -> r.notification_settings) 12119 + |> Jsont.Object.opt_mem "nsfwFlagsBlurred" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags_blurred) 12120 + |> Jsont.Object.opt_mem "nsfwFlagsDisplayed" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags_displayed) 12121 + |> Jsont.Object.opt_mem "nsfwFlagsHidden" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags_hidden) 12122 + |> Jsont.Object.opt_mem "nsfwFlagsWarned" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags_warned) 12123 + |> Jsont.Object.opt_mem "nsfwPolicy" Nsfwpolicy.T.jsont ~enc:(fun r -> r.nsfw_policy) 12124 + |> Jsont.Object.opt_mem "p2pEnabled" Jsont.bool ~enc:(fun r -> r.p2p_enabled) 12125 + |> Jsont.Object.opt_mem "pluginAuth" Jsont.string ~enc:(fun r -> r.plugin_auth) 12126 + |> Jsont.Object.opt_mem "role" Jsont.json ~enc:(fun r -> r.role) 12127 + |> Jsont.Object.opt_mem "theme" Jsont.string ~enc:(fun r -> r.theme) 12128 + |> Jsont.Object.opt_mem "twoFactorEnabled" Jsont.bool ~enc:(fun r -> r.two_factor_enabled) 12129 + |> Jsont.Object.opt_mem "username" Username.T.jsont ~enc:(fun r -> r.username) 12130 + |> Jsont.Object.opt_mem "videoChannels" (Jsont.list VideoChannel.T.jsont) ~enc:(fun r -> r.video_channels) 12131 + |> Jsont.Object.opt_mem "videoLanguages" (Jsont.list Jsont.string) ~enc:(fun r -> r.video_languages) 12132 + |> Jsont.Object.opt_mem "videoQuota" Jsont.int ~enc:(fun r -> r.video_quota) 12133 + |> Jsont.Object.opt_mem "videoQuotaDaily" Jsont.int ~enc:(fun r -> r.video_quota_daily) 12134 + |> Jsont.Object.opt_mem "videosHistoryEnabled" Jsont.bool ~enc:(fun r -> r.videos_history_enabled) 12135 + |> Jsont.Object.opt_mem "videosCount" Jsont.int ~enc:(fun r -> r.videos_count) 12136 + |> Jsont.Object.opt_mem "abusesCount" Jsont.int ~enc:(fun r -> r.abuses_count) 12137 + |> Jsont.Object.opt_mem "abusesAcceptedCount" Jsont.int ~enc:(fun r -> r.abuses_accepted_count) 12138 + |> Jsont.Object.opt_mem "abusesCreatedCount" Jsont.int ~enc:(fun r -> r.abuses_created_count) 12139 + |> Jsont.Object.opt_mem "videoCommentsCount" Jsont.int ~enc:(fun r -> r.video_comments_count) 11220 12140 |> Jsont.Object.skip_unknown 11221 12141 |> Jsont.Object.finish 11222 12142 end 11223 - 11224 - (** Create a thread 11225 - @param id The object id, uuid or short uuid 11226 - *) 11227 - let post_api_v1_videos_comment_threads ~id client () = 11228 - let op_name = "post_api_v1_videos_comment_threads" in 11229 - let url_path = Openapi.Runtime.Path.render ~params:[("id", id)] "/api/v1/videos/{id}/comment-threads" in 11230 - let query = "" in 11231 - let url = client.base_url ^ url_path ^ query in 11232 - let response = 11233 - try Requests.post client.session url 11234 - with Eio.Io _ as ex -> 11235 - let bt = Printexc.get_raw_backtrace () in 11236 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "POST" url 11237 - in 11238 - if Requests.Response.ok response then 11239 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 11240 - else 11241 - raise (Openapi.Runtime.Api_error { 11242 - operation = op_name; 11243 - method_ = "POST"; 11244 - url; 11245 - status = Requests.Response.status_code response; 11246 - body = Requests.Response.text response; 11247 - }) 11248 - 11249 - (** Reply to a thread of a video 11250 - @param id The object id, uuid or short uuid 11251 - @param comment_id The comment id 11252 - *) 11253 - let post_api_v1_videos_comments ~id ~comment_id client () = 11254 - let op_name = "post_api_v1_videos_comments" in 11255 - let url_path = Openapi.Runtime.Path.render ~params:[("id", id); ("commentId", comment_id)] "/api/v1/videos/{id}/comments/{commentId}" in 11256 - let query = "" in 11257 - let url = client.base_url ^ url_path ^ query in 11258 - let response = 11259 - try Requests.post client.session url 11260 - with Eio.Io _ as ex -> 11261 - let bt = Printexc.get_raw_backtrace () in 11262 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "POST" url 11263 - in 11264 - if Requests.Response.ok response then 11265 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 11266 - else 11267 - raise (Openapi.Runtime.Api_error { 11268 - operation = op_name; 11269 - method_ = "POST"; 11270 - url; 11271 - status = Requests.Response.status_code response; 11272 - body = Requests.Response.text response; 11273 - }) 11274 - end 11275 - 11276 - module CommentThread = struct 11277 - module Response = struct 11278 - type t = { 11279 - data : VideoComment.T.t list option; 11280 - total : int option; (** Total threads (included deleted ones) on this video *) 11281 - total_not_deleted_comments : int option; (** Total not-deleted threads (included deleted ones) on this video *) 11282 - } 11283 - 11284 - let v ?data ?total ?total_not_deleted_comments () = { data; total; total_not_deleted_comments } 11285 - 11286 - let data t = t.data 11287 - let total t = t.total 11288 - let total_not_deleted_comments t = t.total_not_deleted_comments 11289 - 11290 - let jsont : t Jsont.t = 11291 - Jsont.Object.map ~kind:"CommentThreadResponse" 11292 - (fun data total total_not_deleted_comments -> { data; total; total_not_deleted_comments }) 11293 - |> Jsont.Object.opt_mem "data" (Jsont.list VideoComment.T.jsont) ~enc:(fun r -> r.data) 11294 - |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 11295 - |> Jsont.Object.opt_mem "totalNotDeletedComments" Jsont.int ~enc:(fun r -> r.total_not_deleted_comments) 11296 - |> Jsont.Object.skip_unknown 11297 - |> Jsont.Object.finish 11298 - end 11299 - 11300 - (** List threads of a video 11301 - @param id The object id, uuid or short uuid 11302 - @param start Offset used to paginate results 11303 - @param count Number of items to return 11304 - @param sort Sort comments by criteria 11305 - *) 11306 - let get_api_v1_videos_comment_threads ~id ?start ?count ?sort client () = 11307 - let op_name = "get_api_v1_videos_comment_threads" in 11308 - let url_path = Openapi.Runtime.Path.render ~params:[("id", id)] "/api/v1/videos/{id}/comment-threads" in 11309 - let query = Openapi.Runtime.Query.encode (List.concat [Openapi.Runtime.Query.optional ~key:"start" ~value:start; Openapi.Runtime.Query.optional ~key:"count" ~value:count; Openapi.Runtime.Query.optional ~key:"sort" ~value:sort]) in 11310 - let url = client.base_url ^ url_path ^ query in 11311 - let response = 11312 - try Requests.get client.session url 11313 - with Eio.Io _ as ex -> 11314 - let bt = Printexc.get_raw_backtrace () in 11315 - Eio.Exn.reraise_with_context ex bt "calling %s %s" "GET" url 11316 - in 11317 - if Requests.Response.ok response then 11318 - Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 11319 - else 11320 - raise (Openapi.Runtime.Api_error { 11321 - operation = op_name; 11322 - method_ = "GET"; 11323 - url; 11324 - status = Requests.Response.status_code response; 11325 - body = Requests.Response.text response; 11326 - }) 11327 12143 end 11328 12144 11329 12145 module User = struct
+2385 -1634
ocaml-peertube/peertube.mli
··· 155 155 end 156 156 end 157 157 158 - module VideoUploadRequestResumable : sig 159 - module T : sig 160 - type t 161 - 162 - val jsont : t Jsont.t 163 - 164 - val v : unit -> t 165 - end 166 - end 167 - 168 - module VideoUploadRequestLegacy : sig 169 - module T : sig 170 - type t 171 - 172 - val jsont : t Jsont.t 173 - 174 - val v : unit -> t 175 - end 176 - end 177 - 178 158 module VideoUpload : sig 179 159 module Response : sig 180 160 type t ··· 240 220 end 241 221 end 242 222 243 - module VideoStreamingPlaylists : sig 244 - module T : sig 245 - type t 246 - 247 - val jsont : t Jsont.t 248 - 249 - val v : unit -> t 250 - end 251 - end 252 - 253 223 module VideoStatsUserAgentDevice : sig 254 224 module T : sig 255 225 type t = [ ··· 267 237 end 268 238 end 269 239 240 + module UserViewingVideo : sig 241 + module T : sig 242 + type t 243 + 244 + (** Construct a value 245 + @param current_time timestamp within the video, in seconds 246 + @param client Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 247 + 248 + @param device Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 249 + 250 + @param operating_system Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 251 + 252 + @param session_id Optional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. 253 + 254 + @param view_event Event since last viewing call: 255 + * `seek` - If the user seeked the video 256 + 257 + *) 258 + val v : current_time:int -> ?client:string -> ?device:VideoStatsUserAgentDevice.T.t -> ?operating_system:string -> ?session_id:string -> ?view_event:string -> unit -> t 259 + 260 + (** Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 261 + *) 262 + val client : t -> string option 263 + 264 + (** timestamp within the video, in seconds *) 265 + val current_time : t -> int 266 + 267 + (** Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 268 + *) 269 + val device : t -> VideoStatsUserAgentDevice.T.t option 270 + 271 + (** Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 272 + *) 273 + val operating_system : t -> string option 274 + 275 + (** Optional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. 276 + *) 277 + val session_id : t -> string option 278 + 279 + (** Event since last viewing call: 280 + * `seek` - If the user seeked the video 281 + *) 282 + val view_event : t -> string option 283 + 284 + val jsont : t Jsont.t 285 + end 286 + end 287 + 270 288 module VideoStatsUserAgent : sig 271 289 module T : sig 272 290 type t ··· 400 418 end 401 419 end 402 420 421 + module VideoResolutionSet : sig 422 + module T : sig 423 + (** Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) 424 + 425 + `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. 426 + *) 427 + type t 428 + 429 + val jsont : t Jsont.t 430 + 431 + val v : unit -> t 432 + end 433 + end 434 + 435 + module VideoResolutionConstant : sig 436 + module T : sig 437 + (** resolutions and their labels for the video *) 438 + type t 439 + 440 + (** Construct a value *) 441 + val v : ?id:VideoResolutionSet.T.t -> ?label:string -> unit -> t 442 + 443 + val id : t -> VideoResolutionSet.T.t option 444 + 445 + val label : t -> string option 446 + 447 + val jsont : t Jsont.t 448 + end 449 + end 450 + 403 451 module VideoSource : sig 404 452 module T : sig 405 453 type t ··· 413 461 @param size **PeerTube >= 6.1** Video file size in bytes 414 462 @param width **PeerTube >= 6.1** Video stream width 415 463 *) 416 - val v : ?created_at:Ptime.t -> ?file_download_url:string -> ?fps:float -> ?height:int -> ?input_filename:string -> ?resolution:Jsont.json -> ?size:int -> ?width:int -> unit -> t 464 + val v : ?created_at:Ptime.t -> ?file_download_url:string -> ?fps:float -> ?height:int -> ?input_filename:string -> ?resolution:VideoResolutionConstant.T.t -> ?size:int -> ?width:int -> unit -> t 417 465 418 466 val created_at : t -> Ptime.t option 419 467 ··· 430 478 val input_filename : t -> string option 431 479 432 480 (** **PeerTube >= 6.1** *) 433 - val resolution : t -> Jsont.json option 481 + val resolution : t -> VideoResolutionConstant.T.t option 434 482 435 483 (** **PeerTube >= 6.1** Video file size in bytes *) 436 484 val size : t -> int option ··· 449 497 val get_video_source : id:string -> t -> unit -> T.t 450 498 end 451 499 452 - module VideoResolutionSet : sig 453 - module T : sig 454 - (** Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) 455 - 456 - `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. 457 - *) 458 - type t 459 - 460 - val jsont : t Jsont.t 461 - 462 - val v : unit -> t 463 - end 464 - end 465 - 466 - module VideoResolutionConstant : sig 467 - module T : sig 468 - (** resolutions and their labels for the video *) 469 - type t 470 - 471 - (** Construct a value *) 472 - val v : ?id:VideoResolutionSet.T.t -> ?label:string -> unit -> t 473 - 474 - val id : t -> VideoResolutionSet.T.t option 475 - 476 - val label : t -> string option 477 - 478 - val jsont : t Jsont.t 479 - end 480 - end 481 - 482 500 module VideoReplaceSourceRequestResumable : sig 483 501 module T : sig 484 502 type t ··· 696 714 end 697 715 end 698 716 699 - module VideoDetails : sig 700 - module T : sig 701 - type t 702 - 703 - val jsont : t Jsont.t 704 - 705 - val v : unit -> t 706 - end 707 - 708 - (** Get a video 709 - @param id The object id, uuid or short uuid 710 - *) 711 - val get_video : id:string -> t -> unit -> T.t 712 - end 713 - 714 - module VideoCreateImport : sig 715 - module T : sig 716 - type t 717 - 718 - val jsont : t Jsont.t 719 - 720 - val v : unit -> t 721 - end 722 - end 723 - 724 717 module VideoCommentsPolicySet : sig 725 718 module T : sig 726 719 (** Comments policy of the video (Enabled = `1`, Disabled = `2`, Requires Approval = `3`) *) ··· 775 768 val get_video_chapters : id:string -> t -> unit -> T.t 776 769 end 777 770 778 - module VideoChannelSyncList : sig 779 - module T : sig 780 - type t 781 - 782 - (** Construct a value *) 783 - val v : ?data:Jsont.json list -> ?total:int -> unit -> t 784 - 785 - val data : t -> Jsont.json list option 786 - 787 - val total : t -> int option 788 - 789 - val jsont : t Jsont.t 790 - end 791 - 792 - (** List the synchronizations of video channels of an account 793 - @param name The username or handle of the account 794 - @param start Offset used to paginate results 795 - @param count Number of items to return 796 - @param sort Sort column 797 - @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 798 - *) 799 - val get_api_v1_accounts_video_channel_syncs : name:string -> ?start:string -> ?count:string -> ?sort:string -> ?include_collaborations:string -> t -> unit -> T.t 800 - end 801 - 802 - module VideoChannelList : sig 803 - module T : sig 804 - type t 805 - 806 - (** Construct a value *) 807 - val v : ?data:Jsont.json list -> ?total:int -> unit -> t 808 - 809 - val data : t -> Jsont.json list option 810 - 811 - val total : t -> int option 812 - 813 - val jsont : t Jsont.t 814 - end 815 - 816 - (** List video channels of an account 817 - @param name The username or handle of the account 818 - @param with_stats include daily view statistics for the last 30 days and total views (only if authenticated as the account user) 819 - @param start Offset used to paginate results 820 - @param count Number of items to return 821 - @param search Plain text search, applied to various parts of the model depending on endpoint 822 - @param sort Sort column 823 - @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 824 - *) 825 - val get_api_v1_accounts_video_channels : name:string -> ?with_stats:string -> ?start:string -> ?count:string -> ?search:string -> ?sort:string -> ?include_collaborations:string -> t -> unit -> T.t 826 - 827 - (** Search channels 828 - @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it. 829 - 830 - @param start Offset used to paginate results 831 - @param count Number of items to return 832 - @param search_target If the administrator enabled search index support, you can override the default search target. 833 - 834 - **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information: 835 - * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), 836 - then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. 837 - After that, you can use the classic REST API endpoints to fetch the complete object or interact with it 838 - * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch 839 - the data from the origin instance API 840 - 841 - @param sort Sort column 842 - @param host Find elements owned by this host 843 - @param handles Find elements with these handles 844 - *) 845 - val search_channels : search:string -> ?start:string -> ?count:string -> ?search_target:string -> ?sort:string -> ?host:string -> ?handles:string -> t -> unit -> T.t 846 - 847 - (** List my user subscriptions 848 - @param start Offset used to paginate results 849 - @param count Number of items to return 850 - *) 851 - val get_api_v1_users_me_subscriptions : ?start:string -> ?count:string -> ?sort:string -> t -> unit -> T.t 852 - 853 - (** List video channels 854 - @param start Offset used to paginate results 855 - @param count Number of items to return 856 - @param sort Sort column 857 - *) 858 - val get_video_channels : ?start:string -> ?count:string -> ?sort:string -> t -> unit -> T.t 859 - end 860 - 861 771 module VideoChannelEdit : sig 862 772 module T : sig 863 773 type t ··· 930 840 end 931 841 end 932 842 933 - module VideoChannel : sig 934 - module Update : sig 935 - type t 936 - 937 - val jsont : t Jsont.t 938 - 939 - val v : unit -> t 940 - end 941 - 942 - module Create : sig 943 - type t 944 - 945 - val jsont : t Jsont.t 946 - 947 - val v : unit -> t 948 - end 949 - 950 - module T : sig 951 - type t 952 - 953 - val jsont : t Jsont.t 954 - 955 - val v : unit -> t 956 - end 957 - 958 - (** Get subscription of my user 959 - @param subscription_handle The subscription handle 960 - *) 961 - val get_api_v1_users_me_subscriptions : subscription_handle:string -> t -> unit -> T.t 962 - 963 - (** Get a video channel 964 - @param channel_handle The video channel handle 965 - *) 966 - val get_video_channel : channel_handle:string -> t -> unit -> T.t 967 - end 968 - 969 843 module VideoCategorySet : sig 970 844 module T : sig 971 845 (** category id of the video (see [/videos/categories](#operation/getCategories)) *) ··· 1021 895 val jsont : t Jsont.t 1022 896 1023 897 val v : unit -> t 1024 - end 1025 - end 1026 - 1027 - module UserWithStats : sig 1028 - module T : sig 1029 - type t 1030 - 1031 - val jsont : t Jsont.t 1032 - 1033 - val v : unit -> t 1034 - end 1035 - end 1036 - 1037 - module UserViewingVideo : sig 1038 - module T : sig 1039 - type t 1040 - 1041 - (** Construct a value 1042 - @param current_time timestamp within the video, in seconds 1043 - @param client Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 1044 - 1045 - @param device Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 1046 - 1047 - @param operating_system Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 1048 - 1049 - @param session_id Optional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. 1050 - 1051 - @param view_event Event since last viewing call: 1052 - * `seek` - If the user seeked the video 1053 - 1054 - *) 1055 - val v : current_time:int -> ?client:string -> ?device:Jsont.json -> ?operating_system:string -> ?session_id:string -> ?view_event:string -> unit -> t 1056 - 1057 - (** Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 1058 - *) 1059 - val client : t -> string option 1060 - 1061 - (** timestamp within the video, in seconds *) 1062 - val current_time : t -> int 1063 - 1064 - (** Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 1065 - *) 1066 - val device : t -> Jsont.json option 1067 - 1068 - (** Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 1069 - *) 1070 - val operating_system : t -> string option 1071 - 1072 - (** Optional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. 1073 - *) 1074 - val session_id : t -> string option 1075 - 1076 - (** Event since last viewing call: 1077 - * `seek` - If the user seeked the video 1078 - *) 1079 - val view_event : t -> string option 1080 - 1081 - val jsont : t Jsont.t 1082 898 end 1083 899 end 1084 900 ··· 1654 1470 module T : sig 1655 1471 type t 1656 1472 1657 - val jsont : t Jsont.t 1473 + (** Construct a value 1474 + @param error Error message if the job is errored 1475 + @param failures Number of times a remote runner failed to process this job. After too many failures, the job in "error" state 1476 + @param parent If job has a parent job 1477 + @param priority Job priority (less has more priority) 1478 + @param progress Percentage progress 1479 + @param runner If job is associated to a runner 1480 + *) 1481 + val v : ?created_at:Ptime.t -> ?error:string -> ?failures:int -> ?finished_at:Ptime.t -> ?parent:Jsont.json -> ?payload:RunnerJobPayload.T.t -> ?priority:int -> ?progress:int -> ?runner:Jsont.json -> ?started_at:Ptime.t -> ?state:RunnerJobStateConstant.T.t -> ?type_:RunnerJob.Type.t -> ?updated_at:Ptime.t -> ?uuid:Uuidv4.T.t -> ?private_payload:Jsont.json -> unit -> t 1482 + 1483 + val created_at : t -> Ptime.t option 1484 + 1485 + (** Error message if the job is errored *) 1486 + val error : t -> string option 1487 + 1488 + (** Number of times a remote runner failed to process this job. After too many failures, the job in "error" state *) 1489 + val failures : t -> int option 1490 + 1491 + val finished_at : t -> Ptime.t option 1492 + 1493 + (** If job has a parent job *) 1494 + val parent : t -> Jsont.json option 1495 + 1496 + val payload : t -> RunnerJobPayload.T.t option 1497 + 1498 + (** Job priority (less has more priority) *) 1499 + val priority : t -> int option 1500 + 1501 + (** Percentage progress *) 1502 + val progress : t -> int option 1503 + 1504 + (** If job is associated to a runner *) 1505 + val runner : t -> Jsont.json option 1506 + 1507 + val started_at : t -> Ptime.t option 1508 + 1509 + val state : t -> RunnerJobStateConstant.T.t option 1510 + 1511 + val type_ : t -> RunnerJob.Type.t option 1658 1512 1659 - val v : unit -> t 1513 + val updated_at : t -> Ptime.t option 1514 + 1515 + val uuid : t -> Uuidv4.T.t option 1516 + 1517 + val private_payload : t -> Jsont.json option 1518 + 1519 + val jsont : t Jsont.t 1660 1520 end 1661 1521 end 1662 1522 ··· 1788 1648 @param npm_name name of the plugin/theme on npmjs.com or in its package.json 1789 1649 *) 1790 1650 val get_plugin : npm_name:string -> t -> unit -> T.t 1791 - end 1792 - 1793 - module PlaylistElement : sig 1794 - module T : sig 1795 - type t 1796 - 1797 - (** Construct a value *) 1798 - val v : ?position:int -> ?start_timestamp:int -> ?stop_timestamp:int -> ?video:Jsont.json -> unit -> t 1799 - 1800 - val position : t -> int option 1801 - 1802 - val start_timestamp : t -> int option 1803 - 1804 - val stop_timestamp : t -> int option 1805 - 1806 - val video : t -> Jsont.json option 1807 - 1808 - val jsont : t Jsont.t 1809 - end 1810 1651 end 1811 1652 1812 1653 module PlayerThemeVideoSetting : sig ··· 2051 1892 @param channel channel base information used to create the first channel of the user 2052 1893 @param display_name editable name of the user, displayed in its representations 2053 1894 *) 2054 - val v : email:string -> password:Password.T.t -> username:Jsont.json -> ?channel:Jsont.json -> ?display_name:string -> unit -> t 1895 + val v : email:string -> password:Password.T.t -> username:Username.T.t -> ?channel:Jsont.json -> ?display_name:string -> unit -> t 2055 1896 2056 1897 (** channel base information used to create the first channel of the user *) 2057 1898 val channel : t -> Jsont.json option ··· 2065 1906 val password : t -> Password.T.t 2066 1907 2067 1908 (** immutable name of the user, used to find or mention its actor *) 1909 + val username : t -> Username.T.t 1910 + 1911 + val jsont : t Jsont.t 1912 + end 1913 + end 1914 + 1915 + module OauthTokenPassword : sig 1916 + module T : sig 1917 + type t 1918 + 1919 + (** Construct a value 1920 + @param external_auth_token If you want to authenticate using an external authentication token you got from an auth plugin (like `peertube-plugin-auth-openid-connect` for example) instead of a password or a refresh token, provide it here. 1921 + *) 1922 + val v : client_id:string -> client_secret:string -> grant_type:string -> username:Jsont.json -> ?password:Password.T.t -> ?external_auth_token:string -> unit -> t 1923 + 1924 + val client_id : t -> string 1925 + 1926 + val client_secret : t -> string 1927 + 1928 + val grant_type : t -> string 1929 + 2068 1930 val username : t -> Jsont.json 1931 + 1932 + val password : t -> Password.T.t option 1933 + 1934 + (** If you want to authenticate using an external authentication token you got from an auth plugin (like `peertube-plugin-auth-openid-connect` for example) instead of a password or a refresh token, provide it here. *) 1935 + val external_auth_token : t -> string option 2069 1936 2070 1937 val jsont : t Jsont.t 2071 1938 end ··· 2123 1990 module T : sig 2124 1991 type t 2125 1992 2126 - val jsont : t Jsont.t 1993 + (** Construct a value *) 1994 + val v : client_id:string -> client_secret:string -> grant_type:string -> refresh_token:string -> unit -> t 1995 + 1996 + val client_id : t -> string 1997 + 1998 + val client_secret : t -> string 1999 + 2000 + val grant_type : t -> string 2127 2001 2128 - val v : unit -> t 2129 - end 2130 - end 2131 - 2132 - module OauthTokenPassword : sig 2133 - module T : sig 2134 - type t 2002 + val refresh_token : t -> string 2135 2003 2136 2004 val jsont : t Jsont.t 2137 - 2138 - val v : unit -> t 2139 2005 end 2140 2006 end 2141 2007 ··· 2453 2319 @param latency_mode User can select live latency mode if enabled by the instance 2454 2320 @param permanent_live User can stream multiple times in a permanent live 2455 2321 *) 2456 - val v : ?latency_mode:Jsont.json -> ?permanent_live:bool -> ?replay_settings:LiveVideoReplaySettings.T.t -> ?save_replay:bool -> ?schedules:LiveSchedule.T.t list -> unit -> t 2322 + val v : ?latency_mode:LiveVideoLatencyMode.T.t -> ?permanent_live:bool -> ?replay_settings:LiveVideoReplaySettings.T.t -> ?save_replay:bool -> ?schedules:LiveSchedule.T.t list -> unit -> t 2457 2323 2458 2324 (** User can select live latency mode if enabled by the instance *) 2459 - val latency_mode : t -> Jsont.json option 2325 + val latency_mode : t -> LiveVideoLatencyMode.T.t option 2460 2326 2461 2327 (** User can stream multiple times in a permanent live *) 2462 2328 val permanent_live : t -> bool option ··· 2480 2346 @param rtmps_url Included in the response if an appropriate token is provided 2481 2347 @param stream_key RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided 2482 2348 *) 2483 - val v : ?latency_mode:Jsont.json -> ?permanent_live:bool -> ?replay_settings:LiveVideoReplaySettings.T.t -> ?rtmp_url:string -> ?rtmps_url:string -> ?save_replay:bool -> ?schedules:LiveSchedule.T.t list -> ?stream_key:string -> unit -> t 2349 + val v : ?latency_mode:LiveVideoLatencyMode.T.t -> ?permanent_live:bool -> ?replay_settings:LiveVideoReplaySettings.T.t -> ?rtmp_url:string -> ?rtmps_url:string -> ?save_replay:bool -> ?schedules:LiveSchedule.T.t list -> ?stream_key:string -> unit -> t 2484 2350 2485 2351 (** User can select live latency mode if enabled by the instance *) 2486 - val latency_mode : t -> Jsont.json option 2352 + val latency_mode : t -> LiveVideoLatencyMode.T.t option 2487 2353 2488 2354 (** User can stream multiple times in a permanent live *) 2489 2355 val permanent_live : t -> bool option ··· 2622 2488 end 2623 2489 end 2624 2490 2491 + module VideoBlacklist : sig 2492 + module T : sig 2493 + type t 2494 + 2495 + (** Construct a value *) 2496 + val v : ?created_at:Ptime.t -> ?description:string -> ?dislikes:int -> ?duration:int -> ?id:Id.T.t -> ?likes:int -> ?name:string -> ?nsfw:bool -> ?updated_at:Ptime.t -> ?uuid:Uuidv4.T.t -> ?video_id:Jsont.json -> ?views:int -> unit -> t 2497 + 2498 + val created_at : t -> Ptime.t option 2499 + 2500 + val description : t -> string option 2501 + 2502 + val dislikes : t -> int option 2503 + 2504 + val duration : t -> int option 2505 + 2506 + val id : t -> Id.T.t option 2507 + 2508 + val likes : t -> int option 2509 + 2510 + val name : t -> string option 2511 + 2512 + val nsfw : t -> bool option 2513 + 2514 + val updated_at : t -> Ptime.t option 2515 + 2516 + val uuid : t -> Uuidv4.T.t option 2517 + 2518 + val video_id : t -> Jsont.json option 2519 + 2520 + val views : t -> int option 2521 + 2522 + val jsont : t Jsont.t 2523 + end 2524 + end 2525 + 2526 + module UserRegistration : sig 2527 + module Request : sig 2528 + type t 2529 + 2530 + (** Construct a value 2531 + @param email email of the user, used for login or service communications 2532 + @param username immutable name of the user, used to find or mention its actor 2533 + @param registration_reason reason for the user to register on the instance 2534 + @param channel channel base information used to create the first channel of the user 2535 + @param display_name editable name of the user, displayed in its representations 2536 + *) 2537 + val v : email:string -> password:Password.T.t -> username:Username.T.t -> registration_reason:string -> ?channel:Jsont.json -> ?display_name:string -> unit -> t 2538 + 2539 + (** channel base information used to create the first channel of the user *) 2540 + val channel : t -> Jsont.json option 2541 + 2542 + (** editable name of the user, displayed in its representations *) 2543 + val display_name : t -> string option 2544 + 2545 + (** email of the user, used for login or service communications *) 2546 + val email : t -> string 2547 + 2548 + val password : t -> Password.T.t 2549 + 2550 + (** immutable name of the user, used to find or mention its actor *) 2551 + val username : t -> Username.T.t 2552 + 2553 + (** reason for the user to register on the instance *) 2554 + val registration_reason : t -> string 2555 + 2556 + val jsont : t Jsont.t 2557 + end 2558 + 2559 + module T : sig 2560 + type t 2561 + 2562 + (** Construct a value 2563 + @param user If the registration has been accepted, this is a partial user object created by the registration 2564 + *) 2565 + val v : ?account_display_name:string -> ?channel_display_name:string -> ?channel_handle:string -> ?created_at:Ptime.t -> ?email:string -> ?email_verified:bool -> ?id:Id.T.t -> ?moderation_response:string -> ?registration_reason:string -> ?state:Jsont.json -> ?updated_at:Ptime.t -> ?user:Jsont.json -> ?username:string -> unit -> t 2566 + 2567 + val account_display_name : t -> string option 2568 + 2569 + val channel_display_name : t -> string option 2570 + 2571 + val channel_handle : t -> string option 2572 + 2573 + val created_at : t -> Ptime.t option 2574 + 2575 + val email : t -> string option 2576 + 2577 + val email_verified : t -> bool option 2578 + 2579 + val id : t -> Id.T.t option 2580 + 2581 + val moderation_response : t -> string option 2582 + 2583 + val registration_reason : t -> string option 2584 + 2585 + val state : t -> Jsont.json option 2586 + 2587 + val updated_at : t -> Ptime.t option 2588 + 2589 + (** If the registration has been accepted, this is a partial user object created by the registration *) 2590 + val user : t -> Jsont.json option 2591 + 2592 + val username : t -> string option 2593 + 2594 + val jsont : t Jsont.t 2595 + end 2596 + 2597 + (** Request registration 2598 + 2599 + Signup has to be enabled and require approval on the instance *) 2600 + val request_registration : body:Request.t -> t -> unit -> T.t 2601 + end 2602 + 2603 + module Job : sig 2604 + module T : sig 2605 + type t 2606 + 2607 + (** Construct a value *) 2608 + val v : ?created_at:Ptime.t -> ?data:Jsont.json -> ?error:Jsont.json -> ?finished_on:Ptime.t -> ?id:Id.T.t -> ?processed_on:Ptime.t -> ?state:string -> ?type_:string -> unit -> t 2609 + 2610 + val created_at : t -> Ptime.t option 2611 + 2612 + val data : t -> Jsont.json option 2613 + 2614 + val error : t -> Jsont.json option 2615 + 2616 + val finished_on : t -> Ptime.t option 2617 + 2618 + val id : t -> Id.T.t option 2619 + 2620 + val processed_on : t -> Ptime.t option 2621 + 2622 + val state : t -> string option 2623 + 2624 + val type_ : t -> string option 2625 + 2626 + val jsont : t Jsont.t 2627 + end 2628 + end 2629 + 2630 + module GetMeVideoRating : sig 2631 + module T : sig 2632 + type t 2633 + 2634 + (** Construct a value 2635 + @param rating Rating of the video 2636 + *) 2637 + val v : id:Id.T.t -> rating:string -> unit -> t 2638 + 2639 + val id : t -> Id.T.t 2640 + 2641 + (** Rating of the video *) 2642 + val rating : t -> string 2643 + 2644 + val jsont : t Jsont.t 2645 + end 2646 + 2647 + (** Get rate of my user for a video 2648 + @param video_id The video id 2649 + *) 2650 + val get_api_v1_users_me_videos_rating : video_id:string -> t -> unit -> T.t 2651 + end 2652 + 2653 + module FileRedundancyInformation : sig 2654 + module T : sig 2655 + type t 2656 + 2657 + (** Construct a value *) 2658 + val v : ?created_at:Ptime.t -> ?expires_on:Ptime.t -> ?file_url:string -> ?id:Id.T.t -> ?size:int -> ?strategy:string -> ?updated_at:Ptime.t -> unit -> t 2659 + 2660 + val created_at : t -> Ptime.t option 2661 + 2662 + val expires_on : t -> Ptime.t option 2663 + 2664 + val file_url : t -> string option 2665 + 2666 + val id : t -> Id.T.t option 2667 + 2668 + val size : t -> int option 2669 + 2670 + val strategy : t -> string option 2671 + 2672 + val updated_at : t -> Ptime.t option 2673 + 2674 + val jsont : t Jsont.t 2675 + end 2676 + end 2677 + 2678 + module FileStorage : sig 2679 + module T : sig 2680 + (** The file storage type: 2681 + - `0` File system 2682 + - `1` Object storage 2683 + *) 2684 + type t = string 2685 + 2686 + val jsont : t Jsont.t 2687 + end 2688 + end 2689 + 2690 + module VideoFile : sig 2691 + module T : sig 2692 + type t 2693 + 2694 + (** Construct a value 2695 + @param file_download_url URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) 2696 + @param file_url Direct URL of the video 2697 + @param fps Frames per second of the video file 2698 + @param has_audio **PeerTube >= 6.2** The file container has an audio stream 2699 + @param has_video **PeerTube >= 6.2** The file container has a video stream 2700 + @param height **PeerTube >= 6.1** Video stream height 2701 + @param magnet_uri magnet URI allowing to resolve the video via BitTorrent without a metainfo file 2702 + @param metadata_url URL dereferencing the output of ffprobe on the file 2703 + @param playlist_url Playlist URL of the file if it is owned by a playlist 2704 + @param size Video file size in bytes 2705 + @param torrent_download_url URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) 2706 + @param torrent_url Direct URL of the torrent file 2707 + @param width **PeerTube >= 6.1** Video stream width 2708 + *) 2709 + val v : ?file_download_url:string -> ?file_url:string -> ?fps:float -> ?has_audio:bool -> ?has_video:bool -> ?height:float -> ?id:Id.T.t -> ?magnet_uri:string -> ?metadata_url:string -> ?playlist_url:string -> ?resolution:VideoResolutionConstant.T.t -> ?size:int -> ?storage:FileStorage.T.t -> ?torrent_download_url:string -> ?torrent_url:string -> ?width:float -> unit -> t 2710 + 2711 + (** URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) *) 2712 + val file_download_url : t -> string option 2713 + 2714 + (** Direct URL of the video *) 2715 + val file_url : t -> string option 2716 + 2717 + (** Frames per second of the video file *) 2718 + val fps : t -> float option 2719 + 2720 + (** **PeerTube >= 6.2** The file container has an audio stream *) 2721 + val has_audio : t -> bool option 2722 + 2723 + (** **PeerTube >= 6.2** The file container has a video stream *) 2724 + val has_video : t -> bool option 2725 + 2726 + (** **PeerTube >= 6.1** Video stream height *) 2727 + val height : t -> float option 2728 + 2729 + val id : t -> Id.T.t option 2730 + 2731 + (** magnet URI allowing to resolve the video via BitTorrent without a metainfo file *) 2732 + val magnet_uri : t -> string option 2733 + 2734 + (** URL dereferencing the output of ffprobe on the file *) 2735 + val metadata_url : t -> string option 2736 + 2737 + (** Playlist URL of the file if it is owned by a playlist *) 2738 + val playlist_url : t -> string option 2739 + 2740 + val resolution : t -> VideoResolutionConstant.T.t option 2741 + 2742 + (** Video file size in bytes *) 2743 + val size : t -> int option 2744 + 2745 + val storage : t -> FileStorage.T.t option 2746 + 2747 + (** URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) *) 2748 + val torrent_download_url : t -> string option 2749 + 2750 + (** Direct URL of the torrent file *) 2751 + val torrent_url : t -> string option 2752 + 2753 + (** **PeerTube >= 6.1** Video stream width *) 2754 + val width : t -> float option 2755 + 2756 + val jsont : t Jsont.t 2757 + end 2758 + end 2759 + 2760 + module VideoStreamingPlaylistsHls : sig 2761 + module T : sig 2762 + type t 2763 + 2764 + (** Construct a value 2765 + @param files Video files associated to this playlist. 2766 + 2767 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 2768 + 2769 + *) 2770 + val v : ?files:VideoFile.T.t list -> ?playlist_url:string -> ?redundancies:Jsont.json list -> ?segments_sha256_url:string -> unit -> t 2771 + 2772 + (** Video files associated to this playlist. 2773 + 2774 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 2775 + *) 2776 + val files : t -> VideoFile.T.t list option 2777 + 2778 + val playlist_url : t -> string option 2779 + 2780 + val redundancies : t -> Jsont.json list option 2781 + 2782 + val segments_sha256_url : t -> string option 2783 + 2784 + val jsont : t Jsont.t 2785 + end 2786 + end 2787 + 2788 + module VideoStreamingPlaylists : sig 2789 + module T : sig 2790 + type t 2791 + 2792 + (** Construct a value 2793 + @param type_ Playlist type: 2794 + - `1`: HLS 2795 + 2796 + @param files Video files associated to this playlist. 2797 + 2798 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 2799 + 2800 + *) 2801 + val v : ?id:Id.T.t -> ?type_:int -> ?files:VideoFile.T.t list -> ?playlist_url:string -> ?redundancies:Jsont.json list -> ?segments_sha256_url:string -> unit -> t 2802 + 2803 + val id : t -> Id.T.t option 2804 + 2805 + (** Playlist type: 2806 + - `1`: HLS 2807 + *) 2808 + val type_ : t -> int option 2809 + 2810 + (** Video files associated to this playlist. 2811 + 2812 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 2813 + *) 2814 + val files : t -> VideoFile.T.t list option 2815 + 2816 + val playlist_url : t -> string option 2817 + 2818 + val redundancies : t -> Jsont.json list option 2819 + 2820 + val segments_sha256_url : t -> string option 2821 + 2822 + val jsont : t Jsont.t 2823 + end 2824 + end 2825 + 2826 + module CustomHomepage : sig 2827 + module T : sig 2828 + type t 2829 + 2830 + (** Construct a value *) 2831 + val v : ?content:string -> unit -> t 2832 + 2833 + val content : t -> string option 2834 + 2835 + val jsont : t Jsont.t 2836 + end 2837 + 2838 + (** Get instance custom homepage *) 2839 + val get_api_v1_custom_pages_homepage_instance : t -> unit -> T.t 2840 + end 2841 + 2842 + module CommentAutoTagPolicies : sig 2843 + module T : sig 2844 + type t 2845 + 2846 + (** Construct a value 2847 + @param review Auto tags that automatically set the comment in review state 2848 + *) 2849 + val v : ?review:string list -> unit -> t 2850 + 2851 + (** Auto tags that automatically set the comment in review state *) 2852 + val review : t -> string list option 2853 + 2854 + val jsont : t Jsont.t 2855 + end 2856 + 2857 + (** Get account auto tag policies on comments 2858 + 2859 + **PeerTube >= 6.2** 2860 + @param account_name account name to get auto tag policies 2861 + *) 2862 + val get_api_v1_automatic_tags_policies_accounts_comments : account_name:string -> t -> unit -> T.t 2863 + end 2864 + 2865 + module ChannelActivityList : sig 2866 + module Response : sig 2867 + type t 2868 + 2869 + (** Construct a value *) 2870 + val v : ?data:Jsont.json list -> ?total:int -> unit -> t 2871 + 2872 + val data : t -> Jsont.json list option 2873 + 2874 + val total : t -> int option 2875 + 2876 + val jsont : t Jsont.t 2877 + end 2878 + 2879 + (** List activities of a video channel 2880 + 2881 + **PeerTube >= 8.0** 2882 + @param channel_handle The video channel handle 2883 + @param start Offset used to paginate results 2884 + @param count Number of items to return 2885 + @param sort Sort column 2886 + *) 2887 + val list_video_channel_activities : channel_handle:string -> ?start:string -> ?count:string -> ?sort:string -> t -> unit -> Response.t 2888 + end 2889 + 2890 + module Block : sig 2891 + module Status : sig 2892 + type t 2893 + 2894 + (** Construct a value *) 2895 + val v : ?accounts:Jsont.json -> ?hosts:Jsont.json -> unit -> t 2896 + 2897 + val accounts : t -> Jsont.json option 2898 + 2899 + val hosts : t -> Jsont.json option 2900 + 2901 + val jsont : t Jsont.t 2902 + end 2903 + 2904 + (** Get block status of accounts/hosts 2905 + @param accounts Check if these accounts are blocked 2906 + @param hosts Check if these hosts are blocked 2907 + *) 2908 + val get_api_v1_blocklist_status : ?accounts:string -> ?hosts:string -> t -> unit -> Status.t 2909 + end 2910 + 2911 + module AutomaticTagAvailable : sig 2912 + module T : sig 2913 + type t 2914 + 2915 + (** Construct a value 2916 + @param available Available auto tags that can be used to filter objects or set a comment in review state 2917 + *) 2918 + val v : ?available:Jsont.json list -> unit -> t 2919 + 2920 + (** Available auto tags that can be used to filter objects or set a comment in review state *) 2921 + val available : t -> Jsont.json list option 2922 + 2923 + val jsont : t Jsont.t 2924 + end 2925 + 2926 + (** Get account available auto tags 2927 + 2928 + **PeerTube >= 6.2** 2929 + @param account_name account name to get auto tag policies 2930 + *) 2931 + val get_api_v1_automatic_tags_accounts_available : account_name:string -> t -> unit -> T.t 2932 + 2933 + (** Get server available auto tags 2934 + 2935 + **PeerTube >= 6.2** *) 2936 + val get_api_v1_automatic_tags_server_available : t -> unit -> T.t 2937 + end 2938 + 2939 + module AddVideoPasswords : sig 2940 + module T : sig 2941 + type t 2942 + 2943 + val jsont : t Jsont.t 2944 + 2945 + val v : unit -> t 2946 + end 2947 + end 2948 + 2949 + module VideoUploadRequestResumable : sig 2950 + module T : sig 2951 + type t 2952 + 2953 + (** Construct a value 2954 + @param channel_id Channel id that will contain this video 2955 + @param name Video name 2956 + @param filename Video filename including extension 2957 + @param description Video description 2958 + @param download_enabled Enable or disable downloading for this video 2959 + @param generate_transcription **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video 2960 + @param nsfw Whether or not this video contains sensitive content 2961 + @param nsfw_summary More information about the sensitive content of the video 2962 + @param originally_published_at Date when the content was originally published 2963 + @param support A text tell the audience how to support the video creator 2964 + @param tags Video tags (maximum 5 tags each between 2 and 30 characters) 2965 + @param wait_transcoding Whether or not we wait transcoding before publish the video 2966 + @param thumbnailfile Video thumbnail file 2967 + @param previewfile Video preview file 2968 + *) 2969 + val v : channel_id:int -> name:string -> filename:string -> ?category:VideoCategorySet.T.t -> ?comments_policy:VideoCommentsPolicySet.T.t -> ?description:string -> ?download_enabled:bool -> ?generate_transcription:bool -> ?language:VideoLanguageSet.T.t -> ?licence:VideoLicenceSet.T.t -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:Jsont.json -> ?originally_published_at:Ptime.t -> ?privacy:VideoPrivacySet.T.t -> ?schedule_update:VideoScheduled.Update.t -> ?support:string -> ?tags:string list -> ?video_passwords:AddVideoPasswords.T.t -> ?wait_transcoding:bool -> ?thumbnailfile:string -> ?previewfile:string -> unit -> t 2970 + 2971 + val category : t -> VideoCategorySet.T.t option 2972 + 2973 + (** Channel id that will contain this video *) 2974 + val channel_id : t -> int 2975 + 2976 + val comments_policy : t -> VideoCommentsPolicySet.T.t option 2977 + 2978 + (** Video description *) 2979 + val description : t -> string option 2980 + 2981 + (** Enable or disable downloading for this video *) 2982 + val download_enabled : t -> bool option 2983 + 2984 + (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 2985 + val generate_transcription : t -> bool option 2986 + 2987 + val language : t -> VideoLanguageSet.T.t option 2988 + 2989 + val licence : t -> VideoLicenceSet.T.t option 2990 + 2991 + (** Video name *) 2992 + val name : t -> string 2993 + 2994 + (** Whether or not this video contains sensitive content *) 2995 + val nsfw : t -> bool option 2996 + 2997 + val nsfw_flags : t -> Nsfwflag.T.t option 2998 + 2999 + (** More information about the sensitive content of the video *) 3000 + val nsfw_summary : t -> Jsont.json option 3001 + 3002 + (** Date when the content was originally published *) 3003 + val originally_published_at : t -> Ptime.t option 3004 + 3005 + val privacy : t -> VideoPrivacySet.T.t option 3006 + 3007 + val schedule_update : t -> VideoScheduled.Update.t option 3008 + 3009 + (** A text tell the audience how to support the video creator *) 3010 + val support : t -> string option 3011 + 3012 + (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 3013 + val tags : t -> string list option 3014 + 3015 + val video_passwords : t -> AddVideoPasswords.T.t option 3016 + 3017 + (** Whether or not we wait transcoding before publish the video *) 3018 + val wait_transcoding : t -> bool option 3019 + 3020 + (** Video filename including extension *) 3021 + val filename : t -> string 3022 + 3023 + (** Video thumbnail file *) 3024 + val thumbnailfile : t -> string option 3025 + 3026 + (** Video preview file *) 3027 + val previewfile : t -> string option 3028 + 3029 + val jsont : t Jsont.t 3030 + end 3031 + end 3032 + 3033 + module VideoUploadRequestLegacy : sig 3034 + module T : sig 3035 + type t 3036 + 3037 + (** Construct a value 3038 + @param channel_id Channel id that will contain this video 3039 + @param name Video name 3040 + @param videofile Video file 3041 + @param description Video description 3042 + @param download_enabled Enable or disable downloading for this video 3043 + @param generate_transcription **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video 3044 + @param nsfw Whether or not this video contains sensitive content 3045 + @param nsfw_summary More information about the sensitive content of the video 3046 + @param originally_published_at Date when the content was originally published 3047 + @param previewfile Video preview file 3048 + @param support A text tell the audience how to support the video creator 3049 + @param tags Video tags (maximum 5 tags each between 2 and 30 characters) 3050 + @param thumbnailfile Video thumbnail file 3051 + @param wait_transcoding Whether or not we wait transcoding before publish the video 3052 + *) 3053 + val v : channel_id:int -> name:string -> videofile:string -> ?category:VideoCategorySet.T.t -> ?comments_policy:VideoCommentsPolicySet.T.t -> ?description:string -> ?download_enabled:bool -> ?generate_transcription:bool -> ?language:VideoLanguageSet.T.t -> ?licence:VideoLicenceSet.T.t -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:Jsont.json -> ?originally_published_at:Ptime.t -> ?previewfile:string -> ?privacy:VideoPrivacySet.T.t -> ?schedule_update:VideoScheduled.Update.t -> ?support:string -> ?tags:string list -> ?thumbnailfile:string -> ?video_passwords:AddVideoPasswords.T.t -> ?wait_transcoding:bool -> unit -> t 3054 + 3055 + val category : t -> VideoCategorySet.T.t option 3056 + 3057 + (** Channel id that will contain this video *) 3058 + val channel_id : t -> int 3059 + 3060 + val comments_policy : t -> VideoCommentsPolicySet.T.t option 3061 + 3062 + (** Video description *) 3063 + val description : t -> string option 3064 + 3065 + (** Enable or disable downloading for this video *) 3066 + val download_enabled : t -> bool option 3067 + 3068 + (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 3069 + val generate_transcription : t -> bool option 3070 + 3071 + val language : t -> VideoLanguageSet.T.t option 3072 + 3073 + val licence : t -> VideoLicenceSet.T.t option 3074 + 3075 + (** Video name *) 3076 + val name : t -> string 3077 + 3078 + (** Whether or not this video contains sensitive content *) 3079 + val nsfw : t -> bool option 3080 + 3081 + val nsfw_flags : t -> Nsfwflag.T.t option 3082 + 3083 + (** More information about the sensitive content of the video *) 3084 + val nsfw_summary : t -> Jsont.json option 3085 + 3086 + (** Date when the content was originally published *) 3087 + val originally_published_at : t -> Ptime.t option 3088 + 3089 + (** Video preview file *) 3090 + val previewfile : t -> string option 3091 + 3092 + val privacy : t -> VideoPrivacySet.T.t option 3093 + 3094 + val schedule_update : t -> VideoScheduled.Update.t option 3095 + 3096 + (** A text tell the audience how to support the video creator *) 3097 + val support : t -> string option 3098 + 3099 + (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 3100 + val tags : t -> string list option 3101 + 3102 + (** Video thumbnail file *) 3103 + val thumbnailfile : t -> string option 3104 + 3105 + val video_passwords : t -> AddVideoPasswords.T.t option 3106 + 3107 + (** Whether or not we wait transcoding before publish the video *) 3108 + val wait_transcoding : t -> bool option 3109 + 3110 + (** Video file *) 3111 + val videofile : t -> string 3112 + 3113 + val jsont : t Jsont.t 3114 + end 3115 + end 3116 + 3117 + module VideoUploadRequestCommon : sig 3118 + module T : sig 3119 + type t 3120 + 3121 + (** Construct a value 3122 + @param channel_id Channel id that will contain this video 3123 + @param name Video name 3124 + @param description Video description 3125 + @param download_enabled Enable or disable downloading for this video 3126 + @param generate_transcription **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video 3127 + @param nsfw Whether or not this video contains sensitive content 3128 + @param nsfw_summary More information about the sensitive content of the video 3129 + @param originally_published_at Date when the content was originally published 3130 + @param previewfile Video preview file 3131 + @param support A text tell the audience how to support the video creator 3132 + @param tags Video tags (maximum 5 tags each between 2 and 30 characters) 3133 + @param thumbnailfile Video thumbnail file 3134 + @param wait_transcoding Whether or not we wait transcoding before publish the video 3135 + *) 3136 + val v : channel_id:int -> name:string -> ?category:VideoCategorySet.T.t -> ?comments_policy:VideoCommentsPolicySet.T.t -> ?description:string -> ?download_enabled:bool -> ?generate_transcription:bool -> ?language:VideoLanguageSet.T.t -> ?licence:VideoLicenceSet.T.t -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:Jsont.json -> ?originally_published_at:Ptime.t -> ?previewfile:string -> ?privacy:VideoPrivacySet.T.t -> ?schedule_update:VideoScheduled.Update.t -> ?support:string -> ?tags:string list -> ?thumbnailfile:string -> ?video_passwords:AddVideoPasswords.T.t -> ?wait_transcoding:bool -> unit -> t 3137 + 3138 + val category : t -> VideoCategorySet.T.t option 3139 + 3140 + (** Channel id that will contain this video *) 3141 + val channel_id : t -> int 3142 + 3143 + val comments_policy : t -> VideoCommentsPolicySet.T.t option 3144 + 3145 + (** Video description *) 3146 + val description : t -> string option 3147 + 3148 + (** Enable or disable downloading for this video *) 3149 + val download_enabled : t -> bool option 3150 + 3151 + (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 3152 + val generate_transcription : t -> bool option 3153 + 3154 + val language : t -> VideoLanguageSet.T.t option 3155 + 3156 + val licence : t -> VideoLicenceSet.T.t option 3157 + 3158 + (** Video name *) 3159 + val name : t -> string 3160 + 3161 + (** Whether or not this video contains sensitive content *) 3162 + val nsfw : t -> bool option 3163 + 3164 + val nsfw_flags : t -> Nsfwflag.T.t option 3165 + 3166 + (** More information about the sensitive content of the video *) 3167 + val nsfw_summary : t -> Jsont.json option 3168 + 3169 + (** Date when the content was originally published *) 3170 + val originally_published_at : t -> Ptime.t option 3171 + 3172 + (** Video preview file *) 3173 + val previewfile : t -> string option 3174 + 3175 + val privacy : t -> VideoPrivacySet.T.t option 3176 + 3177 + val schedule_update : t -> VideoScheduled.Update.t option 3178 + 3179 + (** A text tell the audience how to support the video creator *) 3180 + val support : t -> string option 3181 + 3182 + (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 3183 + val tags : t -> string list option 3184 + 3185 + (** Video thumbnail file *) 3186 + val thumbnailfile : t -> string option 3187 + 3188 + val video_passwords : t -> AddVideoPasswords.T.t option 3189 + 3190 + (** Whether or not we wait transcoding before publish the video *) 3191 + val wait_transcoding : t -> bool option 3192 + 3193 + val jsont : t Jsont.t 3194 + end 3195 + end 3196 + 3197 + module VideoCreateImport : sig 3198 + module T : sig 3199 + type t 3200 + 3201 + (** Construct a value 3202 + @param channel_id Channel id that will contain this video 3203 + @param name Video name 3204 + @param description Video description 3205 + @param download_enabled Enable or disable downloading for this video 3206 + @param generate_transcription **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video 3207 + @param nsfw Whether or not this video contains sensitive content 3208 + @param nsfw_summary More information about the sensitive content of the video 3209 + @param originally_published_at Date when the content was originally published 3210 + @param previewfile Video preview file 3211 + @param support A text tell the audience how to support the video creator 3212 + @param tags Video tags (maximum 5 tags each between 2 and 30 characters) 3213 + @param thumbnailfile Video thumbnail file 3214 + @param wait_transcoding Whether or not we wait transcoding before publish the video 3215 + *) 3216 + val v : channel_id:int -> name:string -> ?category:VideoCategorySet.T.t -> ?comments_policy:VideoCommentsPolicySet.T.t -> ?description:string -> ?download_enabled:bool -> ?generate_transcription:bool -> ?language:VideoLanguageSet.T.t -> ?licence:VideoLicenceSet.T.t -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:Jsont.json -> ?originally_published_at:Ptime.t -> ?previewfile:string -> ?privacy:VideoPrivacySet.T.t -> ?schedule_update:VideoScheduled.Update.t -> ?support:string -> ?tags:string list -> ?thumbnailfile:string -> ?video_passwords:AddVideoPasswords.T.t -> ?wait_transcoding:bool -> unit -> t 3217 + 3218 + val category : t -> VideoCategorySet.T.t option 3219 + 3220 + (** Channel id that will contain this video *) 3221 + val channel_id : t -> int 3222 + 3223 + val comments_policy : t -> VideoCommentsPolicySet.T.t option 3224 + 3225 + (** Video description *) 3226 + val description : t -> string option 3227 + 3228 + (** Enable or disable downloading for this video *) 3229 + val download_enabled : t -> bool option 3230 + 3231 + (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 3232 + val generate_transcription : t -> bool option 3233 + 3234 + val language : t -> VideoLanguageSet.T.t option 3235 + 3236 + val licence : t -> VideoLicenceSet.T.t option 3237 + 3238 + (** Video name *) 3239 + val name : t -> string 3240 + 3241 + (** Whether or not this video contains sensitive content *) 3242 + val nsfw : t -> bool option 3243 + 3244 + val nsfw_flags : t -> Nsfwflag.T.t option 3245 + 3246 + (** More information about the sensitive content of the video *) 3247 + val nsfw_summary : t -> Jsont.json option 3248 + 3249 + (** Date when the content was originally published *) 3250 + val originally_published_at : t -> Ptime.t option 3251 + 3252 + (** Video preview file *) 3253 + val previewfile : t -> string option 3254 + 3255 + val privacy : t -> VideoPrivacySet.T.t option 3256 + 3257 + val schedule_update : t -> VideoScheduled.Update.t option 3258 + 3259 + (** A text tell the audience how to support the video creator *) 3260 + val support : t -> string option 3261 + 3262 + (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 3263 + val tags : t -> string list option 3264 + 3265 + (** Video thumbnail file *) 3266 + val thumbnailfile : t -> string option 3267 + 3268 + val video_passwords : t -> AddVideoPasswords.T.t option 3269 + 3270 + (** Whether or not we wait transcoding before publish the video *) 3271 + val wait_transcoding : t -> bool option 3272 + 3273 + val jsont : t Jsont.t 3274 + end 3275 + end 3276 + 3277 + module ActorImage : sig 3278 + module T : sig 3279 + type t 3280 + 3281 + (** Construct a value 3282 + @param file_url **PeerTube >= 7.1** 3283 + @param height **PeerTube >= 7.3** 3284 + @param path Deprecated in PeerTube v8.0, use fileUrl instead 3285 + *) 3286 + val v : ?created_at:Ptime.t -> ?file_url:string -> ?height:int -> ?path:string -> ?updated_at:Ptime.t -> ?width:int -> unit -> t 3287 + 3288 + val created_at : t -> Ptime.t option 3289 + 3290 + (** **PeerTube >= 7.1** *) 3291 + val file_url : t -> string option 3292 + 3293 + (** **PeerTube >= 7.3** *) 3294 + val height : t -> int option 3295 + 3296 + (** Deprecated in PeerTube v8.0, use fileUrl instead *) 3297 + val path : t -> string option 3298 + 3299 + val updated_at : t -> Ptime.t option 3300 + 3301 + val width : t -> int option 3302 + 3303 + val jsont : t Jsont.t 3304 + end 3305 + end 3306 + 3307 + module VideoChannelSummary : sig 3308 + module T : sig 3309 + type t 3310 + 3311 + (** Construct a value *) 3312 + val v : ?avatars:ActorImage.T.t list -> ?display_name:string -> ?host:string -> ?id:Id.T.t -> ?name:string -> ?url:string -> unit -> t 3313 + 3314 + val avatars : t -> ActorImage.T.t list option 3315 + 3316 + val display_name : t -> string option 3317 + 3318 + val host : t -> string option 3319 + 3320 + val id : t -> Id.T.t option 3321 + 3322 + val name : t -> string option 3323 + 3324 + val url : t -> string option 3325 + 3326 + val jsont : t Jsont.t 3327 + end 3328 + end 3329 + 3330 + module Actor : sig 3331 + module Info : sig 3332 + type t 3333 + 3334 + (** Construct a value *) 3335 + val v : ?avatars:ActorImage.T.t list -> ?display_name:string -> ?host:string -> ?id:Id.T.t -> ?name:string -> unit -> t 3336 + 3337 + val avatars : t -> ActorImage.T.t list option 3338 + 3339 + val display_name : t -> string option 3340 + 3341 + val host : t -> string option 3342 + 3343 + val id : t -> Id.T.t option 3344 + 3345 + val name : t -> string option 3346 + 3347 + val jsont : t Jsont.t 3348 + end 3349 + 3350 + module T : sig 3351 + type t 3352 + 3353 + (** Construct a value 3354 + @param followers_count number of followers of this actor, as seen by this instance 3355 + @param following_count number of actors subscribed to by this actor, as seen by this instance 3356 + @param host server on which the actor is resident 3357 + @param host_redundancy_allowed whether this actor's host allows redundancy of its videos 3358 + @param name immutable name of the actor, used to find or mention it 3359 + *) 3360 + val v : ?avatars:ActorImage.T.t list -> ?created_at:Ptime.t -> ?followers_count:int -> ?following_count:int -> ?host:string -> ?host_redundancy_allowed:bool -> ?id:Id.T.t -> ?name:Username.T.t -> ?updated_at:Ptime.t -> ?url:string -> unit -> t 3361 + 3362 + val avatars : t -> ActorImage.T.t list option 3363 + 3364 + val created_at : t -> Ptime.t option 3365 + 3366 + (** number of followers of this actor, as seen by this instance *) 3367 + val followers_count : t -> int option 3368 + 3369 + (** number of actors subscribed to by this actor, as seen by this instance *) 3370 + val following_count : t -> int option 3371 + 3372 + (** server on which the actor is resident *) 3373 + val host : t -> string option 3374 + 3375 + (** whether this actor's host allows redundancy of its videos *) 3376 + val host_redundancy_allowed : t -> bool option 3377 + 3378 + val id : t -> Id.T.t option 3379 + 3380 + (** immutable name of the actor, used to find or mention it *) 3381 + val name : t -> Username.T.t option 3382 + 3383 + val updated_at : t -> Ptime.t option 3384 + 3385 + val url : t -> string option 3386 + 3387 + val jsont : t Jsont.t 3388 + end 3389 + end 3390 + 3391 + module Follow : sig 3392 + module T : sig 3393 + type t 3394 + 3395 + (** Construct a value 3396 + @param score score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. 3397 + *) 3398 + val v : ?created_at:Ptime.t -> ?follower:Actor.T.t -> ?following:Actor.T.t -> ?id:Id.T.t -> ?score:float -> ?state:string -> ?updated_at:Ptime.t -> unit -> t 3399 + 3400 + val created_at : t -> Ptime.t option 3401 + 3402 + val follower : t -> Actor.T.t option 3403 + 3404 + val following : t -> Actor.T.t option 3405 + 3406 + val id : t -> Id.T.t option 3407 + 3408 + (** score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. *) 3409 + val score : t -> float option 3410 + 3411 + val state : t -> string option 3412 + 3413 + val updated_at : t -> Ptime.t option 3414 + 3415 + val jsont : t Jsont.t 3416 + end 3417 + end 3418 + 3419 + module AccountSummary : sig 3420 + module T : sig 3421 + type t 3422 + 3423 + (** Construct a value *) 3424 + val v : ?avatars:ActorImage.T.t list -> ?display_name:string -> ?host:string -> ?id:int -> ?name:string -> ?url:string -> unit -> t 3425 + 3426 + val avatars : t -> ActorImage.T.t list option 3427 + 3428 + val display_name : t -> string option 3429 + 3430 + val host : t -> string option 3431 + 3432 + val id : t -> int option 3433 + 3434 + val name : t -> string option 3435 + 3436 + val url : t -> string option 3437 + 3438 + val jsont : t Jsont.t 3439 + end 3440 + end 3441 + 3442 + module VideoPlaylist : sig 3443 + module T : sig 3444 + type t 3445 + 3446 + (** Construct a value 3447 + @param video_channel_position Position of the playlist in the channel 3448 + *) 3449 + val v : ?created_at:Ptime.t -> ?description:string -> ?display_name:string -> ?id:Id.T.t -> ?is_local:bool -> ?owner_account:AccountSummary.T.t -> ?privacy:VideoPlaylistPrivacyConstant.T.t -> ?short_uuid:ShortUuid.T.t -> ?thumbnail_path:string -> ?type_:VideoPlaylistTypeConstant.T.t -> ?updated_at:Ptime.t -> ?uuid:Uuidv4.T.t -> ?video_channel:VideoChannelSummary.T.t -> ?video_channel_position:int -> ?video_length:int -> unit -> t 3450 + 3451 + val created_at : t -> Ptime.t option 3452 + 3453 + val description : t -> string option 3454 + 3455 + val display_name : t -> string option 3456 + 3457 + val id : t -> Id.T.t option 3458 + 3459 + val is_local : t -> bool option 3460 + 3461 + val owner_account : t -> AccountSummary.T.t option 3462 + 3463 + val privacy : t -> VideoPlaylistPrivacyConstant.T.t option 3464 + 3465 + val short_uuid : t -> ShortUuid.T.t option 3466 + 3467 + val thumbnail_path : t -> string option 3468 + 3469 + val type_ : t -> VideoPlaylistTypeConstant.T.t option 3470 + 3471 + val updated_at : t -> Ptime.t option 3472 + 3473 + val uuid : t -> Uuidv4.T.t option 3474 + 3475 + val video_channel : t -> VideoChannelSummary.T.t option 3476 + 3477 + (** Position of the playlist in the channel *) 3478 + val video_channel_position : t -> int option 3479 + 3480 + val video_length : t -> int option 3481 + 3482 + val jsont : t Jsont.t 3483 + end 3484 + 3485 + (** Get a video playlist 3486 + @param playlist_id Playlist id 3487 + *) 3488 + val get_api_v1_video_playlists : playlist_id:string -> t -> unit -> T.t 3489 + end 3490 + 3491 + module VideoChannelCollaborator : sig 3492 + module T : sig 3493 + (** Representation of a channel collaboration *) 3494 + type t 3495 + 3496 + (** Construct a value *) 3497 + val v : ?account:AccountSummary.T.t -> ?created_at:Ptime.t -> ?id:Id.T.t -> ?state:Jsont.json -> ?updated_at:Ptime.t -> unit -> t 3498 + 3499 + val account : t -> AccountSummary.T.t option 3500 + 3501 + val created_at : t -> Ptime.t option 3502 + 3503 + val id : t -> Id.T.t option 3504 + 3505 + val state : t -> Jsont.json option 3506 + 3507 + val updated_at : t -> Ptime.t option 3508 + 3509 + val jsont : t Jsont.t 3510 + end 3511 + end 3512 + 3513 + module Video : sig 3514 + module Info : sig 3515 + type t 3516 + 3517 + (** Construct a value *) 3518 + val v : ?id:Jsont.json -> ?name:Jsont.json -> ?state:Jsont.json -> ?uuid:Jsont.json -> unit -> t 3519 + 3520 + val id : t -> Jsont.json option 3521 + 3522 + val name : t -> Jsont.json option 3523 + 3524 + val state : t -> Jsont.json option 3525 + 3526 + val uuid : t -> Jsont.json option 3527 + 3528 + val jsont : t Jsont.t 3529 + end 3530 + 3531 + module T : sig 3532 + type t 3533 + 3534 + (** Construct a value 3535 + @param aspect_ratio **PeerTube >= 6.1** Aspect ratio of the video stream 3536 + @param category category in which the video is classified 3537 + @param comments **PeerTube >= 7.2** Number of comments on the video 3538 + @param created_at time at which the video object was first drafted 3539 + @param duration duration of the video in seconds 3540 + @param id object id for the video 3541 + @param language main language used in the video 3542 + @param licence licence under which the video is distributed 3543 + @param name title of the video 3544 + @param nsfw_summary **PeerTube >= 7.2** More information about the sensitive content of the video 3545 + @param originally_published_at used to represent a date of first publication, prior to the practical publication date of `publishedAt` 3546 + @param privacy privacy policy used to distribute the video 3547 + @param published_at time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. 3548 + @param state represents the internal state of the video processing within the PeerTube instance 3549 + @param truncated_description truncated description of the video, written in Markdown. 3550 + 3551 + @param updated_at last time the video's metadata was modified 3552 + @param uuid universal identifier for the video, that can be used across instances 3553 + *) 3554 + val v : ?account:AccountSummary.T.t -> ?aspect_ratio:float -> ?blacklisted:bool -> ?blacklisted_reason:string -> ?category:VideoConstantNumberCategory.T.t -> ?channel:VideoChannelSummary.T.t -> ?comments:int -> ?created_at:Ptime.t -> ?dislikes:int -> ?duration:int -> ?embed_path:string -> ?id:Id.T.t -> ?is_live:bool -> ?is_local:bool -> ?language:VideoConstantStringLanguage.T.t -> ?licence:VideoConstantNumberLicence.T.t -> ?likes:int -> ?live_schedules:LiveSchedule.T.t list -> ?name:string -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:string -> ?originally_published_at:Ptime.t -> ?preview_path:string -> ?privacy:VideoPrivacyConstant.T.t -> ?published_at:Ptime.t -> ?scheduled_update:VideoScheduled.Update.t -> ?short_uuid:ShortUuid.T.t -> ?state:VideoStateConstant.T.t -> ?thumbnail_path:string -> ?truncated_description:string -> ?updated_at:Ptime.t -> ?user_history:Jsont.json -> ?uuid:Uuidv4.T.t -> ?views:int -> ?wait_transcoding:bool -> unit -> t 3555 + 3556 + val account : t -> AccountSummary.T.t option 3557 + 3558 + (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 3559 + val aspect_ratio : t -> float option 3560 + 3561 + val blacklisted : t -> bool option 3562 + 3563 + val blacklisted_reason : t -> string option 3564 + 3565 + (** category in which the video is classified *) 3566 + val category : t -> VideoConstantNumberCategory.T.t option 3567 + 3568 + val channel : t -> VideoChannelSummary.T.t option 3569 + 3570 + (** **PeerTube >= 7.2** Number of comments on the video *) 3571 + val comments : t -> int option 3572 + 3573 + (** time at which the video object was first drafted *) 3574 + val created_at : t -> Ptime.t option 3575 + 3576 + val dislikes : t -> int option 3577 + 3578 + (** duration of the video in seconds *) 3579 + val duration : t -> int option 3580 + 3581 + val embed_path : t -> string option 3582 + 3583 + (** object id for the video *) 3584 + val id : t -> Id.T.t option 3585 + 3586 + val is_live : t -> bool option 3587 + 3588 + val is_local : t -> bool option 3589 + 3590 + (** main language used in the video *) 3591 + val language : t -> VideoConstantStringLanguage.T.t option 3592 + 3593 + (** licence under which the video is distributed *) 3594 + val licence : t -> VideoConstantNumberLicence.T.t option 3595 + 3596 + val likes : t -> int option 3597 + 3598 + val live_schedules : t -> LiveSchedule.T.t list option 3599 + 3600 + (** title of the video *) 3601 + val name : t -> string option 3602 + 3603 + val nsfw : t -> bool option 3604 + 3605 + val nsfw_flags : t -> Nsfwflag.T.t option 3606 + 3607 + (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 3608 + val nsfw_summary : t -> string option 3609 + 3610 + (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 3611 + val originally_published_at : t -> Ptime.t option 3612 + 3613 + val preview_path : t -> string option 3614 + 3615 + (** privacy policy used to distribute the video *) 3616 + val privacy : t -> VideoPrivacyConstant.T.t option 3617 + 3618 + (** time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. *) 3619 + val published_at : t -> Ptime.t option 3620 + 3621 + val scheduled_update : t -> VideoScheduled.Update.t option 3622 + 3623 + val short_uuid : t -> ShortUuid.T.t option 3624 + 3625 + (** represents the internal state of the video processing within the PeerTube instance *) 3626 + val state : t -> VideoStateConstant.T.t option 3627 + 3628 + val thumbnail_path : t -> string option 3629 + 3630 + (** truncated description of the video, written in Markdown. 3631 + *) 3632 + val truncated_description : t -> string option 3633 + 3634 + (** last time the video's metadata was modified *) 3635 + val updated_at : t -> Ptime.t option 3636 + 3637 + val user_history : t -> Jsont.json option 3638 + 3639 + (** universal identifier for the video, that can be used across instances *) 3640 + val uuid : t -> Uuidv4.T.t option 3641 + 3642 + val views : t -> int option 3643 + 3644 + val wait_transcoding : t -> bool option 3645 + 3646 + val jsont : t Jsont.t 3647 + end 3648 + end 3649 + 3650 + module VideoRating : sig 3651 + module T : sig 3652 + type t 3653 + 3654 + (** Construct a value 3655 + @param rating Rating of the video 3656 + *) 3657 + val v : rating:string -> video:Video.T.t -> unit -> t 3658 + 3659 + (** Rating of the video *) 3660 + val rating : t -> string 3661 + 3662 + val video : t -> Video.T.t 3663 + 3664 + val jsont : t Jsont.t 3665 + end 3666 + 3667 + (** List ratings of an account 3668 + @param name The username or handle of the account 3669 + @param start Offset used to paginate results 3670 + @param count Number of items to return 3671 + @param sort Sort column 3672 + @param rating Optionally filter which ratings to retrieve 3673 + *) 3674 + val get_api_v1_accounts_ratings : name:string -> ?start:string -> ?count:string -> ?sort:string -> ?rating:string -> t -> unit -> T.t 3675 + end 3676 + 3677 + module VideoList : sig 3678 + module Response : sig 3679 + type t 3680 + 3681 + (** Construct a value *) 3682 + val v : ?data:Video.T.t list -> ?total:int -> unit -> t 3683 + 3684 + val data : t -> Video.T.t list option 3685 + 3686 + val total : t -> int option 3687 + 3688 + val jsont : t Jsont.t 3689 + end 3690 + 3691 + (** List videos of an account 3692 + @param name The username or handle of the account 3693 + @param start Offset used to paginate results 3694 + @param count Number of items to return 3695 + @param skip_count if you don't need the `total` in the response 3696 + @param nsfw whether to include nsfw videos, if any 3697 + @param is_live whether or not the video is a live 3698 + @param include_scheduled_live whether or not include live that are scheduled for later 3699 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 3700 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 3701 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 3702 + @param tags_one_of tag(s) of the video 3703 + @param tags_all_of tag(s) of the video, where all should be present in the video 3704 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 3705 + @param include_ **Only administrators and moderators can use this parameter** 3706 + 3707 + Include additional videos in results (can be combined using bitwise or operator) 3708 + - `0` NONE 3709 + - `1` NOT_PUBLISHED_STATE 3710 + - `2` BLACKLISTED 3711 + - `4` BLOCKED_OWNER 3712 + - `8` FILES 3713 + - `16` CAPTIONS 3714 + - `32` VIDEO SOURCE 3715 + 3716 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 3717 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 3718 + @param host Find elements owned by this host 3719 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 3720 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 3721 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 3722 + @param search Plain text search, applied to various parts of the model depending on endpoint 3723 + *) 3724 + val get_account_videos : name:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 3725 + 3726 + (** Search videos 3727 + @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it. 3728 + 3729 + @param uuids Find elements with specific UUIDs 3730 + @param search_target If the administrator enabled search index support, you can override the default search target. 3731 + 3732 + **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information: 3733 + * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), 3734 + then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. 3735 + After that, you can use the classic REST API endpoints to fetch the complete object or interact with it 3736 + * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch 3737 + the data from the origin instance API 3738 + 3739 + @param start Offset used to paginate results 3740 + @param count Number of items to return 3741 + @param skip_count if you don't need the `total` in the response 3742 + @param nsfw whether to include nsfw videos, if any 3743 + @param is_live whether or not the video is a live 3744 + @param include_scheduled_live whether or not include live that are scheduled for later 3745 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 3746 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 3747 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 3748 + @param tags_one_of tag(s) of the video 3749 + @param tags_all_of tag(s) of the video, where all should be present in the video 3750 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 3751 + @param include_ **Only administrators and moderators can use this parameter** 3752 + 3753 + Include additional videos in results (can be combined using bitwise or operator) 3754 + - `0` NONE 3755 + - `1` NOT_PUBLISHED_STATE 3756 + - `2` BLACKLISTED 3757 + - `4` BLOCKED_OWNER 3758 + - `8` FILES 3759 + - `16` CAPTIONS 3760 + - `32` VIDEO SOURCE 3761 + 3762 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 3763 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 3764 + @param host Find elements owned by this host 3765 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 3766 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 3767 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 3768 + @param start_date Get videos that are published after this date 3769 + @param end_date Get videos that are published before this date 3770 + @param originally_published_start_date Get videos that are originally published after this date 3771 + @param originally_published_end_date Get videos that are originally published before this date 3772 + @param duration_min Get videos that have this minimum duration 3773 + @param duration_max Get videos that have this maximum duration 3774 + *) 3775 + val search_videos : search:string -> ?uuids:string -> ?search_target:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?start_date:string -> ?end_date:string -> ?originally_published_start_date:string -> ?originally_published_end_date:string -> ?duration_min:string -> ?duration_max:string -> t -> unit -> Response.t 3776 + 3777 + (** List watched videos history 3778 + @param start Offset used to paginate results 3779 + @param count Number of items to return 3780 + @param search Plain text search, applied to various parts of the model depending on endpoint 3781 + *) 3782 + val get_api_v1_users_me_history_videos : ?start:string -> ?count:string -> ?search:string -> t -> unit -> Response.t 3783 + 3784 + (** List videos of subscriptions of my user 3785 + @param start Offset used to paginate results 3786 + @param count Number of items to return 3787 + @param skip_count if you don't need the `total` in the response 3788 + @param nsfw whether to include nsfw videos, if any 3789 + @param is_live whether or not the video is a live 3790 + @param include_scheduled_live whether or not include live that are scheduled for later 3791 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 3792 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 3793 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 3794 + @param tags_one_of tag(s) of the video 3795 + @param tags_all_of tag(s) of the video, where all should be present in the video 3796 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 3797 + @param include_ **Only administrators and moderators can use this parameter** 3798 + 3799 + Include additional videos in results (can be combined using bitwise or operator) 3800 + - `0` NONE 3801 + - `1` NOT_PUBLISHED_STATE 3802 + - `2` BLACKLISTED 3803 + - `4` BLOCKED_OWNER 3804 + - `8` FILES 3805 + - `16` CAPTIONS 3806 + - `32` VIDEO SOURCE 3807 + 3808 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 3809 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 3810 + @param host Find elements owned by this host 3811 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 3812 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 3813 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 3814 + @param search Plain text search, applied to various parts of the model depending on endpoint 3815 + *) 3816 + val get_api_v1_users_me_subscriptions_videos : ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 3817 + 3818 + (** List videos of my user 3819 + @param channel_name_one_of **PeerTube >= 7.2** Filter on videos that are published by a channel with one of these names 3820 + @param start Offset used to paginate results 3821 + @param count Number of items to return 3822 + @param skip_count if you don't need the `total` in the response 3823 + @param nsfw whether to include nsfw videos, if any 3824 + @param is_live whether or not the video is a live 3825 + @param include_scheduled_live whether or not include live that are scheduled for later 3826 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 3827 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 3828 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 3829 + @param tags_one_of tag(s) of the video 3830 + @param tags_all_of tag(s) of the video, where all should be present in the video 3831 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 3832 + @param include_ **Only administrators and moderators can use this parameter** 3833 + 3834 + Include additional videos in results (can be combined using bitwise or operator) 3835 + - `0` NONE 3836 + - `1` NOT_PUBLISHED_STATE 3837 + - `2` BLACKLISTED 3838 + - `4` BLOCKED_OWNER 3839 + - `8` FILES 3840 + - `16` CAPTIONS 3841 + - `32` VIDEO SOURCE 3842 + 3843 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 3844 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 3845 + @param host Find elements owned by this host 3846 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 3847 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 3848 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 3849 + @param search Plain text search, applied to various parts of the model depending on endpoint 3850 + @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 3851 + *) 3852 + val get_api_v1_users_me_videos : ?channel_name_one_of:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> ?include_collaborations:string -> t -> unit -> Response.t 3853 + 3854 + (** List videos of a video channel 3855 + @param channel_handle The video channel handle 3856 + @param start Offset used to paginate results 3857 + @param count Number of items to return 3858 + @param skip_count if you don't need the `total` in the response 3859 + @param nsfw whether to include nsfw videos, if any 3860 + @param is_live whether or not the video is a live 3861 + @param include_scheduled_live whether or not include live that are scheduled for later 3862 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 3863 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 3864 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 3865 + @param tags_one_of tag(s) of the video 3866 + @param tags_all_of tag(s) of the video, where all should be present in the video 3867 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 3868 + @param include_ **Only administrators and moderators can use this parameter** 3869 + 3870 + Include additional videos in results (can be combined using bitwise or operator) 3871 + - `0` NONE 3872 + - `1` NOT_PUBLISHED_STATE 3873 + - `2` BLACKLISTED 3874 + - `4` BLOCKED_OWNER 3875 + - `8` FILES 3876 + - `16` CAPTIONS 3877 + - `32` VIDEO SOURCE 3878 + 3879 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 3880 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 3881 + @param host Find elements owned by this host 3882 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 3883 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 3884 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 3885 + @param search Plain text search, applied to various parts of the model depending on endpoint 3886 + *) 3887 + val get_video_channel_videos : channel_handle:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 3888 + 3889 + (** List videos 3890 + @param start Offset used to paginate results 3891 + @param count Number of items to return 3892 + @param skip_count if you don't need the `total` in the response 3893 + @param nsfw whether to include nsfw videos, if any 3894 + @param is_live whether or not the video is a live 3895 + @param include_scheduled_live whether or not include live that are scheduled for later 3896 + @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 3897 + @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 3898 + @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 3899 + @param tags_one_of tag(s) of the video 3900 + @param tags_all_of tag(s) of the video, where all should be present in the video 3901 + @param is_local **PeerTube >= 4.0** Display only local or remote objects 3902 + @param include_ **Only administrators and moderators can use this parameter** 3903 + 3904 + Include additional videos in results (can be combined using bitwise or operator) 3905 + - `0` NONE 3906 + - `1` NOT_PUBLISHED_STATE 3907 + - `2` BLACKLISTED 3908 + - `4` BLOCKED_OWNER 3909 + - `8` FILES 3910 + - `16` CAPTIONS 3911 + - `32` VIDEO SOURCE 3912 + 3913 + @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 3914 + @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 3915 + @param host Find elements owned by this host 3916 + @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 3917 + @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 3918 + @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 3919 + @param search Plain text search, applied to various parts of the model depending on endpoint 3920 + *) 3921 + val get_videos : ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 3922 + end 3923 + 2625 3924 module VideoImport : sig 2626 3925 module T : sig 2627 3926 type t ··· 2631 3930 @param target_url remote URL where to find the import's source video 2632 3931 @param torrentfile Torrent file containing only the video file 2633 3932 *) 2634 - val v : ?created_at:Ptime.t -> ?error:string -> ?id:Id.T.t -> ?magnet_uri:string -> ?state:Jsont.json -> ?target_url:string -> ?torrent_name:string -> ?torrentfile:string -> ?updated_at:Ptime.t -> ?video:Jsont.json -> unit -> t 3933 + val v : ?created_at:Ptime.t -> ?error:string -> ?id:Id.T.t -> ?magnet_uri:string -> ?state:VideoImportStateConstant.T.t -> ?target_url:string -> ?torrent_name:string -> ?torrentfile:string -> ?updated_at:Ptime.t -> ?video:Video.T.t -> unit -> t 2635 3934 2636 3935 val created_at : t -> Ptime.t option 2637 3936 ··· 2642 3941 (** magnet URI allowing to resolve the import's source video *) 2643 3942 val magnet_uri : t -> string option 2644 3943 2645 - val state : t -> Jsont.json option 3944 + val state : t -> VideoImportStateConstant.T.t option 2646 3945 2647 3946 (** remote URL where to find the import's source video *) 2648 3947 val target_url : t -> string option ··· 2654 3953 2655 3954 val updated_at : t -> Ptime.t option 2656 3955 2657 - val video : t -> Jsont.json option 3956 + val video : t -> Video.T.t option 2658 3957 2659 3958 val jsont : t Jsont.t 2660 3959 end ··· 2688 3987 val get_api_v1_users_me_videos_imports : id:string -> ?start:string -> ?count:string -> ?sort:string -> ?include_collaborations:string -> ?video_id:string -> ?target_url:string -> ?video_channel_sync_id:string -> ?search:string -> t -> unit -> T.t 2689 3988 end 2690 3989 3990 + module VideoCommentForOwnerOrAdmin : sig 3991 + module T : sig 3992 + type t 3993 + 3994 + (** Construct a value *) 3995 + val v : ?account:Jsont.json -> ?automatic_tags:string list -> ?created_at:Jsont.json -> ?held_for_review:Jsont.json -> ?id:Id.T.t -> ?in_reply_to_comment_id:Jsont.json -> ?text:Jsont.json -> ?thread_id:Jsont.json -> ?updated_at:Jsont.json -> ?url:Jsont.json -> ?video:Video.Info.t -> unit -> t 3996 + 3997 + val account : t -> Jsont.json option 3998 + 3999 + val automatic_tags : t -> string list option 4000 + 4001 + val created_at : t -> Jsont.json option 4002 + 4003 + val held_for_review : t -> Jsont.json option 4004 + 4005 + val id : t -> Id.T.t option 4006 + 4007 + val in_reply_to_comment_id : t -> Jsont.json option 4008 + 4009 + val text : t -> Jsont.json option 4010 + 4011 + val thread_id : t -> Jsont.json option 4012 + 4013 + val updated_at : t -> Jsont.json option 4014 + 4015 + val url : t -> Jsont.json option 4016 + 4017 + val video : t -> Video.Info.t option 4018 + 4019 + val jsont : t Jsont.t 4020 + end 4021 + end 4022 + 4023 + module PlaylistElement : sig 4024 + module T : sig 4025 + type t 4026 + 4027 + (** Construct a value *) 4028 + val v : ?position:int -> ?start_timestamp:int -> ?stop_timestamp:int -> ?video:Video.T.t -> unit -> t 4029 + 4030 + val position : t -> int option 4031 + 4032 + val start_timestamp : t -> int option 4033 + 4034 + val stop_timestamp : t -> int option 4035 + 4036 + val video : t -> Video.T.t option 4037 + 4038 + val jsont : t Jsont.t 4039 + end 4040 + end 4041 + 4042 + module Notification : sig 4043 + module Type : sig 4044 + (** Notification type. One of the following values: 4045 + 4046 + - `1` NEW_VIDEO_FROM_SUBSCRIPTION 4047 + 4048 + - `2` NEW_COMMENT_ON_MY_VIDEO 4049 + 4050 + - `3` NEW_ABUSE_FOR_MODERATORS 4051 + 4052 + - `4` BLACKLIST_ON_MY_VIDEO 4053 + 4054 + - `5` UNBLACKLIST_ON_MY_VIDEO 4055 + 4056 + - `6` MY_VIDEO_PUBLISHED 4057 + 4058 + - `7` MY_VIDEO_IMPORT_SUCCESS 4059 + 4060 + - `8` MY_VIDEO_IMPORT_ERROR 4061 + 4062 + - `9` NEW_USER_REGISTRATION 4063 + 4064 + - `10` NEW_FOLLOW 4065 + 4066 + - `11` COMMENT_MENTION 4067 + 4068 + - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS 4069 + 4070 + - `13` NEW_INSTANCE_FOLLOWER 4071 + 4072 + - `14` AUTO_INSTANCE_FOLLOWING 4073 + 4074 + - `15` ABUSE_STATE_CHANGE 4075 + 4076 + - `16` ABUSE_NEW_MESSAGE 4077 + 4078 + - `17` NEW_PLUGIN_VERSION 4079 + 4080 + - `18` NEW_PEERTUBE_VERSION 4081 + 4082 + - `19` MY_VIDEO_STUDIO_EDITION_FINISHED 4083 + 4084 + - `20` NEW_USER_REGISTRATION_REQUEST 4085 + 4086 + - `21` NEW_LIVE_FROM_SUBSCRIPTION 4087 + 4088 + - `22` MY_VIDEO_TRANSCRIPTION_GENERATED 4089 + *) 4090 + type t = string 4091 + 4092 + val jsont : t Jsont.t 4093 + end 4094 + 4095 + module T : sig 4096 + type t 4097 + 4098 + (** Construct a value *) 4099 + val v : ?account:Actor.Info.t -> ?actor_follow:Jsont.json -> ?comment:Jsont.json -> ?created_at:Ptime.t -> ?id:Id.T.t -> ?read:bool -> ?type_:Type.t -> ?updated_at:Ptime.t -> ?video:Video.Info.t -> ?video_abuse:Jsont.json -> ?video_blacklist:Jsont.json -> ?video_import:Jsont.json -> unit -> t 4100 + 4101 + val account : t -> Actor.Info.t option 4102 + 4103 + val actor_follow : t -> Jsont.json option 4104 + 4105 + val comment : t -> Jsont.json option 4106 + 4107 + val created_at : t -> Ptime.t option 4108 + 4109 + val id : t -> Id.T.t option 4110 + 4111 + val read : t -> bool option 4112 + 4113 + val type_ : t -> Type.t option 4114 + 4115 + val updated_at : t -> Ptime.t option 4116 + 4117 + val video : t -> Video.Info.t option 4118 + 4119 + val video_abuse : t -> Jsont.json option 4120 + 4121 + val video_blacklist : t -> Jsont.json option 4122 + 4123 + val video_import : t -> Jsont.json option 4124 + 4125 + val jsont : t Jsont.t 4126 + end 4127 + end 4128 + 4129 + module NotificationList : sig 4130 + module Response : sig 4131 + type t 4132 + 4133 + (** Construct a value *) 4134 + val v : ?data:Notification.T.t list -> ?total:int -> unit -> t 4135 + 4136 + val data : t -> Notification.T.t list option 4137 + 4138 + val total : t -> int option 4139 + 4140 + val jsont : t Jsont.t 4141 + end 4142 + 4143 + (** List my notifications 4144 + @param type_one_of only list notifications of these types 4145 + @param unread only list unread notifications 4146 + @param start Offset used to paginate results 4147 + @param count Number of items to return 4148 + @param sort Sort column 4149 + *) 4150 + val get_api_v1_users_me_notifications : ?type_one_of:string -> ?unread:string -> ?start:string -> ?count:string -> ?sort:string -> t -> unit -> Response.t 4151 + end 4152 + 4153 + module AbuseMessage : sig 4154 + module T : sig 4155 + type t 4156 + 4157 + (** Construct a value *) 4158 + val v : ?account:AccountSummary.T.t -> ?by_moderator:bool -> ?created_at:Ptime.t -> ?id:Id.T.t -> ?message:string -> unit -> t 4159 + 4160 + val account : t -> AccountSummary.T.t option 4161 + 4162 + val by_moderator : t -> bool option 4163 + 4164 + val created_at : t -> Ptime.t option 4165 + 4166 + val id : t -> Id.T.t option 4167 + 4168 + val message : t -> string option 4169 + 4170 + val jsont : t Jsont.t 4171 + end 4172 + end 4173 + 4174 + module Account : sig 4175 + module T : sig 4176 + type t 4177 + 4178 + (** Construct a value 4179 + @param followers_count number of followers of this actor, as seen by this instance 4180 + @param following_count number of actors subscribed to by this actor, as seen by this instance 4181 + @param host server on which the actor is resident 4182 + @param host_redundancy_allowed whether this actor's host allows redundancy of its videos 4183 + @param name immutable name of the actor, used to find or mention it 4184 + @param user_id object id for the user tied to this account 4185 + @param display_name editable name of the account, displayed in its representations 4186 + @param description text or bio displayed on the account's profile 4187 + *) 4188 + val v : ?avatars:ActorImage.T.t list -> ?created_at:Ptime.t -> ?followers_count:int -> ?following_count:int -> ?host:string -> ?host_redundancy_allowed:bool -> ?id:Id.T.t -> ?name:Username.T.t -> ?updated_at:Ptime.t -> ?url:string -> ?user_id:Jsont.json -> ?display_name:string -> ?description:string -> unit -> t 4189 + 4190 + val avatars : t -> ActorImage.T.t list option 4191 + 4192 + val created_at : t -> Ptime.t option 4193 + 4194 + (** number of followers of this actor, as seen by this instance *) 4195 + val followers_count : t -> int option 4196 + 4197 + (** number of actors subscribed to by this actor, as seen by this instance *) 4198 + val following_count : t -> int option 4199 + 4200 + (** server on which the actor is resident *) 4201 + val host : t -> string option 4202 + 4203 + (** whether this actor's host allows redundancy of its videos *) 4204 + val host_redundancy_allowed : t -> bool option 4205 + 4206 + val id : t -> Id.T.t option 4207 + 4208 + (** immutable name of the actor, used to find or mention it *) 4209 + val name : t -> Username.T.t option 4210 + 4211 + val updated_at : t -> Ptime.t option 4212 + 4213 + val url : t -> string option 4214 + 4215 + (** object id for the user tied to this account *) 4216 + val user_id : t -> Jsont.json option 4217 + 4218 + (** editable name of the account, displayed in its representations *) 4219 + val display_name : t -> string option 4220 + 4221 + (** text or bio displayed on the account's profile *) 4222 + val description : t -> string option 4223 + 4224 + val jsont : t Jsont.t 4225 + end 4226 + 4227 + (** Get an account 4228 + @param name The username or handle of the account 4229 + *) 4230 + val get_account : name:string -> t -> unit -> T.t 4231 + end 4232 + 4233 + module VideoComment : sig 4234 + module T : sig 4235 + type t 4236 + 4237 + (** Construct a value 4238 + @param text Text of the comment 4239 + *) 4240 + val v : ?account:Account.T.t -> ?created_at:Ptime.t -> ?deleted_at:Ptime.t -> ?held_for_review:bool -> ?id:Id.T.t -> ?in_reply_to_comment_id:Id.T.t -> ?is_deleted:bool -> ?text:string -> ?thread_id:Id.T.t -> ?total_replies:int -> ?total_replies_from_video_author:int -> ?updated_at:Ptime.t -> ?url:string -> ?video_id:Jsont.json -> unit -> t 4241 + 4242 + val account : t -> Account.T.t option 4243 + 4244 + val created_at : t -> Ptime.t option 4245 + 4246 + val deleted_at : t -> Ptime.t option 4247 + 4248 + val held_for_review : t -> bool option 4249 + 4250 + val id : t -> Id.T.t option 4251 + 4252 + val in_reply_to_comment_id : t -> Id.T.t option 4253 + 4254 + val is_deleted : t -> bool option 4255 + 4256 + (** Text of the comment *) 4257 + val text : t -> string option 4258 + 4259 + val thread_id : t -> Id.T.t option 4260 + 4261 + val total_replies : t -> int option 4262 + 4263 + val total_replies_from_video_author : t -> int option 4264 + 4265 + val updated_at : t -> Ptime.t option 4266 + 4267 + val url : t -> string option 4268 + 4269 + val video_id : t -> Jsont.json option 4270 + 4271 + val jsont : t Jsont.t 4272 + end 4273 + end 4274 + 4275 + module VideoCommentThreadTree : sig 4276 + module T : sig 4277 + type t 4278 + 4279 + (** Construct a value *) 4280 + val v : ?children:Jsont.json list -> ?comment:VideoComment.T.t -> unit -> t 4281 + 4282 + val children : t -> Jsont.json list option 4283 + 4284 + val comment : t -> VideoComment.T.t option 4285 + 4286 + val jsont : t Jsont.t 4287 + end 4288 + 4289 + (** Get a thread 4290 + @param id The object id, uuid or short uuid 4291 + @param thread_id The thread id (root comment id) 4292 + *) 4293 + val get_api_v1_videos_comment_threads : id:string -> thread_id:string -> t -> unit -> T.t 4294 + end 4295 + 4296 + module CommentThreadPost : sig 4297 + module Response : sig 4298 + type t 4299 + 4300 + (** Construct a value *) 4301 + val v : ?comment:VideoComment.T.t -> unit -> t 4302 + 4303 + val comment : t -> VideoComment.T.t option 4304 + 4305 + val jsont : t Jsont.t 4306 + end 4307 + 4308 + (** Create a thread 4309 + @param id The object id, uuid or short uuid 4310 + *) 4311 + val post_api_v1_videos_comment_threads : id:string -> t -> unit -> Response.t 4312 + 4313 + (** Reply to a thread of a video 4314 + @param id The object id, uuid or short uuid 4315 + @param comment_id The comment id 4316 + *) 4317 + val post_api_v1_videos_comments : id:string -> comment_id:string -> t -> unit -> Response.t 4318 + end 4319 + 4320 + module CommentThread : sig 4321 + module Response : sig 4322 + type t 4323 + 4324 + (** Construct a value 4325 + @param total Total threads (included deleted ones) on this video 4326 + @param total_not_deleted_comments Total not-deleted threads (included deleted ones) on this video 4327 + *) 4328 + val v : ?data:VideoComment.T.t list -> ?total:int -> ?total_not_deleted_comments:int -> unit -> t 4329 + 4330 + val data : t -> VideoComment.T.t list option 4331 + 4332 + (** Total threads (included deleted ones) on this video *) 4333 + val total : t -> int option 4334 + 4335 + (** Total not-deleted threads (included deleted ones) on this video *) 4336 + val total_not_deleted_comments : t -> int option 4337 + 4338 + val jsont : t Jsont.t 4339 + end 4340 + 4341 + (** List threads of a video 4342 + @param id The object id, uuid or short uuid 4343 + @param start Offset used to paginate results 4344 + @param count Number of items to return 4345 + @param sort Sort comments by criteria 4346 + *) 4347 + val get_api_v1_videos_comment_threads : id:string -> ?start:string -> ?count:string -> ?sort:string -> t -> unit -> Response.t 4348 + end 4349 + 4350 + module VideoChannel : sig 4351 + module Update : sig 4352 + type t 4353 + 4354 + (** Construct a value 4355 + @param description Channel description 4356 + @param display_name Channel display name 4357 + @param support How to support/fund the channel 4358 + @param bulk_videos_support_update Update the support field for all videos of this channel 4359 + *) 4360 + val v : ?description:Jsont.json -> ?display_name:Jsont.json -> ?support:Jsont.json -> ?bulk_videos_support_update:bool -> unit -> t 4361 + 4362 + (** Channel description *) 4363 + val description : t -> Jsont.json option 4364 + 4365 + (** Channel display name *) 4366 + val display_name : t -> Jsont.json option 4367 + 4368 + (** How to support/fund the channel *) 4369 + val support : t -> Jsont.json option 4370 + 4371 + (** Update the support field for all videos of this channel *) 4372 + val bulk_videos_support_update : t -> bool option 4373 + 4374 + val jsont : t Jsont.t 4375 + end 4376 + 4377 + module Create : sig 4378 + type t 4379 + 4380 + (** Construct a value 4381 + @param display_name Channel display name 4382 + @param name username of the channel to create 4383 + @param description Channel description 4384 + @param support How to support/fund the channel 4385 + *) 4386 + val v : display_name:Jsont.json -> name:UsernameChannel.T.t -> ?description:Jsont.json -> ?support:Jsont.json -> unit -> t 4387 + 4388 + (** Channel description *) 4389 + val description : t -> Jsont.json option 4390 + 4391 + (** Channel display name *) 4392 + val display_name : t -> Jsont.json 4393 + 4394 + (** How to support/fund the channel *) 4395 + val support : t -> Jsont.json option 4396 + 4397 + (** username of the channel to create *) 4398 + val name : t -> UsernameChannel.T.t 4399 + 4400 + val jsont : t Jsont.t 4401 + end 4402 + 4403 + module T : sig 4404 + type t 4405 + 4406 + (** Construct a value 4407 + @param followers_count number of followers of this actor, as seen by this instance 4408 + @param following_count number of actors subscribed to by this actor, as seen by this instance 4409 + @param host server on which the actor is resident 4410 + @param host_redundancy_allowed whether this actor's host allows redundancy of its videos 4411 + @param name immutable name of the actor, used to find or mention it 4412 + @param display_name editable name of the channel, displayed in its representations 4413 + @param support text shown by default on all videos of this channel, to tell the audience how to support it 4414 + *) 4415 + val v : ?avatars:ActorImage.T.t list -> ?created_at:Ptime.t -> ?followers_count:int -> ?following_count:int -> ?host:string -> ?host_redundancy_allowed:bool -> ?id:Id.T.t -> ?name:Username.T.t -> ?url:string -> ?display_name:string -> ?description:string -> ?support:string -> ?is_local:bool -> ?updated_at:Ptime.t -> ?banners:ActorImage.T.t list -> ?owner_account:Account.T.t -> unit -> t 4416 + 4417 + val avatars : t -> ActorImage.T.t list option 4418 + 4419 + val created_at : t -> Ptime.t option 4420 + 4421 + (** number of followers of this actor, as seen by this instance *) 4422 + val followers_count : t -> int option 4423 + 4424 + (** number of actors subscribed to by this actor, as seen by this instance *) 4425 + val following_count : t -> int option 4426 + 4427 + (** server on which the actor is resident *) 4428 + val host : t -> string option 4429 + 4430 + (** whether this actor's host allows redundancy of its videos *) 4431 + val host_redundancy_allowed : t -> bool option 4432 + 4433 + val id : t -> Id.T.t option 4434 + 4435 + (** immutable name of the actor, used to find or mention it *) 4436 + val name : t -> Username.T.t option 4437 + 4438 + val url : t -> string option 4439 + 4440 + (** editable name of the channel, displayed in its representations *) 4441 + val display_name : t -> string option 4442 + 4443 + val description : t -> string option 4444 + 4445 + (** text shown by default on all videos of this channel, to tell the audience how to support it *) 4446 + val support : t -> string option 4447 + 4448 + val is_local : t -> bool option 4449 + 4450 + val updated_at : t -> Ptime.t option 4451 + 4452 + val banners : t -> ActorImage.T.t list option 4453 + 4454 + val owner_account : t -> Account.T.t option 4455 + 4456 + val jsont : t Jsont.t 4457 + end 4458 + 4459 + (** Get subscription of my user 4460 + @param subscription_handle The subscription handle 4461 + *) 4462 + val get_api_v1_users_me_subscriptions : subscription_handle:string -> t -> unit -> T.t 4463 + 4464 + (** Get a video channel 4465 + @param channel_handle The video channel handle 4466 + *) 4467 + val get_video_channel : channel_handle:string -> t -> unit -> T.t 4468 + end 4469 + 4470 + module VideoDetails : sig 4471 + module T : sig 4472 + type t 4473 + 4474 + (** Construct a value 4475 + @param aspect_ratio **PeerTube >= 6.1** Aspect ratio of the video stream 4476 + @param category category in which the video is classified 4477 + @param comments **PeerTube >= 7.2** Number of comments on the video 4478 + @param created_at time at which the video object was first drafted 4479 + @param duration duration of the video in seconds 4480 + @param id object id for the video 4481 + @param language main language used in the video 4482 + @param licence licence under which the video is distributed 4483 + @param name title of the video 4484 + @param nsfw_summary **PeerTube >= 7.2** More information about the sensitive content of the video 4485 + @param originally_published_at used to represent a date of first publication, prior to the practical publication date of `publishedAt` 4486 + @param privacy privacy policy used to distribute the video 4487 + @param published_at time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. 4488 + @param state represents the internal state of the video processing within the PeerTube instance 4489 + @param truncated_description truncated description of the video, written in Markdown. 4490 + 4491 + @param updated_at last time the video's metadata was modified 4492 + @param uuid universal identifier for the video, that can be used across instances 4493 + @param viewers If the video is a live, you have the amount of current viewers 4494 + @param description full description of the video, written in Markdown. 4495 + 4496 + @param support A text tell the audience how to support the video creator 4497 + @param input_file_updated_at Latest input file update. Null if the file has never been replaced since the original upload 4498 + @param files Web compatible video files. If Web Video is disabled on the server: 4499 + 4500 + - field will be empty 4501 + - video files will be found in `streamingPlaylists[].files` field 4502 + 4503 + @param streaming_playlists HLS playlists/manifest files. If HLS is disabled on the server: 4504 + 4505 + - field will be empty 4506 + - video files will be found in `files` field 4507 + 4508 + *) 4509 + val v : ?aspect_ratio:float -> ?blacklisted:bool -> ?blacklisted_reason:string -> ?category:VideoConstantNumberCategory.T.t -> ?comments:int -> ?created_at:Ptime.t -> ?dislikes:int -> ?duration:int -> ?embed_path:string -> ?id:Id.T.t -> ?is_live:bool -> ?is_local:bool -> ?language:VideoConstantStringLanguage.T.t -> ?licence:VideoConstantNumberLicence.T.t -> ?likes:int -> ?live_schedules:LiveSchedule.T.t list -> ?name:string -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:string -> ?originally_published_at:Ptime.t -> ?preview_path:string -> ?privacy:VideoPrivacyConstant.T.t -> ?published_at:Ptime.t -> ?scheduled_update:VideoScheduled.Update.t -> ?short_uuid:ShortUuid.T.t -> ?state:VideoStateConstant.T.t -> ?thumbnail_path:string -> ?truncated_description:string -> ?updated_at:Ptime.t -> ?user_history:Jsont.json -> ?uuid:Uuidv4.T.t -> ?views:int -> ?wait_transcoding:bool -> ?viewers:int -> ?description:string -> ?support:string -> ?channel:VideoChannel.T.t -> ?account:Account.T.t -> ?tags:string list -> ?comments_policy:VideoCommentsPolicyConstant.T.t -> ?download_enabled:bool -> ?input_file_updated_at:Ptime.t -> ?tracker_urls:string list -> ?files:VideoFile.T.t list -> ?streaming_playlists:VideoStreamingPlaylists.T.t list -> unit -> t 4510 + 4511 + (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 4512 + val aspect_ratio : t -> float option 4513 + 4514 + val blacklisted : t -> bool option 4515 + 4516 + val blacklisted_reason : t -> string option 4517 + 4518 + (** category in which the video is classified *) 4519 + val category : t -> VideoConstantNumberCategory.T.t option 4520 + 4521 + (** **PeerTube >= 7.2** Number of comments on the video *) 4522 + val comments : t -> int option 4523 + 4524 + (** time at which the video object was first drafted *) 4525 + val created_at : t -> Ptime.t option 4526 + 4527 + val dislikes : t -> int option 4528 + 4529 + (** duration of the video in seconds *) 4530 + val duration : t -> int option 4531 + 4532 + val embed_path : t -> string option 4533 + 4534 + (** object id for the video *) 4535 + val id : t -> Id.T.t option 4536 + 4537 + val is_live : t -> bool option 4538 + 4539 + val is_local : t -> bool option 4540 + 4541 + (** main language used in the video *) 4542 + val language : t -> VideoConstantStringLanguage.T.t option 4543 + 4544 + (** licence under which the video is distributed *) 4545 + val licence : t -> VideoConstantNumberLicence.T.t option 4546 + 4547 + val likes : t -> int option 4548 + 4549 + val live_schedules : t -> LiveSchedule.T.t list option 4550 + 4551 + (** title of the video *) 4552 + val name : t -> string option 4553 + 4554 + val nsfw : t -> bool option 4555 + 4556 + val nsfw_flags : t -> Nsfwflag.T.t option 4557 + 4558 + (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 4559 + val nsfw_summary : t -> string option 4560 + 4561 + (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 4562 + val originally_published_at : t -> Ptime.t option 4563 + 4564 + val preview_path : t -> string option 4565 + 4566 + (** privacy policy used to distribute the video *) 4567 + val privacy : t -> VideoPrivacyConstant.T.t option 4568 + 4569 + (** time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. *) 4570 + val published_at : t -> Ptime.t option 4571 + 4572 + val scheduled_update : t -> VideoScheduled.Update.t option 4573 + 4574 + val short_uuid : t -> ShortUuid.T.t option 4575 + 4576 + (** represents the internal state of the video processing within the PeerTube instance *) 4577 + val state : t -> VideoStateConstant.T.t option 4578 + 4579 + val thumbnail_path : t -> string option 4580 + 4581 + (** truncated description of the video, written in Markdown. 4582 + *) 4583 + val truncated_description : t -> string option 4584 + 4585 + (** last time the video's metadata was modified *) 4586 + val updated_at : t -> Ptime.t option 4587 + 4588 + val user_history : t -> Jsont.json option 4589 + 4590 + (** universal identifier for the video, that can be used across instances *) 4591 + val uuid : t -> Uuidv4.T.t option 4592 + 4593 + val views : t -> int option 4594 + 4595 + val wait_transcoding : t -> bool option 4596 + 4597 + (** If the video is a live, you have the amount of current viewers *) 4598 + val viewers : t -> int option 4599 + 4600 + (** full description of the video, written in Markdown. 4601 + *) 4602 + val description : t -> string option 4603 + 4604 + (** A text tell the audience how to support the video creator *) 4605 + val support : t -> string option 4606 + 4607 + val channel : t -> VideoChannel.T.t option 4608 + 4609 + val account : t -> Account.T.t option 4610 + 4611 + val tags : t -> string list option 4612 + 4613 + val comments_policy : t -> VideoCommentsPolicyConstant.T.t option 4614 + 4615 + val download_enabled : t -> bool option 4616 + 4617 + (** Latest input file update. Null if the file has never been replaced since the original upload *) 4618 + val input_file_updated_at : t -> Ptime.t option 4619 + 4620 + val tracker_urls : t -> string list option 4621 + 4622 + (** Web compatible video files. If Web Video is disabled on the server: 4623 + 4624 + - field will be empty 4625 + - video files will be found in `streamingPlaylists[].files` field 4626 + *) 4627 + val files : t -> VideoFile.T.t list option 4628 + 4629 + (** HLS playlists/manifest files. If HLS is disabled on the server: 4630 + 4631 + - field will be empty 4632 + - video files will be found in `files` field 4633 + *) 4634 + val streaming_playlists : t -> VideoStreamingPlaylists.T.t list option 4635 + 4636 + val jsont : t Jsont.t 4637 + end 4638 + 4639 + (** Get a video 4640 + @param id The object id, uuid or short uuid 4641 + *) 4642 + val get_video : id:string -> t -> unit -> T.t 4643 + end 4644 + 2691 4645 module VideoChannelSync : sig 2692 4646 module Create : sig 2693 4647 type t ··· 2722 4676 2723 4677 val jsont : t Jsont.t 2724 4678 end 4679 + end 4680 + 4681 + module VideoChannelSyncList : sig 4682 + module T : sig 4683 + type t 4684 + 4685 + (** Construct a value *) 4686 + val v : ?data:VideoChannelSync.T.t list -> ?total:int -> unit -> t 4687 + 4688 + val data : t -> VideoChannelSync.T.t list option 4689 + 4690 + val total : t -> int option 4691 + 4692 + val jsont : t Jsont.t 4693 + end 4694 + 4695 + (** List the synchronizations of video channels of an account 4696 + @param name The username or handle of the account 4697 + @param start Offset used to paginate results 4698 + @param count Number of items to return 4699 + @param sort Sort column 4700 + @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 4701 + *) 4702 + val get_api_v1_accounts_video_channel_syncs : name:string -> ?start:string -> ?count:string -> ?sort:string -> ?include_collaborations:string -> t -> unit -> T.t 2725 4703 end 2726 4704 2727 4705 module Client : sig ··· 3914 5892 val get_static_web_videos : filename:string -> t -> unit -> Jsont.json 3915 5893 end 3916 5894 3917 - module VideoBlacklist : sig 3918 - module T : sig 3919 - type t 3920 - 3921 - (** Construct a value *) 3922 - val v : ?created_at:Ptime.t -> ?description:string -> ?dislikes:int -> ?duration:int -> ?id:Id.T.t -> ?likes:int -> ?name:string -> ?nsfw:bool -> ?updated_at:Ptime.t -> ?uuid:Uuidv4.T.t -> ?video_id:Jsont.json -> ?views:int -> unit -> t 3923 - 3924 - val created_at : t -> Ptime.t option 3925 - 3926 - val description : t -> string option 3927 - 3928 - val dislikes : t -> int option 3929 - 3930 - val duration : t -> int option 3931 - 3932 - val id : t -> Id.T.t option 3933 - 3934 - val likes : t -> int option 3935 - 3936 - val name : t -> string option 3937 - 3938 - val nsfw : t -> bool option 3939 - 3940 - val updated_at : t -> Ptime.t option 3941 - 3942 - val uuid : t -> Uuidv4.T.t option 3943 - 3944 - val video_id : t -> Jsont.json option 3945 - 3946 - val views : t -> int option 3947 - 3948 - val jsont : t Jsont.t 3949 - end 3950 - end 3951 - 3952 - module UserRegistration : sig 3953 - module Request : sig 3954 - type t 3955 - 3956 - val jsont : t Jsont.t 3957 - 3958 - val v : unit -> t 3959 - end 3960 - 3961 - module T : sig 3962 - type t 3963 - 3964 - (** Construct a value 3965 - @param user If the registration has been accepted, this is a partial user object created by the registration 3966 - *) 3967 - val v : ?account_display_name:string -> ?channel_display_name:string -> ?channel_handle:string -> ?created_at:Ptime.t -> ?email:string -> ?email_verified:bool -> ?id:Id.T.t -> ?moderation_response:string -> ?registration_reason:string -> ?state:Jsont.json -> ?updated_at:Ptime.t -> ?user:Jsont.json -> ?username:string -> unit -> t 3968 - 3969 - val account_display_name : t -> string option 3970 - 3971 - val channel_display_name : t -> string option 3972 - 3973 - val channel_handle : t -> string option 3974 - 3975 - val created_at : t -> Ptime.t option 3976 - 3977 - val email : t -> string option 3978 - 3979 - val email_verified : t -> bool option 3980 - 3981 - val id : t -> Id.T.t option 3982 - 3983 - val moderation_response : t -> string option 3984 - 3985 - val registration_reason : t -> string option 3986 - 3987 - val state : t -> Jsont.json option 3988 - 3989 - val updated_at : t -> Ptime.t option 3990 - 3991 - (** If the registration has been accepted, this is a partial user object created by the registration *) 3992 - val user : t -> Jsont.json option 3993 - 3994 - val username : t -> string option 3995 - 3996 - val jsont : t Jsont.t 3997 - end 3998 - 3999 - (** Request registration 4000 - 4001 - Signup has to be enabled and require approval on the instance *) 4002 - val request_registration : body:Request.t -> t -> unit -> T.t 4003 - end 4004 - 4005 - module Notification : sig 4006 - module Type : sig 4007 - (** Notification type. One of the following values: 4008 - 4009 - - `1` NEW_VIDEO_FROM_SUBSCRIPTION 4010 - 4011 - - `2` NEW_COMMENT_ON_MY_VIDEO 4012 - 4013 - - `3` NEW_ABUSE_FOR_MODERATORS 4014 - 4015 - - `4` BLACKLIST_ON_MY_VIDEO 4016 - 4017 - - `5` UNBLACKLIST_ON_MY_VIDEO 4018 - 4019 - - `6` MY_VIDEO_PUBLISHED 4020 - 4021 - - `7` MY_VIDEO_IMPORT_SUCCESS 4022 - 4023 - - `8` MY_VIDEO_IMPORT_ERROR 4024 - 4025 - - `9` NEW_USER_REGISTRATION 4026 - 4027 - - `10` NEW_FOLLOW 4028 - 4029 - - `11` COMMENT_MENTION 4030 - 4031 - - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS 4032 - 4033 - - `13` NEW_INSTANCE_FOLLOWER 4034 - 4035 - - `14` AUTO_INSTANCE_FOLLOWING 4036 - 4037 - - `15` ABUSE_STATE_CHANGE 4038 - 4039 - - `16` ABUSE_NEW_MESSAGE 4040 - 4041 - - `17` NEW_PLUGIN_VERSION 4042 - 4043 - - `18` NEW_PEERTUBE_VERSION 4044 - 4045 - - `19` MY_VIDEO_STUDIO_EDITION_FINISHED 4046 - 4047 - - `20` NEW_USER_REGISTRATION_REQUEST 4048 - 4049 - - `21` NEW_LIVE_FROM_SUBSCRIPTION 4050 - 4051 - - `22` MY_VIDEO_TRANSCRIPTION_GENERATED 4052 - *) 4053 - type t = string 4054 - 4055 - val jsont : t Jsont.t 4056 - end 4057 - 5895 + module VideoChannelList : sig 4058 5896 module T : sig 4059 5897 type t 4060 5898 4061 5899 (** Construct a value *) 4062 - val v : ?account:Jsont.json -> ?actor_follow:Jsont.json -> ?comment:Jsont.json -> ?created_at:Ptime.t -> ?id:Id.T.t -> ?read:bool -> ?type_:Type.t -> ?updated_at:Ptime.t -> ?video:Jsont.json -> ?video_abuse:Jsont.json -> ?video_blacklist:Jsont.json -> ?video_import:Jsont.json -> unit -> t 4063 - 4064 - val account : t -> Jsont.json option 4065 - 4066 - val actor_follow : t -> Jsont.json option 4067 - 4068 - val comment : t -> Jsont.json option 4069 - 4070 - val created_at : t -> Ptime.t option 4071 - 4072 - val id : t -> Id.T.t option 4073 - 4074 - val read : t -> bool option 4075 - 4076 - val type_ : t -> Type.t option 4077 - 4078 - val updated_at : t -> Ptime.t option 4079 - 4080 - val video : t -> Jsont.json option 4081 - 4082 - val video_abuse : t -> Jsont.json option 4083 - 4084 - val video_blacklist : t -> Jsont.json option 5900 + val v : ?data:VideoChannel.T.t list -> ?total:int -> unit -> t 4085 5901 4086 - val video_import : t -> Jsont.json option 4087 - 4088 - val jsont : t Jsont.t 4089 - end 4090 - end 4091 - 4092 - module NotificationList : sig 4093 - module Response : sig 4094 - type t 4095 - 4096 - (** Construct a value *) 4097 - val v : ?data:Notification.T.t list -> ?total:int -> unit -> t 4098 - 4099 - val data : t -> Notification.T.t list option 5902 + val data : t -> VideoChannel.T.t list option 4100 5903 4101 5904 val total : t -> int option 4102 5905 4103 5906 val jsont : t Jsont.t 4104 5907 end 4105 5908 4106 - (** List my notifications 4107 - @param type_one_of only list notifications of these types 4108 - @param unread only list unread notifications 5909 + (** List video channels of an account 5910 + @param name The username or handle of the account 5911 + @param with_stats include daily view statistics for the last 30 days and total views (only if authenticated as the account user) 4109 5912 @param start Offset used to paginate results 4110 5913 @param count Number of items to return 5914 + @param search Plain text search, applied to various parts of the model depending on endpoint 4111 5915 @param sort Sort column 5916 + @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 4112 5917 *) 4113 - val get_api_v1_users_me_notifications : ?type_one_of:string -> ?unread:string -> ?start:string -> ?count:string -> ?sort:string -> t -> unit -> Response.t 4114 - end 4115 - 4116 - module Job : sig 4117 - module T : sig 4118 - type t 4119 - 4120 - (** Construct a value *) 4121 - val v : ?created_at:Ptime.t -> ?data:Jsont.json -> ?error:Jsont.json -> ?finished_on:Ptime.t -> ?id:Id.T.t -> ?processed_on:Ptime.t -> ?state:string -> ?type_:string -> unit -> t 4122 - 4123 - val created_at : t -> Ptime.t option 4124 - 4125 - val data : t -> Jsont.json option 4126 - 4127 - val error : t -> Jsont.json option 4128 - 4129 - val finished_on : t -> Ptime.t option 4130 - 4131 - val id : t -> Id.T.t option 4132 - 4133 - val processed_on : t -> Ptime.t option 4134 - 4135 - val state : t -> string option 4136 - 4137 - val type_ : t -> string option 4138 - 4139 - val jsont : t Jsont.t 4140 - end 4141 - end 4142 - 4143 - module GetMeVideoRating : sig 4144 - module T : sig 4145 - type t 4146 - 4147 - (** Construct a value 4148 - @param rating Rating of the video 4149 - *) 4150 - val v : id:Id.T.t -> rating:string -> unit -> t 4151 - 4152 - val id : t -> Id.T.t 4153 - 4154 - (** Rating of the video *) 4155 - val rating : t -> string 4156 - 4157 - val jsont : t Jsont.t 4158 - end 5918 + val get_api_v1_accounts_video_channels : name:string -> ?with_stats:string -> ?start:string -> ?count:string -> ?search:string -> ?sort:string -> ?include_collaborations:string -> t -> unit -> T.t 4159 5919 4160 - (** Get rate of my user for a video 4161 - @param video_id The video id 4162 - *) 4163 - val get_api_v1_users_me_videos_rating : video_id:string -> t -> unit -> T.t 4164 - end 4165 - 4166 - module FileRedundancyInformation : sig 4167 - module T : sig 4168 - type t 4169 - 4170 - (** Construct a value *) 4171 - val v : ?created_at:Ptime.t -> ?expires_on:Ptime.t -> ?file_url:string -> ?id:Id.T.t -> ?size:int -> ?strategy:string -> ?updated_at:Ptime.t -> unit -> t 4172 - 4173 - val created_at : t -> Ptime.t option 4174 - 4175 - val expires_on : t -> Ptime.t option 4176 - 4177 - val file_url : t -> string option 4178 - 4179 - val id : t -> Id.T.t option 4180 - 4181 - val size : t -> int option 4182 - 4183 - val strategy : t -> string option 4184 - 4185 - val updated_at : t -> Ptime.t option 4186 - 4187 - val jsont : t Jsont.t 4188 - end 4189 - end 4190 - 4191 - module FileStorage : sig 4192 - module T : sig 4193 - (** The file storage type: 4194 - - `0` File system 4195 - - `1` Object storage 4196 - *) 4197 - type t = string 4198 - 4199 - val jsont : t Jsont.t 4200 - end 4201 - end 4202 - 4203 - module VideoFile : sig 4204 - module T : sig 4205 - type t 4206 - 4207 - (** Construct a value 4208 - @param file_download_url URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) 4209 - @param file_url Direct URL of the video 4210 - @param fps Frames per second of the video file 4211 - @param has_audio **PeerTube >= 6.2** The file container has an audio stream 4212 - @param has_video **PeerTube >= 6.2** The file container has a video stream 4213 - @param height **PeerTube >= 6.1** Video stream height 4214 - @param magnet_uri magnet URI allowing to resolve the video via BitTorrent without a metainfo file 4215 - @param metadata_url URL dereferencing the output of ffprobe on the file 4216 - @param playlist_url Playlist URL of the file if it is owned by a playlist 4217 - @param size Video file size in bytes 4218 - @param torrent_download_url URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) 4219 - @param torrent_url Direct URL of the torrent file 4220 - @param width **PeerTube >= 6.1** Video stream width 4221 - *) 4222 - val v : ?file_download_url:string -> ?file_url:string -> ?fps:float -> ?has_audio:bool -> ?has_video:bool -> ?height:float -> ?id:Id.T.t -> ?magnet_uri:string -> ?metadata_url:string -> ?playlist_url:string -> ?resolution:VideoResolutionConstant.T.t -> ?size:int -> ?storage:FileStorage.T.t -> ?torrent_download_url:string -> ?torrent_url:string -> ?width:float -> unit -> t 4223 - 4224 - (** URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) *) 4225 - val file_download_url : t -> string option 4226 - 4227 - (** Direct URL of the video *) 4228 - val file_url : t -> string option 4229 - 4230 - (** Frames per second of the video file *) 4231 - val fps : t -> float option 4232 - 4233 - (** **PeerTube >= 6.2** The file container has an audio stream *) 4234 - val has_audio : t -> bool option 4235 - 4236 - (** **PeerTube >= 6.2** The file container has a video stream *) 4237 - val has_video : t -> bool option 4238 - 4239 - (** **PeerTube >= 6.1** Video stream height *) 4240 - val height : t -> float option 4241 - 4242 - val id : t -> Id.T.t option 4243 - 4244 - (** magnet URI allowing to resolve the video via BitTorrent without a metainfo file *) 4245 - val magnet_uri : t -> string option 4246 - 4247 - (** URL dereferencing the output of ffprobe on the file *) 4248 - val metadata_url : t -> string option 4249 - 4250 - (** Playlist URL of the file if it is owned by a playlist *) 4251 - val playlist_url : t -> string option 4252 - 4253 - val resolution : t -> VideoResolutionConstant.T.t option 4254 - 4255 - (** Video file size in bytes *) 4256 - val size : t -> int option 4257 - 4258 - val storage : t -> FileStorage.T.t option 4259 - 4260 - (** URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) *) 4261 - val torrent_download_url : t -> string option 4262 - 4263 - (** Direct URL of the torrent file *) 4264 - val torrent_url : t -> string option 4265 - 4266 - (** **PeerTube >= 6.1** Video stream width *) 4267 - val width : t -> float option 4268 - 4269 - val jsont : t Jsont.t 4270 - end 4271 - end 4272 - 4273 - module VideoStreamingPlaylistsHls : sig 4274 - module T : sig 4275 - type t 4276 - 4277 - (** Construct a value 4278 - @param files Video files associated to this playlist. 4279 - 4280 - The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 4281 - 4282 - *) 4283 - val v : ?files:VideoFile.T.t list -> ?playlist_url:string -> ?redundancies:Jsont.json list -> ?segments_sha256_url:string -> unit -> t 4284 - 4285 - (** Video files associated to this playlist. 4286 - 4287 - The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 4288 - *) 4289 - val files : t -> VideoFile.T.t list option 4290 - 4291 - val playlist_url : t -> string option 4292 - 4293 - val redundancies : t -> Jsont.json list option 4294 - 4295 - val segments_sha256_url : t -> string option 4296 - 4297 - val jsont : t Jsont.t 4298 - end 4299 - end 4300 - 4301 - module CustomHomepage : sig 4302 - module T : sig 4303 - type t 4304 - 4305 - (** Construct a value *) 4306 - val v : ?content:string -> unit -> t 4307 - 4308 - val content : t -> string option 4309 - 4310 - val jsont : t Jsont.t 4311 - end 4312 - 4313 - (** Get instance custom homepage *) 4314 - val get_api_v1_custom_pages_homepage_instance : t -> unit -> T.t 4315 - end 4316 - 4317 - module CommentAutoTagPolicies : sig 4318 - module T : sig 4319 - type t 4320 - 4321 - (** Construct a value 4322 - @param review Auto tags that automatically set the comment in review state 4323 - *) 4324 - val v : ?review:string list -> unit -> t 4325 - 4326 - (** Auto tags that automatically set the comment in review state *) 4327 - val review : t -> string list option 4328 - 4329 - val jsont : t Jsont.t 4330 - end 4331 - 4332 - (** Get account auto tag policies on comments 4333 - 4334 - **PeerTube >= 6.2** 4335 - @param account_name account name to get auto tag policies 4336 - *) 4337 - val get_api_v1_automatic_tags_policies_accounts_comments : account_name:string -> t -> unit -> T.t 4338 - end 4339 - 4340 - module ChannelActivityList : sig 4341 - module Response : sig 4342 - type t 4343 - 4344 - (** Construct a value *) 4345 - val v : ?data:Jsont.json list -> ?total:int -> unit -> t 4346 - 4347 - val data : t -> Jsont.json list option 4348 - 4349 - val total : t -> int option 4350 - 4351 - val jsont : t Jsont.t 4352 - end 5920 + (** Search channels 5921 + @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it. 4353 5922 4354 - (** List activities of a video channel 4355 - 4356 - **PeerTube >= 8.0** 4357 - @param channel_handle The video channel handle 4358 5923 @param start Offset used to paginate results 4359 5924 @param count Number of items to return 4360 - @param sort Sort column 4361 - *) 4362 - val list_video_channel_activities : channel_handle:string -> ?start:string -> ?count:string -> ?sort:string -> t -> unit -> Response.t 4363 - end 4364 - 4365 - module Block : sig 4366 - module Status : sig 4367 - type t 4368 - 4369 - (** Construct a value *) 4370 - val v : ?accounts:Jsont.json -> ?hosts:Jsont.json -> unit -> t 4371 - 4372 - val accounts : t -> Jsont.json option 4373 - 4374 - val hosts : t -> Jsont.json option 4375 - 4376 - val jsont : t Jsont.t 4377 - end 4378 - 4379 - (** Get block status of accounts/hosts 4380 - @param accounts Check if these accounts are blocked 4381 - @param hosts Check if these hosts are blocked 4382 - *) 4383 - val get_api_v1_blocklist_status : ?accounts:string -> ?hosts:string -> t -> unit -> Status.t 4384 - end 4385 - 4386 - module AutomaticTagAvailable : sig 4387 - module T : sig 4388 - type t 4389 - 4390 - (** Construct a value 4391 - @param available Available auto tags that can be used to filter objects or set a comment in review state 4392 - *) 4393 - val v : ?available:Jsont.json list -> unit -> t 4394 - 4395 - (** Available auto tags that can be used to filter objects or set a comment in review state *) 4396 - val available : t -> Jsont.json list option 4397 - 4398 - val jsont : t Jsont.t 4399 - end 4400 - 4401 - (** Get account available auto tags 4402 - 4403 - **PeerTube >= 6.2** 4404 - @param account_name account name to get auto tag policies 4405 - *) 4406 - val get_api_v1_automatic_tags_accounts_available : account_name:string -> t -> unit -> T.t 4407 - 4408 - (** Get server available auto tags 4409 - 4410 - **PeerTube >= 6.2** *) 4411 - val get_api_v1_automatic_tags_server_available : t -> unit -> T.t 4412 - end 4413 - 4414 - module AddVideoPasswords : sig 4415 - module T : sig 4416 - type t 4417 - 4418 - val jsont : t Jsont.t 4419 - 4420 - val v : unit -> t 4421 - end 4422 - end 4423 - 4424 - module VideoUploadRequestCommon : sig 4425 - module T : sig 4426 - type t 4427 - 4428 - (** Construct a value 4429 - @param channel_id Channel id that will contain this video 4430 - @param name Video name 4431 - @param description Video description 4432 - @param download_enabled Enable or disable downloading for this video 4433 - @param generate_transcription **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video 4434 - @param nsfw Whether or not this video contains sensitive content 4435 - @param nsfw_summary More information about the sensitive content of the video 4436 - @param originally_published_at Date when the content was originally published 4437 - @param previewfile Video preview file 4438 - @param support A text tell the audience how to support the video creator 4439 - @param tags Video tags (maximum 5 tags each between 2 and 30 characters) 4440 - @param thumbnailfile Video thumbnail file 4441 - @param wait_transcoding Whether or not we wait transcoding before publish the video 4442 - *) 4443 - val v : channel_id:int -> name:string -> ?category:VideoCategorySet.T.t -> ?comments_policy:VideoCommentsPolicySet.T.t -> ?description:string -> ?download_enabled:bool -> ?generate_transcription:bool -> ?language:VideoLanguageSet.T.t -> ?licence:VideoLicenceSet.T.t -> ?nsfw:bool -> ?nsfw_flags:Nsfwflag.T.t -> ?nsfw_summary:Jsont.json -> ?originally_published_at:Ptime.t -> ?previewfile:string -> ?privacy:VideoPrivacySet.T.t -> ?schedule_update:VideoScheduled.Update.t -> ?support:string -> ?tags:string list -> ?thumbnailfile:string -> ?video_passwords:AddVideoPasswords.T.t -> ?wait_transcoding:bool -> unit -> t 4444 - 4445 - val category : t -> VideoCategorySet.T.t option 4446 - 4447 - (** Channel id that will contain this video *) 4448 - val channel_id : t -> int 4449 - 4450 - val comments_policy : t -> VideoCommentsPolicySet.T.t option 4451 - 4452 - (** Video description *) 4453 - val description : t -> string option 4454 - 4455 - (** Enable or disable downloading for this video *) 4456 - val download_enabled : t -> bool option 4457 - 4458 - (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 4459 - val generate_transcription : t -> bool option 4460 - 4461 - val language : t -> VideoLanguageSet.T.t option 4462 - 4463 - val licence : t -> VideoLicenceSet.T.t option 4464 - 4465 - (** Video name *) 4466 - val name : t -> string 4467 - 4468 - (** Whether or not this video contains sensitive content *) 4469 - val nsfw : t -> bool option 4470 - 4471 - val nsfw_flags : t -> Nsfwflag.T.t option 4472 - 4473 - (** More information about the sensitive content of the video *) 4474 - val nsfw_summary : t -> Jsont.json option 4475 - 4476 - (** Date when the content was originally published *) 4477 - val originally_published_at : t -> Ptime.t option 4478 - 4479 - (** Video preview file *) 4480 - val previewfile : t -> string option 4481 - 4482 - val privacy : t -> VideoPrivacySet.T.t option 4483 - 4484 - val schedule_update : t -> VideoScheduled.Update.t option 4485 - 4486 - (** A text tell the audience how to support the video creator *) 4487 - val support : t -> string option 4488 - 4489 - (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 4490 - val tags : t -> string list option 4491 - 4492 - (** Video thumbnail file *) 4493 - val thumbnailfile : t -> string option 4494 - 4495 - val video_passwords : t -> AddVideoPasswords.T.t option 4496 - 4497 - (** Whether or not we wait transcoding before publish the video *) 4498 - val wait_transcoding : t -> bool option 4499 - 4500 - val jsont : t Jsont.t 4501 - end 4502 - end 4503 - 4504 - module ActorImage : sig 4505 - module T : sig 4506 - type t 4507 - 4508 - (** Construct a value 4509 - @param file_url **PeerTube >= 7.1** 4510 - @param height **PeerTube >= 7.3** 4511 - @param path Deprecated in PeerTube v8.0, use fileUrl instead 4512 - *) 4513 - val v : ?created_at:Ptime.t -> ?file_url:string -> ?height:int -> ?path:string -> ?updated_at:Ptime.t -> ?width:int -> unit -> t 4514 - 4515 - val created_at : t -> Ptime.t option 4516 - 4517 - (** **PeerTube >= 7.1** *) 4518 - val file_url : t -> string option 4519 - 4520 - (** **PeerTube >= 7.3** *) 4521 - val height : t -> int option 4522 - 4523 - (** Deprecated in PeerTube v8.0, use fileUrl instead *) 4524 - val path : t -> string option 4525 - 4526 - val updated_at : t -> Ptime.t option 4527 - 4528 - val width : t -> int option 4529 - 4530 - val jsont : t Jsont.t 4531 - end 4532 - end 4533 - 4534 - module VideoChannelSummary : sig 4535 - module T : sig 4536 - type t 4537 - 4538 - (** Construct a value *) 4539 - val v : ?avatars:ActorImage.T.t list -> ?display_name:string -> ?host:string -> ?id:Id.T.t -> ?name:string -> ?url:string -> unit -> t 4540 - 4541 - val avatars : t -> ActorImage.T.t list option 4542 - 4543 - val display_name : t -> string option 4544 - 4545 - val host : t -> string option 4546 - 4547 - val id : t -> Id.T.t option 4548 - 4549 - val name : t -> string option 4550 - 4551 - val url : t -> string option 4552 - 4553 - val jsont : t Jsont.t 4554 - end 4555 - end 4556 - 4557 - module Actor : sig 4558 - module Info : sig 4559 - type t 4560 - 4561 - (** Construct a value *) 4562 - val v : ?avatars:ActorImage.T.t list -> ?display_name:string -> ?host:string -> ?id:Id.T.t -> ?name:string -> unit -> t 4563 - 4564 - val avatars : t -> ActorImage.T.t list option 4565 - 4566 - val display_name : t -> string option 4567 - 4568 - val host : t -> string option 4569 - 4570 - val id : t -> Id.T.t option 4571 - 4572 - val name : t -> string option 4573 - 4574 - val jsont : t Jsont.t 4575 - end 4576 - 4577 - module T : sig 4578 - type t 4579 - 4580 - (** Construct a value 4581 - @param followers_count number of followers of this actor, as seen by this instance 4582 - @param following_count number of actors subscribed to by this actor, as seen by this instance 4583 - @param host server on which the actor is resident 4584 - @param host_redundancy_allowed whether this actor's host allows redundancy of its videos 4585 - @param name immutable name of the actor, used to find or mention it 4586 - *) 4587 - val v : ?avatars:ActorImage.T.t list -> ?created_at:Ptime.t -> ?followers_count:int -> ?following_count:int -> ?host:string -> ?host_redundancy_allowed:bool -> ?id:Id.T.t -> ?name:Jsont.json -> ?updated_at:Ptime.t -> ?url:string -> unit -> t 4588 - 4589 - val avatars : t -> ActorImage.T.t list option 4590 - 4591 - val created_at : t -> Ptime.t option 4592 - 4593 - (** number of followers of this actor, as seen by this instance *) 4594 - val followers_count : t -> int option 4595 - 4596 - (** number of actors subscribed to by this actor, as seen by this instance *) 4597 - val following_count : t -> int option 4598 - 4599 - (** server on which the actor is resident *) 4600 - val host : t -> string option 4601 - 4602 - (** whether this actor's host allows redundancy of its videos *) 4603 - val host_redundancy_allowed : t -> bool option 4604 - 4605 - val id : t -> Id.T.t option 4606 - 4607 - (** immutable name of the actor, used to find or mention it *) 4608 - val name : t -> Jsont.json option 4609 - 4610 - val updated_at : t -> Ptime.t option 4611 - 4612 - val url : t -> string option 4613 - 4614 - val jsont : t Jsont.t 4615 - end 4616 - end 4617 - 4618 - module Follow : sig 4619 - module T : sig 4620 - type t 4621 - 4622 - (** Construct a value 4623 - @param score score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. 4624 - *) 4625 - val v : ?created_at:Ptime.t -> ?follower:Actor.T.t -> ?following:Actor.T.t -> ?id:Id.T.t -> ?score:float -> ?state:string -> ?updated_at:Ptime.t -> unit -> t 4626 - 4627 - val created_at : t -> Ptime.t option 4628 - 4629 - val follower : t -> Actor.T.t option 4630 - 4631 - val following : t -> Actor.T.t option 4632 - 4633 - val id : t -> Id.T.t option 4634 - 4635 - (** score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. *) 4636 - val score : t -> float option 4637 - 4638 - val state : t -> string option 4639 - 4640 - val updated_at : t -> Ptime.t option 4641 - 4642 - val jsont : t Jsont.t 4643 - end 4644 - end 4645 - 4646 - module AccountSummary : sig 4647 - module T : sig 4648 - type t 4649 - 4650 - (** Construct a value *) 4651 - val v : ?avatars:ActorImage.T.t list -> ?display_name:string -> ?host:string -> ?id:int -> ?name:string -> ?url:string -> unit -> t 4652 - 4653 - val avatars : t -> ActorImage.T.t list option 4654 - 4655 - val display_name : t -> string option 4656 - 4657 - val host : t -> string option 4658 - 4659 - val id : t -> int option 4660 - 4661 - val name : t -> string option 4662 - 4663 - val url : t -> string option 4664 - 4665 - val jsont : t Jsont.t 4666 - end 4667 - end 4668 - 4669 - module VideoPlaylist : sig 4670 - module T : sig 4671 - type t 4672 - 4673 - (** Construct a value 4674 - @param video_channel_position Position of the playlist in the channel 4675 - *) 4676 - val v : ?created_at:Ptime.t -> ?description:string -> ?display_name:string -> ?id:Id.T.t -> ?is_local:bool -> ?owner_account:AccountSummary.T.t -> ?privacy:VideoPlaylistPrivacyConstant.T.t -> ?short_uuid:Jsont.json -> ?thumbnail_path:string -> ?type_:VideoPlaylistTypeConstant.T.t -> ?updated_at:Ptime.t -> ?uuid:Uuidv4.T.t -> ?video_channel:VideoChannelSummary.T.t -> ?video_channel_position:int -> ?video_length:int -> unit -> t 4677 - 4678 - val created_at : t -> Ptime.t option 4679 - 4680 - val description : t -> string option 4681 - 4682 - val display_name : t -> string option 4683 - 4684 - val id : t -> Id.T.t option 4685 - 4686 - val is_local : t -> bool option 4687 - 4688 - val owner_account : t -> AccountSummary.T.t option 4689 - 4690 - val privacy : t -> VideoPlaylistPrivacyConstant.T.t option 4691 - 4692 - val short_uuid : t -> Jsont.json option 4693 - 4694 - val thumbnail_path : t -> string option 4695 - 4696 - val type_ : t -> VideoPlaylistTypeConstant.T.t option 4697 - 4698 - val updated_at : t -> Ptime.t option 4699 - 4700 - val uuid : t -> Uuidv4.T.t option 4701 - 4702 - val video_channel : t -> VideoChannelSummary.T.t option 4703 - 4704 - (** Position of the playlist in the channel *) 4705 - val video_channel_position : t -> int option 4706 - 4707 - val video_length : t -> int option 4708 - 4709 - val jsont : t Jsont.t 4710 - end 4711 - 4712 - (** Get a video playlist 4713 - @param playlist_id Playlist id 4714 - *) 4715 - val get_api_v1_video_playlists : playlist_id:string -> t -> unit -> T.t 4716 - end 4717 - 4718 - module VideoChannelCollaborator : sig 4719 - module T : sig 4720 - (** Representation of a channel collaboration *) 4721 - type t 4722 - 4723 - (** Construct a value *) 4724 - val v : ?account:AccountSummary.T.t -> ?created_at:Ptime.t -> ?id:Id.T.t -> ?state:Jsont.json -> ?updated_at:Ptime.t -> unit -> t 4725 - 4726 - val account : t -> AccountSummary.T.t option 4727 - 4728 - val created_at : t -> Ptime.t option 4729 - 4730 - val id : t -> Id.T.t option 4731 - 4732 - val state : t -> Jsont.json option 4733 - 4734 - val updated_at : t -> Ptime.t option 4735 - 4736 - val jsont : t Jsont.t 4737 - end 4738 - end 4739 - 4740 - module Video : sig 4741 - module Info : sig 4742 - type t 4743 - 4744 - (** Construct a value *) 4745 - val v : ?id:Jsont.json -> ?name:Jsont.json -> ?state:Jsont.json -> ?uuid:Jsont.json -> unit -> t 4746 - 4747 - val id : t -> Jsont.json option 4748 - 4749 - val name : t -> Jsont.json option 4750 - 4751 - val state : t -> Jsont.json option 4752 - 4753 - val uuid : t -> Jsont.json option 4754 - 4755 - val jsont : t Jsont.t 4756 - end 4757 - 4758 - module T : sig 4759 - type t 4760 - 4761 - (** Construct a value 4762 - @param aspect_ratio **PeerTube >= 6.1** Aspect ratio of the video stream 4763 - @param category category in which the video is classified 4764 - @param comments **PeerTube >= 7.2** Number of comments on the video 4765 - @param created_at time at which the video object was first drafted 4766 - @param duration duration of the video in seconds 4767 - @param id object id for the video 4768 - @param language main language used in the video 4769 - @param licence licence under which the video is distributed 4770 - @param name title of the video 4771 - @param nsfw_summary **PeerTube >= 7.2** More information about the sensitive content of the video 4772 - @param originally_published_at used to represent a date of first publication, prior to the practical publication date of `publishedAt` 4773 - @param privacy privacy policy used to distribute the video 4774 - @param published_at time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. 4775 - @param state represents the internal state of the video processing within the PeerTube instance 4776 - @param truncated_description truncated description of the video, written in Markdown. 4777 - 4778 - @param updated_at last time the video's metadata was modified 4779 - @param uuid universal identifier for the video, that can be used across instances 4780 - *) 4781 - val v : ?account:AccountSummary.T.t -> ?aspect_ratio:float -> ?blacklisted:bool -> ?blacklisted_reason:string -> ?category:Jsont.json -> ?channel:VideoChannelSummary.T.t -> ?comments:int -> ?created_at:Ptime.t -> ?dislikes:int -> ?duration:int -> ?embed_path:string -> ?id:Jsont.json -> ?is_live:bool -> ?is_local:bool -> ?language:Jsont.json -> ?licence:Jsont.json -> ?likes:int -> ?live_schedules:LiveSchedule.T.t list -> ?name:string -> ?nsfw:bool -> ?nsfw_flags:Jsont.json -> ?nsfw_summary:string -> ?originally_published_at:Ptime.t -> ?preview_path:string -> ?privacy:Jsont.json -> ?published_at:Ptime.t -> ?scheduled_update:Jsont.json -> ?short_uuid:Jsont.json -> ?state:Jsont.json -> ?thumbnail_path:string -> ?truncated_description:string -> ?updated_at:Ptime.t -> ?user_history:Jsont.json -> ?uuid:Jsont.json -> ?views:int -> ?wait_transcoding:bool -> unit -> t 4782 - 4783 - val account : t -> AccountSummary.T.t option 4784 - 4785 - (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 4786 - val aspect_ratio : t -> float option 4787 - 4788 - val blacklisted : t -> bool option 4789 - 4790 - val blacklisted_reason : t -> string option 4791 - 4792 - (** category in which the video is classified *) 4793 - val category : t -> Jsont.json option 4794 - 4795 - val channel : t -> VideoChannelSummary.T.t option 4796 - 4797 - (** **PeerTube >= 7.2** Number of comments on the video *) 4798 - val comments : t -> int option 4799 - 4800 - (** time at which the video object was first drafted *) 4801 - val created_at : t -> Ptime.t option 4802 - 4803 - val dislikes : t -> int option 4804 - 4805 - (** duration of the video in seconds *) 4806 - val duration : t -> int option 4807 - 4808 - val embed_path : t -> string option 4809 - 4810 - (** object id for the video *) 4811 - val id : t -> Jsont.json option 4812 - 4813 - val is_live : t -> bool option 4814 - 4815 - val is_local : t -> bool option 4816 - 4817 - (** main language used in the video *) 4818 - val language : t -> Jsont.json option 4819 - 4820 - (** licence under which the video is distributed *) 4821 - val licence : t -> Jsont.json option 4822 - 4823 - val likes : t -> int option 4824 - 4825 - val live_schedules : t -> LiveSchedule.T.t list option 4826 - 4827 - (** title of the video *) 4828 - val name : t -> string option 4829 - 4830 - val nsfw : t -> bool option 4831 - 4832 - val nsfw_flags : t -> Jsont.json option 4833 - 4834 - (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 4835 - val nsfw_summary : t -> string option 4836 - 4837 - (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 4838 - val originally_published_at : t -> Ptime.t option 4839 - 4840 - val preview_path : t -> string option 4841 - 4842 - (** privacy policy used to distribute the video *) 4843 - val privacy : t -> Jsont.json option 4844 - 4845 - (** time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. *) 4846 - val published_at : t -> Ptime.t option 4847 - 4848 - val scheduled_update : t -> Jsont.json option 4849 - 4850 - val short_uuid : t -> Jsont.json option 4851 - 4852 - (** represents the internal state of the video processing within the PeerTube instance *) 4853 - val state : t -> Jsont.json option 4854 - 4855 - val thumbnail_path : t -> string option 4856 - 4857 - (** truncated description of the video, written in Markdown. 4858 - *) 4859 - val truncated_description : t -> string option 4860 - 4861 - (** last time the video's metadata was modified *) 4862 - val updated_at : t -> Ptime.t option 4863 - 4864 - val user_history : t -> Jsont.json option 4865 - 4866 - (** universal identifier for the video, that can be used across instances *) 4867 - val uuid : t -> Jsont.json option 4868 - 4869 - val views : t -> int option 4870 - 4871 - val wait_transcoding : t -> bool option 4872 - 4873 - val jsont : t Jsont.t 4874 - end 4875 - end 4876 - 4877 - module VideoRating : sig 4878 - module T : sig 4879 - type t 4880 - 4881 - (** Construct a value 4882 - @param rating Rating of the video 4883 - *) 4884 - val v : rating:string -> video:Video.T.t -> unit -> t 4885 - 4886 - (** Rating of the video *) 4887 - val rating : t -> string 4888 - 4889 - val video : t -> Video.T.t 4890 - 4891 - val jsont : t Jsont.t 4892 - end 4893 - 4894 - (** List ratings of an account 4895 - @param name The username or handle of the account 4896 - @param start Offset used to paginate results 4897 - @param count Number of items to return 4898 - @param sort Sort column 4899 - @param rating Optionally filter which ratings to retrieve 4900 - *) 4901 - val get_api_v1_accounts_ratings : name:string -> ?start:string -> ?count:string -> ?sort:string -> ?rating:string -> t -> unit -> T.t 4902 - end 4903 - 4904 - module VideoList : sig 4905 - module Response : sig 4906 - type t 4907 - 4908 - (** Construct a value *) 4909 - val v : ?data:Video.T.t list -> ?total:int -> unit -> t 4910 - 4911 - val data : t -> Video.T.t list option 4912 - 4913 - val total : t -> int option 4914 - 4915 - val jsont : t Jsont.t 4916 - end 4917 - 4918 - (** List videos of an account 4919 - @param name The username or handle of the account 4920 - @param start Offset used to paginate results 4921 - @param count Number of items to return 4922 - @param skip_count if you don't need the `total` in the response 4923 - @param nsfw whether to include nsfw videos, if any 4924 - @param is_live whether or not the video is a live 4925 - @param include_scheduled_live whether or not include live that are scheduled for later 4926 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 4927 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 4928 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 4929 - @param tags_one_of tag(s) of the video 4930 - @param tags_all_of tag(s) of the video, where all should be present in the video 4931 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 4932 - @param include_ **Only administrators and moderators can use this parameter** 4933 - 4934 - Include additional videos in results (can be combined using bitwise or operator) 4935 - - `0` NONE 4936 - - `1` NOT_PUBLISHED_STATE 4937 - - `2` BLACKLISTED 4938 - - `4` BLOCKED_OWNER 4939 - - `8` FILES 4940 - - `16` CAPTIONS 4941 - - `32` VIDEO SOURCE 4942 - 4943 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 4944 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 4945 - @param host Find elements owned by this host 4946 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 4947 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 4948 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 4949 - @param search Plain text search, applied to various parts of the model depending on endpoint 4950 - *) 4951 - val get_account_videos : name:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 4952 - 4953 - (** Search videos 4954 - @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it. 4955 - 4956 - @param uuids Find elements with specific UUIDs 4957 5925 @param search_target If the administrator enabled search index support, you can override the default search target. 4958 5926 4959 5927 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information: ··· 4963 5931 * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch 4964 5932 the data from the origin instance API 4965 5933 4966 - @param start Offset used to paginate results 4967 - @param count Number of items to return 4968 - @param skip_count if you don't need the `total` in the response 4969 - @param nsfw whether to include nsfw videos, if any 4970 - @param is_live whether or not the video is a live 4971 - @param include_scheduled_live whether or not include live that are scheduled for later 4972 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 4973 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 4974 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 4975 - @param tags_one_of tag(s) of the video 4976 - @param tags_all_of tag(s) of the video, where all should be present in the video 4977 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 4978 - @param include_ **Only administrators and moderators can use this parameter** 4979 - 4980 - Include additional videos in results (can be combined using bitwise or operator) 4981 - - `0` NONE 4982 - - `1` NOT_PUBLISHED_STATE 4983 - - `2` BLACKLISTED 4984 - - `4` BLOCKED_OWNER 4985 - - `8` FILES 4986 - - `16` CAPTIONS 4987 - - `32` VIDEO SOURCE 4988 - 4989 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 4990 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5934 + @param sort Sort column 4991 5935 @param host Find elements owned by this host 4992 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 4993 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 4994 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 4995 - @param start_date Get videos that are published after this date 4996 - @param end_date Get videos that are published before this date 4997 - @param originally_published_start_date Get videos that are originally published after this date 4998 - @param originally_published_end_date Get videos that are originally published before this date 4999 - @param duration_min Get videos that have this minimum duration 5000 - @param duration_max Get videos that have this maximum duration 5936 + @param handles Find elements with these handles 5001 5937 *) 5002 - val search_videos : search:string -> ?uuids:string -> ?search_target:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?start_date:string -> ?end_date:string -> ?originally_published_start_date:string -> ?originally_published_end_date:string -> ?duration_min:string -> ?duration_max:string -> t -> unit -> Response.t 5938 + val search_channels : search:string -> ?start:string -> ?count:string -> ?search_target:string -> ?sort:string -> ?host:string -> ?handles:string -> t -> unit -> T.t 5003 5939 5004 - (** List watched videos history 5940 + (** List my user subscriptions 5005 5941 @param start Offset used to paginate results 5006 5942 @param count Number of items to return 5007 - @param search Plain text search, applied to various parts of the model depending on endpoint 5008 5943 *) 5009 - val get_api_v1_users_me_history_videos : ?start:string -> ?count:string -> ?search:string -> t -> unit -> Response.t 5944 + val get_api_v1_users_me_subscriptions : ?start:string -> ?count:string -> ?sort:string -> t -> unit -> T.t 5010 5945 5011 - (** List videos of subscriptions of my user 5946 + (** List video channels 5012 5947 @param start Offset used to paginate results 5013 5948 @param count Number of items to return 5014 - @param skip_count if you don't need the `total` in the response 5015 - @param nsfw whether to include nsfw videos, if any 5016 - @param is_live whether or not the video is a live 5017 - @param include_scheduled_live whether or not include live that are scheduled for later 5018 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5019 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5020 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5021 - @param tags_one_of tag(s) of the video 5022 - @param tags_all_of tag(s) of the video, where all should be present in the video 5023 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 5024 - @param include_ **Only administrators and moderators can use this parameter** 5025 - 5026 - Include additional videos in results (can be combined using bitwise or operator) 5027 - - `0` NONE 5028 - - `1` NOT_PUBLISHED_STATE 5029 - - `2` BLACKLISTED 5030 - - `4` BLOCKED_OWNER 5031 - - `8` FILES 5032 - - `16` CAPTIONS 5033 - - `32` VIDEO SOURCE 5034 - 5035 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5036 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5037 - @param host Find elements owned by this host 5038 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5039 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5040 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5041 - @param search Plain text search, applied to various parts of the model depending on endpoint 5042 - *) 5043 - val get_api_v1_users_me_subscriptions_videos : ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 5044 - 5045 - (** List videos of my user 5046 - @param channel_name_one_of **PeerTube >= 7.2** Filter on videos that are published by a channel with one of these names 5047 - @param start Offset used to paginate results 5048 - @param count Number of items to return 5049 - @param skip_count if you don't need the `total` in the response 5050 - @param nsfw whether to include nsfw videos, if any 5051 - @param is_live whether or not the video is a live 5052 - @param include_scheduled_live whether or not include live that are scheduled for later 5053 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5054 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5055 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5056 - @param tags_one_of tag(s) of the video 5057 - @param tags_all_of tag(s) of the video, where all should be present in the video 5058 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 5059 - @param include_ **Only administrators and moderators can use this parameter** 5060 - 5061 - Include additional videos in results (can be combined using bitwise or operator) 5062 - - `0` NONE 5063 - - `1` NOT_PUBLISHED_STATE 5064 - - `2` BLACKLISTED 5065 - - `4` BLOCKED_OWNER 5066 - - `8` FILES 5067 - - `16` CAPTIONS 5068 - - `32` VIDEO SOURCE 5069 - 5070 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5071 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5072 - @param host Find elements owned by this host 5073 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5074 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5075 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5076 - @param search Plain text search, applied to various parts of the model depending on endpoint 5077 - @param include_collaborations **PeerTube >= 8.0** Include objects from collaborated channels 5078 - *) 5079 - val get_api_v1_users_me_videos : ?channel_name_one_of:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> ?include_collaborations:string -> t -> unit -> Response.t 5080 - 5081 - (** List videos of a video channel 5082 - @param channel_handle The video channel handle 5083 - @param start Offset used to paginate results 5084 - @param count Number of items to return 5085 - @param skip_count if you don't need the `total` in the response 5086 - @param nsfw whether to include nsfw videos, if any 5087 - @param is_live whether or not the video is a live 5088 - @param include_scheduled_live whether or not include live that are scheduled for later 5089 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5090 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5091 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5092 - @param tags_one_of tag(s) of the video 5093 - @param tags_all_of tag(s) of the video, where all should be present in the video 5094 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 5095 - @param include_ **Only administrators and moderators can use this parameter** 5096 - 5097 - Include additional videos in results (can be combined using bitwise or operator) 5098 - - `0` NONE 5099 - - `1` NOT_PUBLISHED_STATE 5100 - - `2` BLACKLISTED 5101 - - `4` BLOCKED_OWNER 5102 - - `8` FILES 5103 - - `16` CAPTIONS 5104 - - `32` VIDEO SOURCE 5105 - 5106 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5107 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5108 - @param host Find elements owned by this host 5109 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5110 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5111 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5112 - @param search Plain text search, applied to various parts of the model depending on endpoint 5113 - *) 5114 - val get_video_channel_videos : channel_handle:string -> ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 5115 - 5116 - (** List videos 5117 - @param start Offset used to paginate results 5118 - @param count Number of items to return 5119 - @param skip_count if you don't need the `total` in the response 5120 - @param nsfw whether to include nsfw videos, if any 5121 - @param is_live whether or not the video is a live 5122 - @param include_scheduled_live whether or not include live that are scheduled for later 5123 - @param category_one_of category id of the video (see [/videos/categories](#operation/getCategories)) 5124 - @param licence_one_of licence id of the video (see [/videos/licences](#operation/getLicences)) 5125 - @param language_one_of language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language 5126 - @param tags_one_of tag(s) of the video 5127 - @param tags_all_of tag(s) of the video, where all should be present in the video 5128 - @param is_local **PeerTube >= 4.0** Display only local or remote objects 5129 - @param include_ **Only administrators and moderators can use this parameter** 5130 - 5131 - Include additional videos in results (can be combined using bitwise or operator) 5132 - - `0` NONE 5133 - - `1` NOT_PUBLISHED_STATE 5134 - - `2` BLACKLISTED 5135 - - `4` BLOCKED_OWNER 5136 - - `8` FILES 5137 - - `16` CAPTIONS 5138 - - `32` VIDEO SOURCE 5139 - 5140 - @param has_hlsfiles **PeerTube >= 4.0** Display only videos that have HLS files 5141 - @param has_web_video_files **PeerTube >= 6.0** Display only videos that have Web Video files 5142 - @param host Find elements owned by this host 5143 - @param auto_tag_one_of **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags 5144 - @param privacy_one_of **PeerTube >= 4.0** Display only videos in this specific privacy/privacies 5145 - @param exclude_already_watched Whether or not to exclude videos that are in the user's video history 5146 - @param search Plain text search, applied to various parts of the model depending on endpoint 5949 + @param sort Sort column 5147 5950 *) 5148 - val get_videos : ?start:string -> ?count:string -> ?skip_count:string -> ?sort:string -> ?nsfw:string -> ?nsfw_flags_included:string -> ?nsfw_flags_excluded:string -> ?is_live:string -> ?include_scheduled_live:string -> ?category_one_of:string -> ?licence_one_of:string -> ?language_one_of:string -> ?tags_one_of:string -> ?tags_all_of:string -> ?is_local:string -> ?include_:string -> ?has_hlsfiles:string -> ?has_web_video_files:string -> ?host:string -> ?auto_tag_one_of:string -> ?privacy_one_of:string -> ?exclude_already_watched:string -> ?search:string -> t -> unit -> Response.t 5951 + val get_video_channels : ?start:string -> ?count:string -> ?sort:string -> t -> unit -> T.t 5149 5952 end 5150 5953 5151 - module VideoCommentForOwnerOrAdmin : sig 5954 + module UserWithStats : sig 5152 5955 module T : sig 5153 5956 type t 5154 5957 5155 - (** Construct a value *) 5156 - val v : ?account:Jsont.json -> ?automatic_tags:string list -> ?created_at:Jsont.json -> ?held_for_review:Jsont.json -> ?id:Id.T.t -> ?in_reply_to_comment_id:Jsont.json -> ?text:Jsont.json -> ?thread_id:Jsont.json -> ?updated_at:Jsont.json -> ?url:Jsont.json -> ?video:Video.Info.t -> unit -> t 5157 - 5158 - val account : t -> Jsont.json option 5159 - 5160 - val automatic_tags : t -> string list option 5161 - 5162 - val created_at : t -> Jsont.json option 5163 - 5164 - val held_for_review : t -> Jsont.json option 5165 - 5166 - val id : t -> Id.T.t option 5958 + (** Construct a value 5959 + @param auto_play_next_video Automatically start playing the upcoming video after the currently playing video 5960 + @param auto_play_next_video_playlist Automatically start playing the video on the playlist after the currently playing video 5961 + @param auto_play_video Automatically start playing the video on the watch page 5962 + @param email The user email 5963 + @param email_public Has the user accepted to display the email publicly? 5964 + @param email_verified Has the user confirmed their email address? 5965 + @param language default language for this user 5966 + @param new_features_info_read New features information the user has read 5967 + @param p2p_enabled whether to enable P2P in the player or not 5968 + @param plugin_auth Auth plugin to use to authenticate the user 5969 + @param theme Theme enabled by this user 5970 + @param two_factor_enabled Whether the user has enabled two-factor authentication or not 5971 + @param video_languages list of languages to filter videos down to 5972 + @param video_quota The user video quota in bytes 5973 + @param video_quota_daily The user daily video quota in bytes 5974 + @param videos_history_enabled whether to keep track of watched history or not 5975 + @param videos_count Count of videos published 5976 + @param abuses_count Count of reports/abuses of which the user is a target 5977 + @param abuses_accepted_count Count of reports/abuses created by the user and accepted/acted upon by the moderation team 5978 + @param abuses_created_count Count of reports/abuses created by the user 5979 + @param video_comments_count Count of comments published 5980 + *) 5981 + val v : ?account:Account.T.t -> ?admin_flags:UserAdminFlags.T.t -> ?auto_play_next_video:bool -> ?auto_play_next_video_playlist:bool -> ?auto_play_video:bool -> ?blocked:bool -> ?blocked_reason:string -> ?created_at:string -> ?email:string -> ?email_public:bool -> ?email_verified:bool -> ?id:Id.T.t -> ?language:string -> ?last_login_date:Ptime.t -> ?new_features_info_read:float -> ?no_account_setup_warning_modal:bool -> ?no_instance_config_warning_modal:bool -> ?no_welcome_modal:bool -> ?notification_settings:UserNotificationSettings.T.t -> ?nsfw_flags_blurred:Nsfwflag.T.t -> ?nsfw_flags_displayed:Nsfwflag.T.t -> ?nsfw_flags_hidden:Nsfwflag.T.t -> ?nsfw_flags_warned:Nsfwflag.T.t -> ?nsfw_policy:Nsfwpolicy.T.t -> ?p2p_enabled:bool -> ?plugin_auth:string -> ?role:Jsont.json -> ?theme:string -> ?two_factor_enabled:bool -> ?username:Username.T.t -> ?video_channels:VideoChannel.T.t list -> ?video_languages:string list -> ?video_quota:int -> ?video_quota_daily:int -> ?videos_history_enabled:bool -> ?videos_count:int -> ?abuses_count:int -> ?abuses_accepted_count:int -> ?abuses_created_count:int -> ?video_comments_count:int -> unit -> t 5167 5982 5168 - val in_reply_to_comment_id : t -> Jsont.json option 5983 + val account : t -> Account.T.t option 5169 5984 5170 - val text : t -> Jsont.json option 5985 + val admin_flags : t -> UserAdminFlags.T.t option 5171 5986 5172 - val thread_id : t -> Jsont.json option 5987 + (** Automatically start playing the upcoming video after the currently playing video *) 5988 + val auto_play_next_video : t -> bool option 5173 5989 5174 - val updated_at : t -> Jsont.json option 5990 + (** Automatically start playing the video on the playlist after the currently playing video *) 5991 + val auto_play_next_video_playlist : t -> bool option 5175 5992 5176 - val url : t -> Jsont.json option 5993 + (** Automatically start playing the video on the watch page *) 5994 + val auto_play_video : t -> bool option 5177 5995 5178 - val video : t -> Video.Info.t option 5996 + val blocked : t -> bool option 5179 5997 5180 - val jsont : t Jsont.t 5181 - end 5182 - end 5183 - 5184 - module AbuseMessage : sig 5185 - module T : sig 5186 - type t 5998 + val blocked_reason : t -> string option 5187 5999 5188 - (** Construct a value *) 5189 - val v : ?account:AccountSummary.T.t -> ?by_moderator:bool -> ?created_at:Ptime.t -> ?id:Id.T.t -> ?message:string -> unit -> t 6000 + val created_at : t -> string option 5190 6001 5191 - val account : t -> AccountSummary.T.t option 6002 + (** The user email *) 6003 + val email : t -> string option 5192 6004 5193 - val by_moderator : t -> bool option 6005 + (** Has the user accepted to display the email publicly? *) 6006 + val email_public : t -> bool option 5194 6007 5195 - val created_at : t -> Ptime.t option 6008 + (** Has the user confirmed their email address? *) 6009 + val email_verified : t -> bool option 5196 6010 5197 6011 val id : t -> Id.T.t option 5198 6012 5199 - val message : t -> string option 6013 + (** default language for this user *) 6014 + val language : t -> string option 5200 6015 5201 - val jsont : t Jsont.t 5202 - end 5203 - end 5204 - 5205 - module Account : sig 5206 - module T : sig 5207 - type t 6016 + val last_login_date : t -> Ptime.t option 5208 6017 5209 - val jsont : t Jsont.t 6018 + (** New features information the user has read *) 6019 + val new_features_info_read : t -> float option 5210 6020 5211 - val v : unit -> t 5212 - end 5213 - 5214 - (** Get an account 5215 - @param name The username or handle of the account 5216 - *) 5217 - val get_account : name:string -> t -> unit -> T.t 5218 - end 5219 - 5220 - module VideoComment : sig 5221 - module T : sig 5222 - type t 6021 + val no_account_setup_warning_modal : t -> bool option 5223 6022 5224 - (** Construct a value 5225 - @param text Text of the comment 5226 - *) 5227 - val v : ?account:Account.T.t -> ?created_at:Ptime.t -> ?deleted_at:Ptime.t -> ?held_for_review:bool -> ?id:Id.T.t -> ?in_reply_to_comment_id:Jsont.json -> ?is_deleted:bool -> ?text:string -> ?thread_id:Id.T.t -> ?total_replies:int -> ?total_replies_from_video_author:int -> ?updated_at:Ptime.t -> ?url:string -> ?video_id:Jsont.json -> unit -> t 6023 + val no_instance_config_warning_modal : t -> bool option 5228 6024 5229 - val account : t -> Account.T.t option 6025 + val no_welcome_modal : t -> bool option 5230 6026 5231 - val created_at : t -> Ptime.t option 6027 + val notification_settings : t -> UserNotificationSettings.T.t option 5232 6028 5233 - val deleted_at : t -> Ptime.t option 6029 + val nsfw_flags_blurred : t -> Nsfwflag.T.t option 5234 6030 5235 - val held_for_review : t -> bool option 6031 + val nsfw_flags_displayed : t -> Nsfwflag.T.t option 5236 6032 5237 - val id : t -> Id.T.t option 6033 + val nsfw_flags_hidden : t -> Nsfwflag.T.t option 5238 6034 5239 - val in_reply_to_comment_id : t -> Jsont.json option 6035 + val nsfw_flags_warned : t -> Nsfwflag.T.t option 5240 6036 5241 - val is_deleted : t -> bool option 6037 + val nsfw_policy : t -> Nsfwpolicy.T.t option 5242 6038 5243 - (** Text of the comment *) 5244 - val text : t -> string option 6039 + (** whether to enable P2P in the player or not *) 6040 + val p2p_enabled : t -> bool option 5245 6041 5246 - val thread_id : t -> Id.T.t option 6042 + (** Auth plugin to use to authenticate the user *) 6043 + val plugin_auth : t -> string option 5247 6044 5248 - val total_replies : t -> int option 6045 + val role : t -> Jsont.json option 5249 6046 5250 - val total_replies_from_video_author : t -> int option 6047 + (** Theme enabled by this user *) 6048 + val theme : t -> string option 5251 6049 5252 - val updated_at : t -> Ptime.t option 6050 + (** Whether the user has enabled two-factor authentication or not *) 6051 + val two_factor_enabled : t -> bool option 5253 6052 5254 - val url : t -> string option 6053 + val username : t -> Username.T.t option 5255 6054 5256 - val video_id : t -> Jsont.json option 6055 + val video_channels : t -> VideoChannel.T.t list option 5257 6056 5258 - val jsont : t Jsont.t 5259 - end 5260 - end 5261 - 5262 - module VideoCommentThreadTree : sig 5263 - module T : sig 5264 - type t 6057 + (** list of languages to filter videos down to *) 6058 + val video_languages : t -> string list option 5265 6059 5266 - (** Construct a value *) 5267 - val v : ?children:Jsont.json list -> ?comment:VideoComment.T.t -> unit -> t 6060 + (** The user video quota in bytes *) 6061 + val video_quota : t -> int option 5268 6062 5269 - val children : t -> Jsont.json list option 6063 + (** The user daily video quota in bytes *) 6064 + val video_quota_daily : t -> int option 5270 6065 5271 - val comment : t -> VideoComment.T.t option 6066 + (** whether to keep track of watched history or not *) 6067 + val videos_history_enabled : t -> bool option 5272 6068 5273 - val jsont : t Jsont.t 5274 - end 5275 - 5276 - (** Get a thread 5277 - @param id The object id, uuid or short uuid 5278 - @param thread_id The thread id (root comment id) 5279 - *) 5280 - val get_api_v1_videos_comment_threads : id:string -> thread_id:string -> t -> unit -> T.t 5281 - end 5282 - 5283 - module CommentThreadPost : sig 5284 - module Response : sig 5285 - type t 6069 + (** Count of videos published *) 6070 + val videos_count : t -> int option 5286 6071 5287 - (** Construct a value *) 5288 - val v : ?comment:VideoComment.T.t -> unit -> t 5289 - 5290 - val comment : t -> VideoComment.T.t option 5291 - 5292 - val jsont : t Jsont.t 5293 - end 5294 - 5295 - (** Create a thread 5296 - @param id The object id, uuid or short uuid 5297 - *) 5298 - val post_api_v1_videos_comment_threads : id:string -> t -> unit -> Response.t 5299 - 5300 - (** Reply to a thread of a video 5301 - @param id The object id, uuid or short uuid 5302 - @param comment_id The comment id 5303 - *) 5304 - val post_api_v1_videos_comments : id:string -> comment_id:string -> t -> unit -> Response.t 5305 - end 5306 - 5307 - module CommentThread : sig 5308 - module Response : sig 5309 - type t 6072 + (** Count of reports/abuses of which the user is a target *) 6073 + val abuses_count : t -> int option 5310 6074 5311 - (** Construct a value 5312 - @param total Total threads (included deleted ones) on this video 5313 - @param total_not_deleted_comments Total not-deleted threads (included deleted ones) on this video 5314 - *) 5315 - val v : ?data:VideoComment.T.t list -> ?total:int -> ?total_not_deleted_comments:int -> unit -> t 6075 + (** Count of reports/abuses created by the user and accepted/acted upon by the moderation team *) 6076 + val abuses_accepted_count : t -> int option 5316 6077 5317 - val data : t -> VideoComment.T.t list option 6078 + (** Count of reports/abuses created by the user *) 6079 + val abuses_created_count : t -> int option 5318 6080 5319 - (** Total threads (included deleted ones) on this video *) 5320 - val total : t -> int option 5321 - 5322 - (** Total not-deleted threads (included deleted ones) on this video *) 5323 - val total_not_deleted_comments : t -> int option 6081 + (** Count of comments published *) 6082 + val video_comments_count : t -> int option 5324 6083 5325 6084 val jsont : t Jsont.t 5326 6085 end 5327 - 5328 - (** List threads of a video 5329 - @param id The object id, uuid or short uuid 5330 - @param start Offset used to paginate results 5331 - @param count Number of items to return 5332 - @param sort Sort comments by criteria 5333 - *) 5334 - val get_api_v1_videos_comment_threads : id:string -> ?start:string -> ?count:string -> ?sort:string -> t -> unit -> Response.t 5335 6086 end 5336 6087 5337 6088 module User : sig