OCaml bindings to the Peertube ActivityPub video sharing API
0
fork

Configure Feed

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

Add default values, validation, and field-level unions to OpenAPI generator

- Add default value support: extract JSON defaults and generate OCaml literals
for bools, ints, floats, strings, enums, null, and empty arrays
- Generate constructors with optional params using ?(name=default) syntax
- Generate jsont codecs with ~dec_absent:default for absent field handling
- Add runtime validation for strings (minLength, maxLength, pattern),
numbers (minimum, maximum, exclusiveMinimum, exclusiveMaximum),
and lists (minItems, maxItems, uniqueItems)
- Add field-level union types for primitive oneOf/anyOf schemas
- Handle forward references in circular dependencies with Jsont.json fallback
- Improve topological sort to handle cycles gracefully
- Regenerate immich and peertube clients with new features

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

+4510 -1768
+1 -1
dune
··· 1 1 (library 2 - (name peertube) 2 + (name peer_tube) 3 3 (public_name peertube) 4 4 (libraries openapi jsont jsont.bytesrw requests ptime eio) 5 5 (wrapped true))
+4488 -1746
peertube.ml peer_tube.ml
··· 1 - (** {1 Peertube} 1 + (** {1 PeerTube} 2 2 3 3 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite 4 4 HTTP/REST library for your programming language to use PeerTube. ··· 149 149 let session t = t.session 150 150 151 151 module VideosForXml = struct 152 + module Types = struct 153 + module T = struct 154 + type t = Jsont.json 155 + end 156 + end 157 + 152 158 module T = struct 153 - type t = Jsont.json 154 - 159 + include Types.T 155 160 let jsont = Jsont.json 156 - 157 161 let v () = Jsont.Null ((), Jsont.Meta.none) 158 162 end 159 163 end 160 164 161 165 module VideoUpload = struct 166 + module Types = struct 167 + module Response = struct 168 + type t = { 169 + video : Jsont.json option; 170 + } 171 + end 172 + end 173 + 162 174 module Response = struct 163 - type t = { 164 - video : Jsont.json option; 165 - } 175 + include Types.Response 166 176 167 177 let v ?video () = { video } 168 178 ··· 193 203 if Requests.Response.ok response then 194 204 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 195 205 else 206 + let body = Requests.Response.text response in 207 + let parsed_body = 208 + match Jsont_bytesrw.decode_string Jsont.json body with 209 + | Ok json -> Some (Openapi.Runtime.Json json) 210 + | Error _ -> Some (Openapi.Runtime.Raw body) 211 + in 196 212 raise (Openapi.Runtime.Api_error { 197 213 operation = op_name; 198 214 method_ = "POST"; 199 215 url; 200 216 status = Requests.Response.status_code response; 201 - body = Requests.Response.text response; 217 + body; 218 + parsed_body; 202 219 }) 203 220 204 221 (** Create a live *) ··· 216 233 if Requests.Response.ok response then 217 234 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 218 235 else 236 + let body = Requests.Response.text response in 237 + let parsed_body = 238 + match Jsont_bytesrw.decode_string Jsont.json body with 239 + | Ok json -> Some (Openapi.Runtime.Json json) 240 + | Error _ -> Some (Openapi.Runtime.Raw body) 241 + in 219 242 raise (Openapi.Runtime.Api_error { 220 243 operation = op_name; 221 244 method_ = "POST"; 222 245 url; 223 246 status = Requests.Response.status_code response; 224 - body = Requests.Response.text response; 247 + body; 248 + parsed_body; 225 249 }) 226 250 227 251 (** Upload a video ··· 241 265 if Requests.Response.ok response then 242 266 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 243 267 else 268 + let body = Requests.Response.text response in 269 + let parsed_body = 270 + match Jsont_bytesrw.decode_string Jsont.json body with 271 + | Ok json -> Some (Openapi.Runtime.Json json) 272 + | Error _ -> Some (Openapi.Runtime.Raw body) 273 + in 244 274 raise (Openapi.Runtime.Api_error { 245 275 operation = op_name; 246 276 method_ = "POST"; 247 277 url; 248 278 status = Requests.Response.status_code response; 249 - body = Requests.Response.text response; 279 + body; 280 + parsed_body; 250 281 }) 251 282 252 283 (** Send chunk for the resumable upload of a video ··· 270 301 if Requests.Response.ok response then 271 302 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 272 303 else 304 + let body = Requests.Response.text response in 305 + let parsed_body = 306 + match Jsont_bytesrw.decode_string Jsont.json body with 307 + | Ok json -> Some (Openapi.Runtime.Json json) 308 + | Error _ -> Some (Openapi.Runtime.Raw body) 309 + in 273 310 raise (Openapi.Runtime.Api_error { 274 311 operation = op_name; 275 312 method_ = "PUT"; 276 313 url; 277 314 status = Requests.Response.status_code response; 278 - body = Requests.Response.text response; 315 + body; 316 + parsed_body; 279 317 }) 280 318 end 281 319 282 320 module VideoToken = struct 321 + module Types = struct 322 + module Response = struct 323 + type t = { 324 + files : Jsont.json option; 325 + } 326 + end 327 + end 328 + 283 329 module Response = struct 284 - type t = { 285 - files : Jsont.json option; 286 - } 330 + include Types.Response 287 331 288 332 let v ?files () = { files } 289 333 ··· 316 360 if Requests.Response.ok response then 317 361 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 318 362 else 363 + let body = Requests.Response.text response in 364 + let parsed_body = 365 + match Jsont_bytesrw.decode_string Jsont.json body with 366 + | Ok json -> Some (Openapi.Runtime.Json json) 367 + | Error _ -> Some (Openapi.Runtime.Raw body) 368 + in 319 369 raise (Openapi.Runtime.Api_error { 320 370 operation = op_name; 321 371 method_ = "POST"; 322 372 url; 323 373 status = Requests.Response.status_code response; 324 - body = Requests.Response.text response; 374 + body; 375 + parsed_body; 325 376 }) 326 377 end 327 378 328 379 module VideoStudioCreateTask = struct 380 + module Types = struct 381 + module T = struct 382 + type t = Jsont.json 383 + end 384 + end 385 + 329 386 module T = struct 330 - type t = Jsont.json 331 - 387 + include Types.T 332 388 let jsont = Jsont.json 333 - 334 389 let v () = Jsont.Null ((), Jsont.Meta.none) 335 390 end 336 391 end 337 392 338 393 module VideoStatsUserAgentDevice = struct 394 + module Types = struct 395 + module T = struct 396 + type t = [ 397 + | `Console 398 + | `Embedded 399 + | `Mobile 400 + | `Smarttv 401 + | `Tablet 402 + | `Wearable 403 + | `Xr 404 + | `Desktop 405 + ] 406 + end 407 + end 408 + 339 409 module T = struct 340 - type t = [ 341 - | `Console 342 - | `Embedded 343 - | `Mobile 344 - | `Smarttv 345 - | `Tablet 346 - | `Wearable 347 - | `Xr 348 - | `Desktop 349 - ] 410 + include Types.T 350 411 351 412 let jsont : t Jsont.t = 352 413 Jsont.map Jsont.string ~kind:"VideoStatsUserAgentDevice" ··· 373 434 end 374 435 375 436 module UserViewingVideo = struct 437 + module Types = struct 438 + module T = struct 439 + type t = { 440 + client : string option; (** Client software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc. 441 + *) 442 + current_time : int; (** timestamp within the video, in seconds *) 443 + device : VideoStatsUserAgentDevice.T.t option; (** Device used to watch the video. For example "desktop", "mobile", "smarttv", etc. 444 + *) 445 + operating_system : string option; (** Operating system used to watch the video. For example "Windows", "Ubuntu", etc. 446 + *) 447 + 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. 448 + *) 449 + view_event : string option; (** Event since last viewing call: 450 + * `seek` - If the user seeked the video 451 + *) 452 + } 453 + end 454 + end 455 + 376 456 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 - } 457 + include Types.T 391 458 392 459 let v ~current_time ?client ?device ?operating_system ?session_id ?view_event () = { client; current_time; device; operating_system; session_id; view_event } 393 460 ··· 413 480 end 414 481 415 482 module VideoStatsUserAgent = struct 483 + module Types = struct 484 + module T = struct 485 + type t = { 486 + clients : Jsont.json list option; 487 + devices : Jsont.json list option; 488 + operating_system : Jsont.json list option; 489 + } 490 + end 491 + end 492 + 416 493 module T = struct 417 - type t = { 418 - clients : Jsont.json list option; 419 - devices : Jsont.json list option; 420 - operating_system : Jsont.json list option; 421 - } 494 + include Types.T 422 495 423 496 let v ?clients ?devices ?operating_system () = { clients; devices; operating_system } 424 497 ··· 455 528 if Requests.Response.ok response then 456 529 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 457 530 else 531 + let body = Requests.Response.text response in 532 + let parsed_body = 533 + match Jsont_bytesrw.decode_string Jsont.json body with 534 + | Ok json -> Some (Openapi.Runtime.Json json) 535 + | Error _ -> Some (Openapi.Runtime.Raw body) 536 + in 458 537 raise (Openapi.Runtime.Api_error { 459 538 operation = op_name; 460 539 method_ = "GET"; 461 540 url; 462 541 status = Requests.Response.status_code response; 463 - body = Requests.Response.text response; 542 + body; 543 + parsed_body; 464 544 }) 465 545 end 466 546 467 547 module VideoStatsTimeserie = struct 548 + module Types = struct 549 + module T = struct 550 + type t = { 551 + data : Jsont.json list option; 552 + } 553 + end 554 + end 555 + 468 556 module T = struct 469 - type t = { 470 - data : Jsont.json list option; 471 - } 557 + include Types.T 472 558 473 559 let v ?data () = { data } 474 560 ··· 502 588 if Requests.Response.ok response then 503 589 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 504 590 else 591 + let body = Requests.Response.text response in 592 + let parsed_body = 593 + match Jsont_bytesrw.decode_string Jsont.json body with 594 + | Ok json -> Some (Openapi.Runtime.Json json) 595 + | Error _ -> Some (Openapi.Runtime.Raw body) 596 + in 505 597 raise (Openapi.Runtime.Api_error { 506 598 operation = op_name; 507 599 method_ = "GET"; 508 600 url; 509 601 status = Requests.Response.status_code response; 510 - body = Requests.Response.text response; 602 + body; 603 + parsed_body; 511 604 }) 512 605 end 513 606 514 607 module VideoStatsRetention = struct 608 + module Types = struct 609 + module T = struct 610 + type t = { 611 + data : Jsont.json list option; 612 + } 613 + end 614 + end 615 + 515 616 module T = struct 516 - type t = { 517 - data : Jsont.json list option; 518 - } 617 + include Types.T 519 618 520 619 let v ?data () = { data } 521 620 ··· 546 645 if Requests.Response.ok response then 547 646 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 548 647 else 648 + let body = Requests.Response.text response in 649 + let parsed_body = 650 + match Jsont_bytesrw.decode_string Jsont.json body with 651 + | Ok json -> Some (Openapi.Runtime.Json json) 652 + | Error _ -> Some (Openapi.Runtime.Raw body) 653 + in 549 654 raise (Openapi.Runtime.Api_error { 550 655 operation = op_name; 551 656 method_ = "GET"; 552 657 url; 553 658 status = Requests.Response.status_code response; 554 - body = Requests.Response.text response; 659 + body; 660 + parsed_body; 555 661 }) 556 662 end 557 663 558 664 module VideoStatsOverall = struct 665 + module Types = struct 666 + module T = struct 667 + type t = { 668 + average_watch_time : float option; 669 + countries : Jsont.json list option; 670 + subdivisions : Jsont.json list option; 671 + total_viewers : float option; 672 + total_watch_time : float option; 673 + viewers_peak : float option; 674 + viewers_peak_date : Ptime.t option; 675 + } 676 + end 677 + end 678 + 559 679 module T = struct 560 - type t = { 561 - average_watch_time : float option; 562 - countries : Jsont.json list option; 563 - subdivisions : Jsont.json list option; 564 - total_viewers : float option; 565 - total_watch_time : float option; 566 - viewers_peak : float option; 567 - viewers_peak_date : Ptime.t option; 568 - } 680 + include Types.T 569 681 570 682 let v ?average_watch_time ?countries ?subdivisions ?total_viewers ?total_watch_time ?viewers_peak ?viewers_peak_date () = { average_watch_time; countries; subdivisions; total_viewers; total_watch_time; viewers_peak; viewers_peak_date } 571 683 ··· 610 722 if Requests.Response.ok response then 611 723 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 612 724 else 725 + let body = Requests.Response.text response in 726 + let parsed_body = 727 + match Jsont_bytesrw.decode_string Jsont.json body with 728 + | Ok json -> Some (Openapi.Runtime.Json json) 729 + | Error _ -> Some (Openapi.Runtime.Raw body) 730 + in 613 731 raise (Openapi.Runtime.Api_error { 614 732 operation = op_name; 615 733 method_ = "GET"; 616 734 url; 617 735 status = Requests.Response.status_code response; 618 - body = Requests.Response.text response; 736 + body; 737 + parsed_body; 619 738 }) 620 739 end 621 740 622 741 module VideoStateConstant = struct 742 + module Types = struct 743 + module T = struct 744 + type t = { 745 + id : int option; (** The video state: 746 + - `1`: Published 747 + - `2`: To transcode 748 + - `3`: To import 749 + - `4`: Waiting for live stream 750 + - `5`: Live ended 751 + - `6`: To move to an external storage (object storage...) 752 + - `7`: Transcoding failed 753 + - `8`: Moving to an external storage failed 754 + - `9`: To edit using studio edition feature 755 + *) 756 + label : string option; 757 + } 758 + end 759 + end 760 + 623 761 module T = struct 624 - type t = { 625 - id : int option; (** The video state: 626 - - `1`: Published 627 - - `2`: To transcode 628 - - `3`: To import 629 - - `4`: Waiting for live stream 630 - - `5`: Live ended 631 - - `6`: To move to an external storage (object storage...) 632 - - `7`: Transcoding failed 633 - - `8`: Moving to an external storage failed 634 - - `9`: To edit using studio edition feature 635 - *) 636 - label : string option; 637 - } 762 + include Types.T 638 763 639 764 let v ?id ?label () = { id; label } 640 765 ··· 652 777 end 653 778 654 779 module VideoResolutionSet = struct 780 + module Types = struct 781 + module T = struct 782 + (** Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) 783 + 784 + `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. 785 + *) 786 + type t = Jsont.json 787 + end 788 + end 789 + 655 790 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 - 791 + include Types.T 662 792 let jsont = Jsont.json 663 - 664 793 let v () = Jsont.Null ((), Jsont.Meta.none) 665 794 end 666 795 end 667 796 668 797 module VideoResolutionConstant = struct 798 + module Types = struct 799 + module T = struct 800 + (** resolutions and their labels for the video *) 801 + type t = { 802 + id : VideoResolutionSet.T.t option; 803 + label : string option; 804 + } 805 + end 806 + end 807 + 669 808 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 - } 809 + include Types.T 675 810 676 811 let v ?id ?label () = { id; label } 677 812 ··· 689 824 end 690 825 691 826 module VideoSource = struct 827 + module Types = struct 828 + module T = struct 829 + type t = { 830 + created_at : Ptime.t option; 831 + file_download_url : string option; (** **PeerTube >= 6.1** If enabled by the admin, the video source file is kept on the server and can be downloaded by the owner *) 832 + fps : float option; (** **PeerTube >= 6.1** Frames per second of the video file *) 833 + height : int option; (** **PeerTube >= 6.1** Video stream height *) 834 + input_filename : string option; (** Uploaded/imported filename *) 835 + resolution : VideoResolutionConstant.T.t option; (** **PeerTube >= 6.1** *) 836 + size : int option; (** **PeerTube >= 6.1** Video file size in bytes *) 837 + width : int option; (** **PeerTube >= 6.1** Video stream width *) 838 + } 839 + end 840 + end 841 + 692 842 module T = struct 693 - type t = { 694 - created_at : Ptime.t option; 695 - file_download_url : string option; (** **PeerTube >= 6.1** If enabled by the admin, the video source file is kept on the server and can be downloaded by the owner *) 696 - fps : float option; (** **PeerTube >= 6.1** Frames per second of the video file *) 697 - height : int option; (** **PeerTube >= 6.1** Video stream height *) 698 - input_filename : string option; (** Uploaded/imported filename *) 699 - resolution : VideoResolutionConstant.T.t option; (** **PeerTube >= 6.1** *) 700 - size : int option; (** **PeerTube >= 6.1** Video file size in bytes *) 701 - width : int option; (** **PeerTube >= 6.1** Video stream width *) 702 - } 843 + include Types.T 703 844 704 845 let v ?created_at ?file_download_url ?fps ?height ?input_filename ?resolution ?size ?width () = { created_at; file_download_url; fps; height; input_filename; resolution; size; width } 705 846 ··· 746 887 if Requests.Response.ok response then 747 888 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 748 889 else 890 + let body = Requests.Response.text response in 891 + let parsed_body = 892 + match Jsont_bytesrw.decode_string Jsont.json body with 893 + | Ok json -> Some (Openapi.Runtime.Json json) 894 + | Error _ -> Some (Openapi.Runtime.Raw body) 895 + in 749 896 raise (Openapi.Runtime.Api_error { 750 897 operation = op_name; 751 898 method_ = "GET"; 752 899 url; 753 900 status = Requests.Response.status_code response; 754 - body = Requests.Response.text response; 901 + body; 902 + parsed_body; 755 903 }) 756 904 end 757 905 758 906 module VideoReplaceSourceRequestResumable = struct 907 + module Types = struct 908 + module T = struct 909 + type t = { 910 + filename : string option; (** Video filename including extension *) 911 + } 912 + end 913 + end 914 + 759 915 module T = struct 760 - type t = { 761 - filename : string option; (** Video filename including extension *) 762 - } 916 + include Types.T 763 917 764 918 let v ?filename () = { filename } 765 919 ··· 775 929 end 776 930 777 931 module VideoPrivacySet = struct 932 + module Types = struct 933 + module T = struct 934 + (** privacy id of the video (see [/videos/privacies](#operation/getVideoPrivacyPolicies)) *) 935 + type t = string 936 + end 937 + end 938 + 778 939 module T = struct 779 - (** privacy id of the video (see [/videos/privacies](#operation/getVideoPrivacyPolicies)) *) 780 - type t = string 781 - 940 + include Types.T 782 941 let jsont = Jsont.string 783 942 end 784 943 end 785 944 786 945 module VideoScheduled = struct 946 + module Types = struct 947 + module Update = struct 948 + type t = { 949 + privacy : VideoPrivacySet.T.t option; 950 + update_at : Ptime.t; (** When to update the video *) 951 + } 952 + end 953 + end 954 + 787 955 module Update = struct 788 - type t = { 789 - privacy : VideoPrivacySet.T.t option; 790 - update_at : Ptime.t; (** When to update the video *) 791 - } 956 + include Types.Update 792 957 793 958 let v ~update_at ?privacy () = { privacy; update_at } 794 959 ··· 806 971 end 807 972 808 973 module VideoPrivacyConstant = struct 974 + module Types = struct 975 + module T = struct 976 + type t = { 977 + id : VideoPrivacySet.T.t option; 978 + label : string option; 979 + } 980 + end 981 + end 982 + 809 983 module T = struct 810 - type t = { 811 - id : VideoPrivacySet.T.t option; 812 - label : string option; 813 - } 984 + include Types.T 814 985 815 986 let v ?id ?label () = { id; label } 816 987 ··· 828 999 end 829 1000 830 1001 module LiveVideoReplaySettings = struct 1002 + module Types = struct 1003 + module T = struct 1004 + type t = { 1005 + privacy : VideoPrivacySet.T.t option; 1006 + } 1007 + end 1008 + end 1009 + 831 1010 module T = struct 832 - type t = { 833 - privacy : VideoPrivacySet.T.t option; 834 - } 1011 + include Types.T 835 1012 836 1013 let v ?privacy () = { privacy } 837 1014 ··· 847 1024 end 848 1025 849 1026 module VideoPlaylistTypeSet = struct 1027 + module Types = struct 1028 + module T = struct 1029 + (** The video playlist type (Regular = `1`, Watch Later = `2`) *) 1030 + type t = string 1031 + end 1032 + end 1033 + 850 1034 module T = struct 851 - (** The video playlist type (Regular = `1`, Watch Later = `2`) *) 852 - type t = string 853 - 1035 + include Types.T 854 1036 let jsont = Jsont.string 855 1037 end 856 1038 end 857 1039 858 1040 module VideoPlaylistTypeConstant = struct 1041 + module Types = struct 1042 + module T = struct 1043 + type t = { 1044 + id : VideoPlaylistTypeSet.T.t option; 1045 + label : string option; 1046 + } 1047 + end 1048 + end 1049 + 859 1050 module T = struct 860 - type t = { 861 - id : VideoPlaylistTypeSet.T.t option; 862 - label : string option; 863 - } 1051 + include Types.T 864 1052 865 1053 let v ?id ?label () = { id; label } 866 1054 ··· 878 1066 end 879 1067 880 1068 module VideoPlaylistPrivacySet = struct 1069 + module Types = struct 1070 + module T = struct 1071 + (** Video playlist privacy policy (see [/video-playlists/privacies](#operation/getPlaylistPrivacyPolicies)) *) 1072 + type t = string 1073 + end 1074 + end 1075 + 881 1076 module T = struct 882 - (** Video playlist privacy policy (see [/video-playlists/privacies](#operation/getPlaylistPrivacyPolicies)) *) 883 - type t = string 884 - 1077 + include Types.T 885 1078 let jsont = Jsont.string 886 1079 end 887 1080 end 888 1081 889 1082 module VideoPlaylistPrivacyConstant = struct 1083 + module Types = struct 1084 + module T = struct 1085 + type t = { 1086 + id : VideoPlaylistPrivacySet.T.t option; 1087 + label : string option; 1088 + } 1089 + end 1090 + end 1091 + 890 1092 module T = struct 891 - type t = { 892 - id : VideoPlaylistPrivacySet.T.t option; 893 - label : string option; 894 - } 1093 + include Types.T 895 1094 896 1095 let v ?id ?label () = { id; label } 897 1096 ··· 909 1108 end 910 1109 911 1110 module VideoLicenceSet = struct 1111 + module Types = struct 1112 + module T = struct 1113 + (** licence id of the video (see [/videos/licences](#operation/getLicences)) *) 1114 + type t = Jsont.json 1115 + end 1116 + end 1117 + 912 1118 module T = struct 913 - (** licence id of the video (see [/videos/licences](#operation/getLicences)) *) 914 - type t = Jsont.json 915 - 1119 + include Types.T 916 1120 let jsont = Jsont.json 917 - 918 1121 let v () = Jsont.Null ((), Jsont.Meta.none) 919 1122 end 920 1123 end 921 1124 922 1125 module VideoConstantNumberLicence = struct 1126 + module Types = struct 1127 + module T = struct 1128 + type t = { 1129 + id : VideoLicenceSet.T.t option; 1130 + label : string option; 1131 + } 1132 + end 1133 + end 1134 + 923 1135 module T = struct 924 - type t = { 925 - id : VideoLicenceSet.T.t option; 926 - label : string option; 927 - } 1136 + include Types.T 928 1137 929 1138 let v ?id ?label () = { id; label } 930 1139 ··· 942 1151 end 943 1152 944 1153 module VideoLanguageSet = struct 1154 + module Types = struct 1155 + module T = struct 1156 + (** language id of the video (see [/videos/languages](#operation/getLanguages)) *) 1157 + type t = Jsont.json 1158 + end 1159 + end 1160 + 945 1161 module T = struct 946 - (** language id of the video (see [/videos/languages](#operation/getLanguages)) *) 947 - type t = Jsont.json 948 - 1162 + include Types.T 949 1163 let jsont = Jsont.json 950 - 951 1164 let v () = Jsont.Null ((), Jsont.Meta.none) 952 1165 end 953 1166 end 954 1167 955 1168 module VideoConstantStringLanguage = struct 1169 + module Types = struct 1170 + module T = struct 1171 + type t = { 1172 + id : VideoLanguageSet.T.t option; 1173 + label : string option; 1174 + } 1175 + end 1176 + end 1177 + 956 1178 module T = struct 957 - type t = { 958 - id : VideoLanguageSet.T.t option; 959 - label : string option; 960 - } 1179 + include Types.T 961 1180 962 1181 let v ?id ?label () = { id; label } 963 1182 ··· 975 1194 end 976 1195 977 1196 module VideoCaption = struct 1197 + module Types = struct 1198 + module T = struct 1199 + type t = { 1200 + automatically_generated : bool option; 1201 + caption_path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 1202 + file_url : string option; (** **PeerTube >= 7.1** *) 1203 + language : VideoConstantStringLanguage.T.t option; 1204 + m3u8_url : string option; 1205 + updated_at : Ptime.t option; 1206 + } 1207 + end 1208 + end 1209 + 978 1210 module T = struct 979 - type t = { 980 - automatically_generated : bool option; 981 - caption_path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 982 - file_url : string option; (** **PeerTube >= 7.1** *) 983 - language : VideoConstantStringLanguage.T.t option; 984 - m3u8_url : string option; 985 - updated_at : Ptime.t option; 986 - } 1211 + include Types.T 987 1212 988 1213 let v ?automatically_generated ?caption_path ?file_url ?language ?m3u8_url ?updated_at () = { automatically_generated; caption_path; file_url; language; m3u8_url; updated_at } 989 1214 ··· 1009 1234 end 1010 1235 1011 1236 module VideoImportStateConstant = struct 1237 + module Types = struct 1238 + module T = struct 1239 + type t = { 1240 + id : int option; (** The video import state (Pending = `1`, Success = `2`, Failed = `3`) *) 1241 + label : string option; 1242 + } 1243 + end 1244 + end 1245 + 1012 1246 module T = struct 1013 - type t = { 1014 - id : int option; (** The video import state (Pending = `1`, Success = `2`, Failed = `3`) *) 1015 - label : string option; 1016 - } 1247 + include Types.T 1017 1248 1018 1249 let v ?id ?label () = { id; label } 1019 1250 ··· 1031 1262 end 1032 1263 1033 1264 module VideoCommentsPolicySet = struct 1265 + module Types = struct 1266 + module T = struct 1267 + (** Comments policy of the video (Enabled = `1`, Disabled = `2`, Requires Approval = `3`) *) 1268 + type t = string 1269 + end 1270 + end 1271 + 1034 1272 module T = struct 1035 - (** Comments policy of the video (Enabled = `1`, Disabled = `2`, Requires Approval = `3`) *) 1036 - type t = string 1037 - 1273 + include Types.T 1038 1274 let jsont = Jsont.string 1039 1275 end 1040 1276 end 1041 1277 1042 1278 module VideoCommentsPolicyConstant = struct 1279 + module Types = struct 1280 + module T = struct 1281 + type t = { 1282 + id : VideoCommentsPolicySet.T.t option; 1283 + label : string option; 1284 + } 1285 + end 1286 + end 1287 + 1043 1288 module T = struct 1044 - type t = { 1045 - id : VideoCommentsPolicySet.T.t option; 1046 - label : string option; 1047 - } 1289 + include Types.T 1048 1290 1049 1291 let v ?id ?label () = { id; label } 1050 1292 ··· 1062 1304 end 1063 1305 1064 1306 module VideoCommentsForXml = struct 1307 + module Types = struct 1308 + module T = struct 1309 + type t = Jsont.json 1310 + end 1311 + end 1312 + 1065 1313 module T = struct 1066 - type t = Jsont.json 1067 - 1314 + include Types.T 1068 1315 let jsont = Jsont.json 1069 - 1070 1316 let v () = Jsont.Null ((), Jsont.Meta.none) 1071 1317 end 1072 1318 end 1073 1319 1074 1320 module VideoChapters = struct 1321 + module Types = struct 1322 + module T = struct 1323 + type t = { 1324 + chapters : Jsont.json option; 1325 + } 1326 + end 1327 + end 1328 + 1075 1329 module T = struct 1076 - type t = { 1077 - chapters : Jsont.json option; 1078 - } 1330 + include Types.T 1079 1331 1080 1332 let v ?chapters () = { chapters } 1081 1333 ··· 1108 1360 if Requests.Response.ok response then 1109 1361 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1110 1362 else 1363 + let body = Requests.Response.text response in 1364 + let parsed_body = 1365 + match Jsont_bytesrw.decode_string Jsont.json body with 1366 + | Ok json -> Some (Openapi.Runtime.Json json) 1367 + | Error _ -> Some (Openapi.Runtime.Raw body) 1368 + in 1111 1369 raise (Openapi.Runtime.Api_error { 1112 1370 operation = op_name; 1113 1371 method_ = "GET"; 1114 1372 url; 1115 1373 status = Requests.Response.status_code response; 1116 - body = Requests.Response.text response; 1374 + body; 1375 + parsed_body; 1117 1376 }) 1118 1377 end 1119 1378 1120 1379 module VideoChannelEdit = struct 1380 + module Types = struct 1381 + module T = struct 1382 + type t = { 1383 + description : Jsont.json option; (** Channel description *) 1384 + display_name : Jsont.json option; (** Channel display name *) 1385 + support : Jsont.json option; (** How to support/fund the channel *) 1386 + } 1387 + end 1388 + end 1389 + 1121 1390 module T = struct 1122 - type t = { 1123 - description : Jsont.json option; (** Channel description *) 1124 - display_name : Jsont.json option; (** Channel display name *) 1125 - support : Jsont.json option; (** How to support/fund the channel *) 1126 - } 1391 + include Types.T 1127 1392 1128 1393 let v ?description ?display_name ?support () = { description; display_name; support } 1129 1394 ··· 1143 1408 end 1144 1409 1145 1410 module VideoChannelCollaboratorState = struct 1411 + module Types = struct 1412 + module T = struct 1413 + (** The user import state: 1414 + - `1`: Pending 1415 + - `2`: Accepted 1416 + *) 1417 + type t = string 1418 + end 1419 + end 1420 + 1146 1421 module T = struct 1147 - (** The user import state: 1148 - - `1`: Pending 1149 - - `2`: Accepted 1150 - *) 1151 - type t = string 1152 - 1422 + include Types.T 1153 1423 let jsont = Jsont.string 1154 1424 end 1155 1425 end 1156 1426 1157 1427 module VideoChannelActivityTarget = struct 1428 + module Types = struct 1429 + module T = struct 1430 + (** The activity target: 1431 + - VIDEO: 1, 1432 + - PLAYLIST: 2, 1433 + - CHANNEL: 3, 1434 + - CHANNEL_SYNC: 4, 1435 + - VIDEO_IMPORT: 5 1436 + *) 1437 + type t = string 1438 + end 1439 + end 1440 + 1158 1441 module T = struct 1159 - (** The activity target: 1160 - - VIDEO: 1, 1161 - - PLAYLIST: 2, 1162 - - CHANNEL: 3, 1163 - - CHANNEL_SYNC: 4, 1164 - - VIDEO_IMPORT: 5 1165 - *) 1166 - type t = string 1167 - 1442 + include Types.T 1168 1443 let jsont = Jsont.string 1169 1444 end 1170 1445 end 1171 1446 1172 1447 module VideoChannelActivityAction = struct 1448 + module Types = struct 1449 + module T = struct 1450 + (** The activity action: 1451 + - CREATE: 1 1452 + - UPDATE: 2 1453 + - DELETE: 3 1454 + - UPDATE_CAPTIONS: 4 1455 + - UPDATE_CHAPTERS: 5 1456 + - UPDATE_PASSWORDS: 6 1457 + - CREATE_STUDIO_TASKS: 7 1458 + - UPDATE_SOURCE_FILE: 8 1459 + - UPDATE_ELEMENTS: 9 1460 + - REMOVE_CHANNEL_OWNERSHIP: 10 1461 + - CREATE_CHANNEL_OWNERSHIP: 11 1462 + *) 1463 + type t = string 1464 + end 1465 + end 1466 + 1173 1467 module T = struct 1174 - (** The activity action: 1175 - - CREATE: 1 1176 - - UPDATE: 2 1177 - - DELETE: 3 1178 - - UPDATE_CAPTIONS: 4 1179 - - UPDATE_CHAPTERS: 5 1180 - - UPDATE_PASSWORDS: 6 1181 - - CREATE_STUDIO_TASKS: 7 1182 - - UPDATE_SOURCE_FILE: 8 1183 - - UPDATE_ELEMENTS: 9 1184 - - REMOVE_CHANNEL_OWNERSHIP: 10 1185 - - CREATE_CHANNEL_OWNERSHIP: 11 1186 - *) 1187 - type t = string 1188 - 1468 + include Types.T 1189 1469 let jsont = Jsont.string 1190 1470 end 1191 1471 end 1192 1472 1193 1473 module VideoCategorySet = struct 1474 + module Types = struct 1475 + module T = struct 1476 + (** category id of the video (see [/videos/categories](#operation/getCategories)) *) 1477 + type t = Jsont.json 1478 + end 1479 + end 1480 + 1194 1481 module T = struct 1195 - (** category id of the video (see [/videos/categories](#operation/getCategories)) *) 1196 - type t = Jsont.json 1197 - 1482 + include Types.T 1198 1483 let jsont = Jsont.json 1199 - 1200 1484 let v () = Jsont.Null ((), Jsont.Meta.none) 1201 1485 end 1202 1486 end 1203 1487 1204 1488 module VideoConstantNumberCategory = struct 1489 + module Types = struct 1490 + module T = struct 1491 + type t = { 1492 + id : VideoCategorySet.T.t option; 1493 + label : string option; 1494 + } 1495 + end 1496 + end 1497 + 1205 1498 module T = struct 1206 - type t = { 1207 - id : VideoCategorySet.T.t option; 1208 - label : string option; 1209 - } 1499 + include Types.T 1210 1500 1211 1501 let v ?id ?label () = { id; label } 1212 1502 ··· 1224 1514 end 1225 1515 1226 1516 module Uuidv4 = struct 1517 + module Types = struct 1518 + module T = struct 1519 + type t = Jsont.json 1520 + end 1521 + end 1522 + 1227 1523 module T = struct 1228 - type t = Jsont.json 1229 - 1524 + include Types.T 1230 1525 let jsont = Jsont.json 1231 - 1232 1526 let v () = Jsont.Null ((), Jsont.Meta.none) 1233 1527 end 1234 1528 end 1235 1529 1236 1530 module UsernameChannel = struct 1531 + module Types = struct 1532 + module T = struct 1533 + (** immutable name of the channel, used to interact with its actor *) 1534 + type t = Jsont.json 1535 + end 1536 + end 1537 + 1237 1538 module T = struct 1238 - (** immutable name of the channel, used to interact with its actor *) 1239 - type t = Jsont.json 1240 - 1539 + include Types.T 1241 1540 let jsont = Jsont.json 1242 - 1243 1541 let v () = Jsont.Null ((), Jsont.Meta.none) 1244 1542 end 1245 1543 end 1246 1544 1247 1545 module Username = struct 1546 + module Types = struct 1547 + module T = struct 1548 + (** immutable name of the user, used to find or mention its actor *) 1549 + type t = Jsont.json 1550 + end 1551 + end 1552 + 1248 1553 module T = struct 1249 - (** immutable name of the user, used to find or mention its actor *) 1250 - type t = Jsont.json 1251 - 1554 + include Types.T 1252 1555 let jsont = Jsont.json 1253 - 1254 1556 let v () = Jsont.Null ((), Jsont.Meta.none) 1255 1557 end 1256 1558 end 1257 1559 1258 1560 module UserRole = struct 1561 + module Types = struct 1562 + module T = struct 1563 + (** The user role (Admin = `0`, Moderator = `1`, User = `2`) *) 1564 + type t = string 1565 + end 1566 + end 1567 + 1259 1568 module T = struct 1260 - (** The user role (Admin = `0`, Moderator = `1`, User = `2`) *) 1261 - type t = string 1262 - 1569 + include Types.T 1263 1570 let jsont = Jsont.string 1264 1571 end 1265 1572 end 1266 1573 1267 1574 module UserRegistrationAcceptOrReject = struct 1575 + module Types = struct 1576 + module T = struct 1577 + type t = { 1578 + moderation_response : string; (** Moderation response to send to the user *) 1579 + prevent_email_delivery : bool option; (** Set it to true if you don't want PeerTube to send an email to the user *) 1580 + } 1581 + end 1582 + end 1583 + 1268 1584 module T = struct 1269 - type t = { 1270 - moderation_response : string; (** Moderation response to send to the user *) 1271 - prevent_email_delivery : bool option; (** Set it to true if you don't want PeerTube to send an email to the user *) 1272 - } 1585 + include Types.T 1273 1586 1274 1587 let v ~moderation_response ?prevent_email_delivery () = { moderation_response; prevent_email_delivery } 1275 1588 ··· 1287 1600 end 1288 1601 1289 1602 module UserImportState = struct 1603 + module Types = struct 1604 + module T = struct 1605 + (** The user import state: 1606 + - `1`: Pending 1607 + - `2`: Processing 1608 + - `3`: Completed 1609 + - `4`: Errored 1610 + *) 1611 + type t = string 1612 + end 1613 + end 1614 + 1290 1615 module T = struct 1291 - (** The user import state: 1292 - - `1`: Pending 1293 - - `2`: Processing 1294 - - `3`: Completed 1295 - - `4`: Errored 1296 - *) 1297 - type t = string 1298 - 1616 + include Types.T 1299 1617 let jsont = Jsont.string 1300 1618 end 1301 1619 end 1302 1620 1303 1621 module UserImportResumable = struct 1622 + module Types = struct 1623 + module T = struct 1624 + type t = { 1625 + filename : string option; (** Archive filename including extension *) 1626 + } 1627 + end 1628 + end 1629 + 1304 1630 module T = struct 1305 - type t = { 1306 - filename : string option; (** Archive filename including extension *) 1307 - } 1631 + include Types.T 1308 1632 1309 1633 let v ?filename () = { filename } 1310 1634 ··· 1320 1644 end 1321 1645 1322 1646 module UserExportState = struct 1647 + module Types = struct 1648 + module T = struct 1649 + (** The user export state: 1650 + - `1`: Pending 1651 + - `2`: Processing 1652 + - `3`: Completed 1653 + - `4`: Errored 1654 + *) 1655 + type t = string 1656 + end 1657 + end 1658 + 1323 1659 module T = struct 1324 - (** The user export state: 1325 - - `1`: Pending 1326 - - `2`: Processing 1327 - - `3`: Completed 1328 - - `4`: Errored 1329 - *) 1330 - type t = string 1331 - 1660 + include Types.T 1332 1661 let jsont = Jsont.string 1333 1662 end 1334 1663 end 1335 1664 1336 1665 module UserAdminFlags = struct 1666 + module Types = struct 1667 + module T = struct 1668 + (** Admin flags for the user (None = `0`, Bypass video blocklist = `1`) *) 1669 + type t = string 1670 + end 1671 + end 1672 + 1337 1673 module T = struct 1338 - (** Admin flags for the user (None = `0`, Bypass video blocklist = `1`) *) 1339 - type t = string 1340 - 1674 + include Types.T 1341 1675 let jsont = Jsont.string 1342 1676 end 1343 1677 end 1344 1678 1345 1679 module TokenSession = struct 1680 + module Types = struct 1681 + module T = struct 1682 + type t = { 1683 + created_at : Ptime.t option; 1684 + current_session : bool option; (** Is this session the current one? *) 1685 + id : int option; 1686 + last_activity_date : Ptime.t option; 1687 + last_activity_device : string option; 1688 + last_activity_ip : string option; 1689 + login_date : Ptime.t option; (** Date of the login *) 1690 + login_device : string option; (** Device used to login *) 1691 + login_ip : string option; (** IP address used to login *) 1692 + } 1693 + end 1694 + end 1695 + 1346 1696 module T = struct 1347 - type t = { 1348 - created_at : Ptime.t option; 1349 - current_session : bool option; (** Is this session the current one? *) 1350 - id : int option; 1351 - last_activity_date : Ptime.t option; 1352 - last_activity_device : string option; 1353 - last_activity_ip : string option; 1354 - login_date : Ptime.t option; (** Date of the login *) 1355 - login_device : string option; (** Device used to login *) 1356 - login_ip : string option; (** IP address used to login *) 1357 - } 1697 + include Types.T 1358 1698 1359 1699 let v ?created_at ?current_session ?id ?last_activity_date ?last_activity_device ?last_activity_ip ?login_date ?login_device ?login_ip () = { created_at; current_session; id; last_activity_date; last_activity_device; last_activity_ip; login_date; login_device; login_ip } 1360 1700 ··· 1386 1726 end 1387 1727 1388 1728 module Storyboard = struct 1729 + module Types = struct 1730 + module T = struct 1731 + type t = { 1732 + file_url : string option; (** **PeerTube >= 7.1** *) 1733 + sprite_duration : int option; 1734 + sprite_height : int option; 1735 + sprite_width : int option; 1736 + storyboard_path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 1737 + total_height : int option; 1738 + total_width : int option; 1739 + } 1740 + end 1741 + end 1742 + 1389 1743 module T = struct 1390 - type t = { 1391 - file_url : string option; (** **PeerTube >= 7.1** *) 1392 - sprite_duration : int option; 1393 - sprite_height : int option; 1394 - sprite_width : int option; 1395 - storyboard_path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 1396 - total_height : int option; 1397 - total_width : int option; 1398 - } 1744 + include Types.T 1399 1745 1400 1746 let v ?file_url ?sprite_duration ?sprite_height ?sprite_width ?storyboard_path ?total_height ?total_width () = { file_url; sprite_duration; sprite_height; sprite_width; storyboard_path; total_height; total_width } 1401 1747 ··· 1423 1769 end 1424 1770 1425 1771 module ShortUuid = struct 1772 + module Types = struct 1773 + module T = struct 1774 + (** translation of a uuid v4 with a bigger alphabet to have a shorter uuid *) 1775 + type t = Jsont.json 1776 + end 1777 + end 1778 + 1426 1779 module T = struct 1427 - (** translation of a uuid v4 with a bigger alphabet to have a shorter uuid *) 1428 - type t = Jsont.json 1429 - 1780 + include Types.T 1430 1781 let jsont = Jsont.json 1431 - 1432 1782 let v () = Jsont.Null ((), Jsont.Meta.none) 1433 1783 end 1434 1784 end 1435 1785 1436 1786 module ServerStats = struct 1787 + module Types = struct 1788 + module T = struct 1789 + type t = { 1790 + activity_pub_messages_processed_per_second : float option; 1791 + average_abuse_response_time_ms : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled abuses stats *) 1792 + average_registration_request_response_time_ms : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled registration requests stats *) 1793 + total_abuses : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled abuses stats *) 1794 + total_abuses_processed : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled abuses stats *) 1795 + total_activity_pub_messages_errors : float option; 1796 + total_activity_pub_messages_processed : float option; 1797 + total_activity_pub_messages_successes : float option; 1798 + total_activity_pub_messages_waiting : float option; 1799 + total_admins : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled total admins stats *) 1800 + total_daily_active_users : float option; 1801 + total_instance_followers : float option; 1802 + total_instance_following : float option; 1803 + total_local_daily_active_video_channels : float option; 1804 + total_local_monthly_active_video_channels : float option; 1805 + total_local_playlists : float option; 1806 + total_local_video_channels : float option; 1807 + total_local_video_comments : float option; (** Total comments made by local users *) 1808 + total_local_video_files_size : float option; 1809 + total_local_video_views : float option; (** Total video views made on the instance *) 1810 + total_local_videos : float option; 1811 + total_local_weekly_active_video_channels : float option; 1812 + total_moderators : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled total moderators stats *) 1813 + total_monthly_active_users : float option; 1814 + total_registration_requests : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled registration requests stats *) 1815 + total_registration_requests_processed : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled registration requests stats *) 1816 + total_users : float option; 1817 + total_video_comments : float option; 1818 + total_videos : float option; 1819 + total_weekly_active_users : float option; 1820 + videos_redundancy : Jsont.json list option; 1821 + } 1822 + end 1823 + end 1824 + 1437 1825 module T = struct 1438 - type t = { 1439 - activity_pub_messages_processed_per_second : float option; 1440 - average_abuse_response_time_ms : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled abuses stats *) 1441 - average_registration_request_response_time_ms : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled registration requests stats *) 1442 - total_abuses : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled abuses stats *) 1443 - total_abuses_processed : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled abuses stats *) 1444 - total_activity_pub_messages_errors : float option; 1445 - total_activity_pub_messages_processed : float option; 1446 - total_activity_pub_messages_successes : float option; 1447 - total_activity_pub_messages_waiting : float option; 1448 - total_admins : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled total admins stats *) 1449 - total_daily_active_users : float option; 1450 - total_instance_followers : float option; 1451 - total_instance_following : float option; 1452 - total_local_daily_active_video_channels : float option; 1453 - total_local_monthly_active_video_channels : float option; 1454 - total_local_playlists : float option; 1455 - total_local_video_channels : float option; 1456 - total_local_video_comments : float option; (** Total comments made by local users *) 1457 - total_local_video_files_size : float option; 1458 - total_local_video_views : float option; (** Total video views made on the instance *) 1459 - total_local_videos : float option; 1460 - total_local_weekly_active_video_channels : float option; 1461 - total_moderators : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled total moderators stats *) 1462 - total_monthly_active_users : float option; 1463 - total_registration_requests : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled registration requests stats *) 1464 - total_registration_requests_processed : float option; (** **PeerTube >= 6.1** Value is null if the admin disabled registration requests stats *) 1465 - total_users : float option; 1466 - total_video_comments : float option; 1467 - total_videos : float option; 1468 - total_weekly_active_users : float option; 1469 - videos_redundancy : Jsont.json list option; 1470 - } 1826 + include Types.T 1471 1827 1472 1828 let v ?activity_pub_messages_processed_per_second ?average_abuse_response_time_ms ?average_registration_request_response_time_ms ?total_abuses ?total_abuses_processed ?total_activity_pub_messages_errors ?total_activity_pub_messages_processed ?total_activity_pub_messages_successes ?total_activity_pub_messages_waiting ?total_admins ?total_daily_active_users ?total_instance_followers ?total_instance_following ?total_local_daily_active_video_channels ?total_local_monthly_active_video_channels ?total_local_playlists ?total_local_video_channels ?total_local_video_comments ?total_local_video_files_size ?total_local_video_views ?total_local_videos ?total_local_weekly_active_video_channels ?total_moderators ?total_monthly_active_users ?total_registration_requests ?total_registration_requests_processed ?total_users ?total_video_comments ?total_videos ?total_weekly_active_users ?videos_redundancy () = { activity_pub_messages_processed_per_second; average_abuse_response_time_ms; average_registration_request_response_time_ms; total_abuses; total_abuses_processed; total_activity_pub_messages_errors; total_activity_pub_messages_processed; total_activity_pub_messages_successes; total_activity_pub_messages_waiting; total_admins; total_daily_active_users; total_instance_followers; total_instance_following; total_local_daily_active_video_channels; total_local_monthly_active_video_channels; total_local_playlists; total_local_video_channels; total_local_video_comments; total_local_video_files_size; total_local_video_views; total_local_videos; total_local_weekly_active_video_channels; total_moderators; total_monthly_active_users; total_registration_requests; total_registration_requests_processed; total_users; total_video_comments; total_videos; total_weekly_active_users; videos_redundancy } 1473 1829 ··· 1558 1914 if Requests.Response.ok response then 1559 1915 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1560 1916 else 1917 + let body = Requests.Response.text response in 1918 + let parsed_body = 1919 + match Jsont_bytesrw.decode_string Jsont.json body with 1920 + | Ok json -> Some (Openapi.Runtime.Json json) 1921 + | Error _ -> Some (Openapi.Runtime.Raw body) 1922 + in 1561 1923 raise (Openapi.Runtime.Api_error { 1562 1924 operation = op_name; 1563 1925 method_ = "GET"; 1564 1926 url; 1565 1927 status = Requests.Response.status_code response; 1566 - body = Requests.Response.text response; 1928 + body; 1929 + parsed_body; 1567 1930 }) 1568 1931 end 1569 1932 1570 1933 module ServerError = struct 1934 + module Types = struct 1935 + module T = struct 1936 + type t = { 1937 + code : string option; 1938 + detail : string option; 1939 + status : int option; 1940 + type_ : string option; 1941 + } 1942 + end 1943 + end 1944 + 1571 1945 module T = struct 1572 - type t = { 1573 - code : string option; 1574 - detail : string option; 1575 - status : int option; 1576 - type_ : string option; 1577 - } 1946 + include Types.T 1578 1947 1579 1948 let v ?code ?detail ?status ?type_ () = { code; detail; status; type_ } 1580 1949 ··· 1596 1965 end 1597 1966 1598 1967 module ServerConfigCustom = struct 1968 + module Types = struct 1969 + module T = struct 1970 + type t = { 1971 + admin : Jsont.json option; 1972 + auto_blacklist : Jsont.json option; 1973 + cache : Jsont.json option; 1974 + contact_form : Jsont.json option; 1975 + defaults : Jsont.json option; 1976 + followers : Jsont.json option; 1977 + import : Jsont.json option; 1978 + instance : Jsont.json option; 1979 + services : Jsont.json option; 1980 + signup : Jsont.json option; 1981 + storyboard : Jsont.json option; 1982 + theme : Jsont.json option; 1983 + transcoding : Jsont.json option; (** Settings pertaining to transcoding jobs *) 1984 + user : Jsont.json option; (** Settings that apply to new users, if registration is enabled *) 1985 + } 1986 + end 1987 + end 1988 + 1599 1989 module T = struct 1600 - type t = { 1601 - admin : Jsont.json option; 1602 - auto_blacklist : Jsont.json option; 1603 - cache : Jsont.json option; 1604 - contact_form : Jsont.json option; 1605 - defaults : Jsont.json option; 1606 - followers : Jsont.json option; 1607 - import : Jsont.json option; 1608 - instance : Jsont.json option; 1609 - services : Jsont.json option; 1610 - signup : Jsont.json option; 1611 - storyboard : Jsont.json option; 1612 - theme : Jsont.json option; 1613 - transcoding : Jsont.json option; (** Settings pertaining to transcoding jobs *) 1614 - user : Jsont.json option; (** Settings that apply to new users, if registration is enabled *) 1615 - } 1990 + include Types.T 1616 1991 1617 1992 let v ?admin ?auto_blacklist ?cache ?contact_form ?defaults ?followers ?import ?instance ?services ?signup ?storyboard ?theme ?transcoding ?user () = { admin; auto_blacklist; cache; contact_form; defaults; followers; import; instance; services; signup; storyboard; theme; transcoding; user } 1618 1993 ··· 1667 2042 if Requests.Response.ok response then 1668 2043 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1669 2044 else 2045 + let body = Requests.Response.text response in 2046 + let parsed_body = 2047 + match Jsont_bytesrw.decode_string Jsont.json body with 2048 + | Ok json -> Some (Openapi.Runtime.Json json) 2049 + | Error _ -> Some (Openapi.Runtime.Raw body) 2050 + in 1670 2051 raise (Openapi.Runtime.Api_error { 1671 2052 operation = op_name; 1672 2053 method_ = "GET"; 1673 2054 url; 1674 2055 status = Requests.Response.status_code response; 1675 - body = Requests.Response.text response; 2056 + body; 2057 + parsed_body; 1676 2058 }) 1677 2059 end 1678 2060 1679 2061 module ServerConfigAbout = struct 2062 + module Types = struct 2063 + module T = struct 2064 + type t = { 2065 + instance : Jsont.json option; 2066 + } 2067 + end 2068 + end 2069 + 1680 2070 module T = struct 1681 - type t = { 1682 - instance : Jsont.json option; 1683 - } 2071 + include Types.T 1684 2072 1685 2073 let v ?instance () = { instance } 1686 2074 ··· 1709 2097 if Requests.Response.ok response then 1710 2098 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 1711 2099 else 2100 + let body = Requests.Response.text response in 2101 + let parsed_body = 2102 + match Jsont_bytesrw.decode_string Jsont.json body with 2103 + | Ok json -> Some (Openapi.Runtime.Json json) 2104 + | Error _ -> Some (Openapi.Runtime.Raw body) 2105 + in 1712 2106 raise (Openapi.Runtime.Api_error { 1713 2107 operation = op_name; 1714 2108 method_ = "GET"; 1715 2109 url; 1716 2110 status = Requests.Response.status_code response; 1717 - body = Requests.Response.text response; 2111 + body; 2112 + parsed_body; 1718 2113 }) 1719 2114 end 1720 2115 1721 2116 module Server = struct 2117 + module Types = struct 2118 + module Config = struct 2119 + type t = { 2120 + auto_blacklist : Jsont.json option; 2121 + avatar : Jsont.json option; 2122 + contact_form : Jsont.json option; 2123 + email : Jsont.json option; 2124 + export : Jsont.json option; 2125 + federation : Jsont.json option; 2126 + followings : Jsont.json option; 2127 + homepage : Jsont.json option; 2128 + import : Jsont.json option; 2129 + instance : Jsont.json option; 2130 + open_telemetry : Jsont.json option; (** PeerTube >= 6.1 *) 2131 + plugin : Jsont.json option; 2132 + search : Jsont.json option; 2133 + server_commit : string option; 2134 + server_version : string option; 2135 + signup : Jsont.json option; 2136 + theme : Jsont.json option; 2137 + tracker : Jsont.json option; 2138 + transcoding : Jsont.json option; 2139 + trending : Jsont.json option; 2140 + user : Jsont.json option; 2141 + video : Jsont.json option; 2142 + video_caption : Jsont.json option; 2143 + views : Jsont.json option; (** PeerTube >= 6.1 *) 2144 + } 2145 + end 2146 + end 2147 + 1722 2148 module Config = struct 1723 - type t = { 1724 - auto_blacklist : Jsont.json option; 1725 - avatar : Jsont.json option; 1726 - contact_form : Jsont.json option; 1727 - email : Jsont.json option; 1728 - export : Jsont.json option; 1729 - federation : Jsont.json option; 1730 - followings : Jsont.json option; 1731 - homepage : Jsont.json option; 1732 - import : Jsont.json option; 1733 - instance : Jsont.json option; 1734 - open_telemetry : Jsont.json option; (** PeerTube >= 6.1 *) 1735 - plugin : Jsont.json option; 1736 - search : Jsont.json option; 1737 - server_commit : string option; 1738 - server_version : string option; 1739 - signup : Jsont.json option; 1740 - theme : Jsont.json option; 1741 - tracker : Jsont.json option; 1742 - transcoding : Jsont.json option; 1743 - trending : Jsont.json option; 1744 - user : Jsont.json option; 1745 - video : Jsont.json option; 1746 - video_caption : Jsont.json option; 1747 - views : Jsont.json option; (** PeerTube >= 6.1 *) 1748 - } 2149 + include Types.Config 1749 2150 1750 2151 let v ?auto_blacklist ?avatar ?contact_form ?email ?export ?federation ?followings ?homepage ?import ?instance ?open_telemetry ?plugin ?search ?server_commit ?server_version ?signup ?theme ?tracker ?transcoding ?trending ?user ?video ?video_caption ?views () = { auto_blacklist; avatar; contact_form; email; export; federation; followings; homepage; import; instance; open_telemetry; plugin; search; server_commit; server_version; signup; theme; tracker; transcoding; trending; user; video; video_caption; views } 1751 2152 ··· 1820 2221 if Requests.Response.ok response then 1821 2222 Openapi.Runtime.Json.decode_json_exn Config.jsont (Requests.Response.json response) 1822 2223 else 2224 + let body = Requests.Response.text response in 2225 + let parsed_body = 2226 + match Jsont_bytesrw.decode_string Jsont.json body with 2227 + | Ok json -> Some (Openapi.Runtime.Json json) 2228 + | Error _ -> Some (Openapi.Runtime.Raw body) 2229 + in 1823 2230 raise (Openapi.Runtime.Api_error { 1824 2231 operation = op_name; 1825 2232 method_ = "GET"; 1826 2233 url; 1827 2234 status = Requests.Response.status_code response; 1828 - body = Requests.Response.text response; 2235 + body; 2236 + parsed_body; 1829 2237 }) 1830 2238 end 1831 2239 1832 2240 module SendClientLog = struct 2241 + module Types = struct 2242 + module T = struct 2243 + type t = { 2244 + level : Jsont.json; 2245 + message : string; 2246 + meta : string option; (** Additional information regarding this log *) 2247 + stack_trace : string option; (** Stack trace of the error if there is one *) 2248 + url : string; (** URL of the current user page *) 2249 + user_agent : string option; (** User agent of the web browser that sends the message *) 2250 + } 2251 + end 2252 + end 2253 + 1833 2254 module T = struct 1834 - type t = { 1835 - level : Jsont.json; 1836 - message : string; 1837 - meta : string option; (** Additional information regarding this log *) 1838 - stack_trace : string option; (** Stack trace of the error if there is one *) 1839 - url : string; (** URL of the current user page *) 1840 - user_agent : string option; (** User agent of the web browser that sends the message *) 1841 - } 2255 + include Types.T 1842 2256 1843 2257 let v ~level ~message ~url ?meta ?stack_trace ?user_agent () = { level; message; meta; stack_trace; url; user_agent } 1844 2258 ··· 1864 2278 end 1865 2279 1866 2280 module RunnerRegistrationToken = struct 2281 + module Types = struct 2282 + module T = struct 2283 + type t = { 2284 + created_at : Ptime.t option; 2285 + id : int option; 2286 + registered_runners_count : int option; 2287 + registration_token : string option; 2288 + updated_at : Ptime.t option; 2289 + } 2290 + end 2291 + end 2292 + 1867 2293 module T = struct 1868 - type t = { 1869 - created_at : Ptime.t option; 1870 - id : int option; 1871 - registered_runners_count : int option; 1872 - registration_token : string option; 1873 - updated_at : Ptime.t option; 1874 - } 2294 + include Types.T 1875 2295 1876 2296 let v ?created_at ?id ?registered_runners_count ?registration_token ?updated_at () = { created_at; id; registered_runners_count; registration_token; updated_at } 1877 2297 ··· 1895 2315 end 1896 2316 1897 2317 module RunnerJobState = struct 2318 + module Types = struct 2319 + module T = struct 2320 + (** The runner job state: 2321 + - `1` Pending 2322 + - `2` Processing 2323 + - `3` Completed 2324 + - `4` Errored 2325 + - `5` Waiting for a parent job 2326 + - `6` Cancelled 2327 + - `7` Parent had an error 2328 + - `8` Parent has been cancelled 2329 + *) 2330 + type t = string 2331 + end 2332 + end 2333 + 1898 2334 module T = struct 1899 - (** The runner job state: 1900 - - `1` Pending 1901 - - `2` Processing 1902 - - `3` Completed 1903 - - `4` Errored 1904 - - `5` Waiting for a parent job 1905 - - `6` Cancelled 1906 - - `7` Parent had an error 1907 - - `8` Parent has been cancelled 1908 - *) 1909 - type t = string 1910 - 2335 + include Types.T 1911 2336 let jsont = Jsont.string 1912 2337 end 1913 2338 end 1914 2339 1915 2340 module RunnerJobStateConstant = struct 2341 + module Types = struct 2342 + module T = struct 2343 + type t = { 2344 + id : RunnerJobState.T.t option; 2345 + label : string option; 2346 + } 2347 + end 2348 + end 2349 + 1916 2350 module T = struct 1917 - type t = { 1918 - id : RunnerJobState.T.t option; 1919 - label : string option; 1920 - } 2351 + include Types.T 1921 2352 1922 2353 let v ?id ?label () = { id; label } 1923 2354 ··· 1935 2366 end 1936 2367 1937 2368 module RunnerJobPayload = struct 2369 + module Types = struct 2370 + module T = struct 2371 + type t = Jsont.json 2372 + end 2373 + end 2374 + 1938 2375 module T = struct 1939 - type t = Jsont.json 1940 - 2376 + include Types.T 1941 2377 let jsont = Jsont.json 1942 - 1943 2378 let v () = Jsont.Null ((), Jsont.Meta.none) 1944 2379 end 1945 2380 end 1946 2381 1947 2382 module RunnerJob = struct 2383 + module Types = struct 2384 + module Type = struct 2385 + type t = [ 2386 + | `Vod_web_video_transcoding 2387 + | `Vod_hls_transcoding 2388 + | `Vod_audio_merge_transcoding 2389 + | `Live_rtmp_hls_transcoding 2390 + ] 2391 + end 2392 + 2393 + module T = struct 2394 + type t = { 2395 + created_at : Ptime.t option; 2396 + error : string option; (** Error message if the job is errored *) 2397 + failures : int option; (** Number of times a remote runner failed to process this job. After too many failures, the job in "error" state *) 2398 + finished_at : Ptime.t option; 2399 + parent : Jsont.json option; (** If job has a parent job *) 2400 + payload : RunnerJobPayload.T.t option; 2401 + priority : int option; (** Job priority (less has more priority) *) 2402 + progress : int option; (** Percentage progress *) 2403 + runner : Jsont.json option; (** If job is associated to a runner *) 2404 + started_at : Ptime.t option; 2405 + state : RunnerJobStateConstant.T.t option; 2406 + type_ : Type.t option; 2407 + updated_at : Ptime.t option; 2408 + uuid : Uuidv4.T.t option; 2409 + } 2410 + end 2411 + end 2412 + 1948 2413 module Type = struct 1949 - type t = [ 1950 - | `Vod_web_video_transcoding 1951 - | `Vod_hls_transcoding 1952 - | `Vod_audio_merge_transcoding 1953 - | `Live_rtmp_hls_transcoding 1954 - ] 2414 + include Types.Type 1955 2415 1956 2416 let jsont : t Jsont.t = 1957 2417 Jsont.map Jsont.string ~kind:"RunnerJobType" ··· 1969 2429 end 1970 2430 1971 2431 module T = struct 1972 - type t = { 1973 - created_at : Ptime.t option; 1974 - error : string option; (** Error message if the job is errored *) 1975 - failures : int option; (** Number of times a remote runner failed to process this job. After too many failures, the job in "error" state *) 1976 - finished_at : Ptime.t option; 1977 - parent : Jsont.json option; (** If job has a parent job *) 1978 - payload : RunnerJobPayload.T.t option; 1979 - priority : int option; (** Job priority (less has more priority) *) 1980 - progress : int option; (** Percentage progress *) 1981 - runner : Jsont.json option; (** If job is associated to a runner *) 1982 - started_at : Ptime.t option; 1983 - state : RunnerJobStateConstant.T.t option; 1984 - type_ : Type.t option; 1985 - updated_at : Ptime.t option; 1986 - uuid : Uuidv4.T.t option; 1987 - } 2432 + include Types.T 1988 2433 1989 2434 let v ?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 } 1990 2435 ··· 2029 2474 end 2030 2475 2031 2476 module RunnerJobAdmin = struct 2477 + module Types = struct 2478 + module T = struct 2479 + type t = { 2480 + created_at : Ptime.t option; 2481 + error : string option; (** Error message if the job is errored *) 2482 + failures : int option; (** Number of times a remote runner failed to process this job. After too many failures, the job in "error" state *) 2483 + finished_at : Ptime.t option; 2484 + parent : Jsont.json option; (** If job has a parent job *) 2485 + payload : RunnerJobPayload.T.t option; 2486 + priority : int option; (** Job priority (less has more priority) *) 2487 + progress : int option; (** Percentage progress *) 2488 + runner : Jsont.json option; (** If job is associated to a runner *) 2489 + started_at : Ptime.t option; 2490 + state : RunnerJobStateConstant.T.t option; 2491 + type_ : RunnerJob.Type.t option; 2492 + updated_at : Ptime.t option; 2493 + uuid : Uuidv4.T.t option; 2494 + private_payload : Jsont.json option; 2495 + } 2496 + end 2497 + end 2498 + 2032 2499 module T = struct 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 - } 2500 + include Types.T 2050 2501 2051 2502 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 2503 ··· 2093 2544 end 2094 2545 2095 2546 module Runner = struct 2547 + module Types = struct 2548 + module T = struct 2549 + type t = { 2550 + created_at : Ptime.t option; 2551 + description : string option; 2552 + id : int option; 2553 + ip : string option; 2554 + last_contact : Ptime.t option; 2555 + name : string option; 2556 + updated_at : Ptime.t option; 2557 + } 2558 + end 2559 + end 2560 + 2096 2561 module T = struct 2097 - type t = { 2098 - created_at : Ptime.t option; 2099 - description : string option; 2100 - id : int option; 2101 - ip : string option; 2102 - last_contact : Ptime.t option; 2103 - name : string option; 2104 - updated_at : Ptime.t option; 2105 - } 2562 + include Types.T 2106 2563 2107 2564 let v ?created_at ?description ?id ?ip ?last_contact ?name ?updated_at () = { created_at; description; id; ip; last_contact; name; updated_at } 2108 2565 ··· 2130 2587 end 2131 2588 2132 2589 module RequestTwoFactor = struct 2590 + module Types = struct 2591 + module Response = struct 2592 + type t = { 2593 + otp_request : Jsont.json option; 2594 + } 2595 + end 2596 + end 2597 + 2133 2598 module Response = struct 2134 - type t = { 2135 - otp_request : Jsont.json option; 2136 - } 2599 + include Types.Response 2137 2600 2138 2601 let v ?otp_request () = { otp_request } 2139 2602 ··· 2166 2629 if Requests.Response.ok response then 2167 2630 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 2168 2631 else 2632 + let body = Requests.Response.text response in 2633 + let parsed_body = 2634 + match Jsont_bytesrw.decode_string Jsont.json body with 2635 + | Ok json -> Some (Openapi.Runtime.Json json) 2636 + | Error _ -> Some (Openapi.Runtime.Raw body) 2637 + in 2169 2638 raise (Openapi.Runtime.Api_error { 2170 2639 operation = op_name; 2171 2640 method_ = "POST"; 2172 2641 url; 2173 2642 status = Requests.Response.status_code response; 2174 - body = Requests.Response.text response; 2643 + body; 2644 + parsed_body; 2175 2645 }) 2176 2646 end 2177 2647 2178 2648 module PredefinedAbuseReasons = struct 2649 + module Types = struct 2650 + module T = struct 2651 + (** Reason categories that help triage reports *) 2652 + type t = Jsont.json 2653 + end 2654 + end 2655 + 2179 2656 module T = struct 2180 - (** Reason categories that help triage reports *) 2181 - type t = Jsont.json 2182 - 2657 + include Types.T 2183 2658 let jsont = Jsont.json 2184 - 2185 2659 let v () = Jsont.Null ((), Jsont.Meta.none) 2186 2660 end 2187 2661 end 2188 2662 2189 2663 module Plugin = struct 2664 + module Types = struct 2665 + module T = struct 2666 + type t = { 2667 + created_at : Ptime.t option; 2668 + description : string option; 2669 + enabled : bool option; 2670 + homepage : string option; 2671 + latest_version : string option; 2672 + name : string option; 2673 + peertube_engine : string option; 2674 + settings : Jsont.json option; 2675 + type_ : int option; (** - `1`: PLUGIN 2676 + - `2`: THEME 2677 + *) 2678 + uninstalled : bool option; 2679 + updated_at : Ptime.t option; 2680 + version : string option; 2681 + } 2682 + end 2683 + 2684 + module Response = struct 2685 + type t = { 2686 + data : T.t list option; 2687 + total : int option; 2688 + } 2689 + end 2690 + end 2691 + 2190 2692 module T = struct 2191 - type t = { 2192 - created_at : Ptime.t option; 2193 - description : string option; 2194 - enabled : bool option; 2195 - homepage : string option; 2196 - latest_version : string option; 2197 - name : string option; 2198 - peertube_engine : string option; 2199 - settings : Jsont.json option; 2200 - type_ : int option; (** - `1`: PLUGIN 2201 - - `2`: THEME 2202 - *) 2203 - uninstalled : bool option; 2204 - updated_at : Ptime.t option; 2205 - version : string option; 2206 - } 2693 + include Types.T 2207 2694 2208 2695 let v ?created_at ?description ?enabled ?homepage ?latest_version ?name ?peertube_engine ?settings ?type_ ?uninstalled ?updated_at ?version () = { created_at; description; enabled; homepage; latest_version; name; peertube_engine; settings; type_; uninstalled; updated_at; version } 2209 2696 ··· 2240 2727 end 2241 2728 2242 2729 module Response = struct 2243 - type t = { 2244 - data : T.t list option; 2245 - total : int option; 2246 - } 2730 + include Types.Response 2247 2731 2248 2732 let v ?data ?total () = { data; total } 2249 2733 ··· 2253 2737 let jsont : t Jsont.t = 2254 2738 Jsont.Object.map ~kind:"PluginResponse" 2255 2739 (fun data total -> { data; total }) 2256 - |> Jsont.Object.opt_mem "data" (Jsont.list T.jsont) ~enc:(fun r -> r.data) 2740 + |> Jsont.Object.opt_mem "data" (Openapi.Runtime.validated_list ~max_items:100 T.jsont) ~enc:(fun r -> r.data) 2257 2741 |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 2258 2742 |> Jsont.Object.skip_unknown 2259 2743 |> Jsont.Object.finish ··· 2278 2762 if Requests.Response.ok response then 2279 2763 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 2280 2764 else 2765 + let body = Requests.Response.text response in 2766 + let parsed_body = 2767 + match Jsont_bytesrw.decode_string Jsont.json body with 2768 + | Ok json -> Some (Openapi.Runtime.Json json) 2769 + | Error _ -> Some (Openapi.Runtime.Raw body) 2770 + in 2281 2771 raise (Openapi.Runtime.Api_error { 2282 2772 operation = op_name; 2283 2773 method_ = "GET"; 2284 2774 url; 2285 2775 status = Requests.Response.status_code response; 2286 - body = Requests.Response.text response; 2776 + body; 2777 + parsed_body; 2287 2778 }) 2288 2779 2289 2780 (** List available plugins ··· 2305 2796 if Requests.Response.ok response then 2306 2797 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 2307 2798 else 2799 + let body = Requests.Response.text response in 2800 + let parsed_body = 2801 + match Jsont_bytesrw.decode_string Jsont.json body with 2802 + | Ok json -> Some (Openapi.Runtime.Json json) 2803 + | Error _ -> Some (Openapi.Runtime.Raw body) 2804 + in 2308 2805 raise (Openapi.Runtime.Api_error { 2309 2806 operation = op_name; 2310 2807 method_ = "GET"; 2311 2808 url; 2312 2809 status = Requests.Response.status_code response; 2313 - body = Requests.Response.text response; 2810 + body; 2811 + parsed_body; 2314 2812 }) 2315 2813 2316 2814 (** Get a plugin ··· 2330 2828 if Requests.Response.ok response then 2331 2829 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 2332 2830 else 2831 + let body = Requests.Response.text response in 2832 + let parsed_body = 2833 + match Jsont_bytesrw.decode_string Jsont.json body with 2834 + | Ok json -> Some (Openapi.Runtime.Json json) 2835 + | Error _ -> Some (Openapi.Runtime.Raw body) 2836 + in 2333 2837 raise (Openapi.Runtime.Api_error { 2334 2838 operation = op_name; 2335 2839 method_ = "GET"; 2336 2840 url; 2337 2841 status = Requests.Response.status_code response; 2338 - body = Requests.Response.text response; 2842 + body; 2843 + parsed_body; 2339 2844 }) 2340 2845 end 2341 2846 2342 2847 module PlayerThemeVideoSetting = struct 2848 + module Types = struct 2849 + module T = struct 2850 + (** Player theme setting for a video: 2851 + - `channel-default` Use the channel default theme 2852 + - `instance-default` Use the instance default theme 2853 + - `galaxy` Use the galaxy theme 2854 + - `lucide` Use the lucide theme 2855 + *) 2856 + type t = [ 2857 + | `Channel_default 2858 + | `Instance_default 2859 + | `Galaxy 2860 + | `Lucide 2861 + ] 2862 + end 2863 + end 2864 + 2343 2865 module T = struct 2344 - (** Player theme setting for a video: 2345 - - `channel-default` Use the channel default theme 2346 - - `instance-default` Use the instance default theme 2347 - - `galaxy` Use the galaxy theme 2348 - - `lucide` Use the lucide theme 2349 - *) 2350 - type t = [ 2351 - | `Channel_default 2352 - | `Instance_default 2353 - | `Galaxy 2354 - | `Lucide 2355 - ] 2866 + include Types.T 2356 2867 2357 2868 let jsont : t Jsont.t = 2358 2869 Jsont.map Jsont.string ~kind:"PlayerThemeVideoSetting" ··· 2371 2882 end 2372 2883 2373 2884 module PlayerVideoSettings = struct 2885 + module Types = struct 2886 + module Update = struct 2887 + (** Player settings update for a video *) 2888 + type t = { 2889 + theme : PlayerThemeVideoSetting.T.t; 2890 + } 2891 + end 2892 + 2893 + module T = struct 2894 + (** Player settings for a video *) 2895 + type t = { 2896 + theme : PlayerThemeVideoSetting.T.t option; 2897 + } 2898 + end 2899 + end 2900 + 2374 2901 module Update = struct 2375 - (** Player settings update for a video *) 2376 - type t = { 2377 - theme : PlayerThemeVideoSetting.T.t; 2378 - } 2902 + include Types.Update 2379 2903 2380 2904 let v ~theme () = { theme } 2381 2905 ··· 2390 2914 end 2391 2915 2392 2916 module T = struct 2393 - (** Player settings for a video *) 2394 - type t = { 2395 - theme : PlayerThemeVideoSetting.T.t option; 2396 - } 2917 + include Types.T 2397 2918 2398 2919 let v ?theme () = { theme } 2399 2920 ··· 2427 2948 if Requests.Response.ok response then 2428 2949 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 2429 2950 else 2951 + let body = Requests.Response.text response in 2952 + let parsed_body = 2953 + match Jsont_bytesrw.decode_string Jsont.json body with 2954 + | Ok json -> Some (Openapi.Runtime.Json json) 2955 + | Error _ -> Some (Openapi.Runtime.Raw body) 2956 + in 2430 2957 raise (Openapi.Runtime.Api_error { 2431 2958 operation = op_name; 2432 2959 method_ = "GET"; 2433 2960 url; 2434 2961 status = Requests.Response.status_code response; 2435 - body = Requests.Response.text response; 2962 + body; 2963 + parsed_body; 2436 2964 }) 2437 2965 2438 2966 (** Update video player settings ··· 2454 2982 if Requests.Response.ok response then 2455 2983 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 2456 2984 else 2985 + let body = Requests.Response.text response in 2986 + let parsed_body = 2987 + match Jsont_bytesrw.decode_string Jsont.json body with 2988 + | Ok json -> Some (Openapi.Runtime.Json json) 2989 + | Error _ -> Some (Openapi.Runtime.Raw body) 2990 + in 2457 2991 raise (Openapi.Runtime.Api_error { 2458 2992 operation = op_name; 2459 2993 method_ = "PUT"; 2460 2994 url; 2461 2995 status = Requests.Response.status_code response; 2462 - body = Requests.Response.text response; 2996 + body; 2997 + parsed_body; 2463 2998 }) 2464 2999 end 2465 3000 2466 3001 module PlayerThemeChannelSetting = struct 3002 + module Types = struct 3003 + module T = struct 3004 + (** Player theme setting for a channel: 3005 + - `instance-default` Use the instance default theme 3006 + - `galaxy` Use the galaxy theme 3007 + - `lucide` Use the lucide theme 3008 + *) 3009 + type t = [ 3010 + | `Instance_default 3011 + | `Galaxy 3012 + | `Lucide 3013 + ] 3014 + end 3015 + end 3016 + 2467 3017 module T = struct 2468 - (** Player theme setting for a channel: 2469 - - `instance-default` Use the instance default theme 2470 - - `galaxy` Use the galaxy theme 2471 - - `lucide` Use the lucide theme 2472 - *) 2473 - type t = [ 2474 - | `Instance_default 2475 - | `Galaxy 2476 - | `Lucide 2477 - ] 3018 + include Types.T 2478 3019 2479 3020 let jsont : t Jsont.t = 2480 3021 Jsont.map Jsont.string ~kind:"PlayerThemeChannelSetting" ··· 2491 3032 end 2492 3033 2493 3034 module PlayerChannelSettings = struct 3035 + module Types = struct 3036 + module Update = struct 3037 + (** Player settings update for a channel *) 3038 + type t = { 3039 + theme : PlayerThemeChannelSetting.T.t; 3040 + } 3041 + end 3042 + 3043 + module T = struct 3044 + (** Player settings for a channel *) 3045 + type t = { 3046 + theme : PlayerThemeChannelSetting.T.t option; 3047 + } 3048 + end 3049 + end 3050 + 2494 3051 module Update = struct 2495 - (** Player settings update for a channel *) 2496 - type t = { 2497 - theme : PlayerThemeChannelSetting.T.t; 2498 - } 3052 + include Types.Update 2499 3053 2500 3054 let v ~theme () = { theme } 2501 3055 ··· 2510 3064 end 2511 3065 2512 3066 module T = struct 2513 - (** Player settings for a channel *) 2514 - type t = { 2515 - theme : PlayerThemeChannelSetting.T.t option; 2516 - } 3067 + include Types.T 2517 3068 2518 3069 let v ?theme () = { theme } 2519 3070 ··· 2547 3098 if Requests.Response.ok response then 2548 3099 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 2549 3100 else 3101 + let body = Requests.Response.text response in 3102 + let parsed_body = 3103 + match Jsont_bytesrw.decode_string Jsont.json body with 3104 + | Ok json -> Some (Openapi.Runtime.Json json) 3105 + | Error _ -> Some (Openapi.Runtime.Raw body) 3106 + in 2550 3107 raise (Openapi.Runtime.Api_error { 2551 3108 operation = op_name; 2552 3109 method_ = "GET"; 2553 3110 url; 2554 3111 status = Requests.Response.status_code response; 2555 - body = Requests.Response.text response; 3112 + body; 3113 + parsed_body; 2556 3114 }) 2557 3115 2558 3116 (** Update channel player settings ··· 2574 3132 if Requests.Response.ok response then 2575 3133 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 2576 3134 else 3135 + let body = Requests.Response.text response in 3136 + let parsed_body = 3137 + match Jsont_bytesrw.decode_string Jsont.json body with 3138 + | Ok json -> Some (Openapi.Runtime.Json json) 3139 + | Error _ -> Some (Openapi.Runtime.Raw body) 3140 + in 2577 3141 raise (Openapi.Runtime.Api_error { 2578 3142 operation = op_name; 2579 3143 method_ = "PUT"; 2580 3144 url; 2581 3145 status = Requests.Response.status_code response; 2582 - body = Requests.Response.text response; 3146 + body; 3147 + parsed_body; 2583 3148 }) 2584 3149 end 2585 3150 2586 3151 module PlayerTheme = struct 3152 + module Types = struct 3153 + module T = struct 3154 + (** The player theme to use *) 3155 + type t = [ 3156 + | `Galaxy 3157 + | `Lucide 3158 + ] 3159 + end 3160 + end 3161 + 2587 3162 module T = struct 2588 - (** The player theme to use *) 2589 - type t = [ 2590 - | `Galaxy 2591 - | `Lucide 2592 - ] 3163 + include Types.T 2593 3164 2594 3165 let jsont : t Jsont.t = 2595 3166 Jsont.map Jsont.string ~kind:"PlayerTheme" ··· 2604 3175 end 2605 3176 2606 3177 module PlaybackMetric = struct 3178 + module Types = struct 3179 + module Create = struct 3180 + type t = { 3181 + buffer_stalled : float option; (** How many times buffer has been stalled since the last metric creation *) 3182 + downloaded_bytes_http : float; (** How many bytes were downloaded with HTTP since the last metric creation *) 3183 + downloaded_bytes_p2_p : float; (** How many bytes were downloaded with P2P since the last metric creation *) 3184 + errors : float; (** How many errors occurred since the last metric creation *) 3185 + fps : float option; (** Current player video fps *) 3186 + p2p_enabled : bool; 3187 + p2p_peers : float option; (** P2P peers connected (doesn't include WebSeed peers) *) 3188 + player_mode : string; 3189 + resolution : float option; (** Current player video resolution *) 3190 + resolution_changes : float; (** How many resolution changes occurred since the last metric creation *) 3191 + uploaded_bytes_p2_p : float; (** How many bytes were uploaded with P2P since the last metric creation *) 3192 + video_id : Jsont.json; 3193 + } 3194 + end 3195 + end 3196 + 2607 3197 module Create = struct 2608 - type t = { 2609 - buffer_stalled : float option; (** How many times buffer has been stalled since the last metric creation *) 2610 - downloaded_bytes_http : float; (** How many bytes were downloaded with HTTP since the last metric creation *) 2611 - downloaded_bytes_p2_p : float; (** How many bytes were downloaded with P2P since the last metric creation *) 2612 - errors : float; (** How many errors occurred since the last metric creation *) 2613 - fps : float option; (** Current player video fps *) 2614 - p2p_enabled : bool; 2615 - p2p_peers : float option; (** P2P peers connected (doesn't include WebSeed peers) *) 2616 - player_mode : string; 2617 - resolution : float option; (** Current player video resolution *) 2618 - resolution_changes : float; (** How many resolution changes occurred since the last metric creation *) 2619 - uploaded_bytes_p2_p : float; (** How many bytes were uploaded with P2P since the last metric creation *) 2620 - video_id : Jsont.json; 2621 - } 3198 + include Types.Create 2622 3199 2623 3200 let v ~downloaded_bytes_http ~downloaded_bytes_p2_p ~errors ~p2p_enabled ~player_mode ~resolution_changes ~uploaded_bytes_p2_p ~video_id ?buffer_stalled ?fps ?p2p_peers ?resolution () = { buffer_stalled; downloaded_bytes_http; downloaded_bytes_p2_p; errors; fps; p2p_enabled; p2p_peers; player_mode; resolution; resolution_changes; uploaded_bytes_p2_p; video_id } 2624 3201 ··· 2656 3233 end 2657 3234 2658 3235 module Password = struct 3236 + module Types = struct 3237 + module T = struct 3238 + type t = Jsont.json 3239 + end 3240 + end 3241 + 2659 3242 module T = struct 2660 - type t = Jsont.json 2661 - 3243 + include Types.T 2662 3244 let jsont = Jsont.json 2663 - 2664 3245 let v () = Jsont.Null ((), Jsont.Meta.none) 2665 3246 end 2666 3247 end 2667 3248 2668 3249 module UpdateUser = struct 3250 + module Types = struct 3251 + module T = struct 3252 + type t = { 3253 + admin_flags : UserAdminFlags.T.t option; 3254 + email : Jsont.json option; (** The updated email of the user *) 3255 + email_verified : bool option; (** Set the email as verified *) 3256 + password : Password.T.t option; 3257 + plugin_auth : string option; (** The auth plugin to use to authenticate the user *) 3258 + role : UserRole.T.t option; 3259 + video_quota : int option; (** The updated video quota of the user in bytes *) 3260 + video_quota_daily : int option; (** The updated daily video quota of the user in bytes *) 3261 + } 3262 + end 3263 + end 3264 + 2669 3265 module T = struct 2670 - type t = { 2671 - admin_flags : UserAdminFlags.T.t option; 2672 - email : Jsont.json option; (** The updated email of the user *) 2673 - email_verified : bool option; (** Set the email as verified *) 2674 - password : Password.T.t option; 2675 - plugin_auth : string option; (** The auth plugin to use to authenticate the user *) 2676 - role : UserRole.T.t option; 2677 - video_quota : int option; (** The updated video quota of the user in bytes *) 2678 - video_quota_daily : int option; (** The updated daily video quota of the user in bytes *) 2679 - } 3266 + include Types.T 2680 3267 2681 3268 let v ?admin_flags ?email ?email_verified ?password ?plugin_auth ?role ?video_quota ?video_quota_daily () = { admin_flags; email; email_verified; password; plugin_auth; role; video_quota; video_quota_daily } 2682 3269 ··· 2707 3294 end 2708 3295 2709 3296 module RegisterUser = struct 3297 + module Types = struct 3298 + module T = struct 3299 + type t = { 3300 + channel : Jsont.json option; (** channel base information used to create the first channel of the user *) 3301 + display_name : string option; (** editable name of the user, displayed in its representations *) 3302 + email : string; (** email of the user, used for login or service communications *) 3303 + password : Password.T.t; 3304 + username : Username.T.t; (** immutable name of the user, used to find or mention its actor *) 3305 + } 3306 + end 3307 + end 3308 + 2710 3309 module T = struct 2711 - type t = { 2712 - channel : Jsont.json option; (** channel base information used to create the first channel of the user *) 2713 - display_name : string option; (** editable name of the user, displayed in its representations *) 2714 - email : string; (** email of the user, used for login or service communications *) 2715 - password : Password.T.t; 2716 - username : Username.T.t; (** immutable name of the user, used to find or mention its actor *) 2717 - } 3310 + include Types.T 2718 3311 2719 3312 let v ~email ~password ~username ?channel ?display_name () = { channel; display_name; email; password; username } 2720 3313 ··· 2728 3321 Jsont.Object.map ~kind:"RegisterUser" 2729 3322 (fun channel display_name email password username -> { channel; display_name; email; password; username }) 2730 3323 |> Jsont.Object.opt_mem "channel" Jsont.json ~enc:(fun r -> r.channel) 2731 - |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 3324 + |> Jsont.Object.opt_mem "displayName" (Openapi.Runtime.validated_string ~min_length:1 ~max_length:120 Jsont.string) ~enc:(fun r -> r.display_name) 2732 3325 |> Jsont.Object.mem "email" Jsont.string ~enc:(fun r -> r.email) 2733 3326 |> Jsont.Object.mem "password" Password.T.jsont ~enc:(fun r -> r.password) 2734 3327 |> Jsont.Object.mem "username" Username.T.jsont ~enc:(fun r -> r.username) ··· 2738 3331 end 2739 3332 2740 3333 module OauthTokenPassword = struct 3334 + module Types = struct 3335 + module T = struct 3336 + type t = { 3337 + client_id : string; 3338 + client_secret : string; 3339 + grant_type : string; 3340 + username : Jsont.json; 3341 + password : Password.T.t option; 3342 + 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. *) 3343 + } 3344 + end 3345 + end 3346 + 2741 3347 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 - } 3348 + include Types.T 2750 3349 2751 3350 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 3351 ··· 2760 3359 let jsont : t Jsont.t = 2761 3360 Jsont.Object.map ~kind:"OAuthToken-password" 2762 3361 (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) 3362 + |> Jsont.Object.mem "client_id" (Openapi.Runtime.validated_string ~min_length:32 ~max_length:32 ~pattern:"/^[a-z0-9]$/" Jsont.string) ~enc:(fun r -> r.client_id) 3363 + |> Jsont.Object.mem "client_secret" (Openapi.Runtime.validated_string ~min_length:32 ~max_length:32 ~pattern:"/^[a-zA-Z0-9]$/" Jsont.string) ~enc:(fun r -> r.client_secret) 2765 3364 |> Jsont.Object.mem "grant_type" Jsont.string ~enc:(fun r -> r.grant_type) 2766 3365 |> Jsont.Object.mem "username" Jsont.json ~enc:(fun r -> r.username) 2767 3366 |> Jsont.Object.opt_mem "password" Password.T.jsont ~enc:(fun r -> r.password) ··· 2772 3371 end 2773 3372 2774 3373 module AddUser = struct 3374 + module Types = struct 3375 + module Response = struct 3376 + type t = { 3377 + user : Jsont.json option; 3378 + } 3379 + end 3380 + 3381 + module T = struct 3382 + type t = { 3383 + admin_flags : UserAdminFlags.T.t option; 3384 + channel_name : UsernameChannel.T.t option; 3385 + email : string; (** The user email *) 3386 + password : Password.T.t; 3387 + role : UserRole.T.t; 3388 + username : Username.T.t; 3389 + video_quota : int option; (** The user video quota in bytes *) 3390 + video_quota_daily : int option; (** The user daily video quota in bytes *) 3391 + } 3392 + end 3393 + end 3394 + 2775 3395 module Response = struct 2776 - type t = { 2777 - user : Jsont.json option; 2778 - } 3396 + include Types.Response 2779 3397 2780 3398 let v ?user () = { user } 2781 3399 ··· 2790 3408 end 2791 3409 2792 3410 module T = struct 2793 - type t = { 2794 - admin_flags : UserAdminFlags.T.t option; 2795 - channel_name : UsernameChannel.T.t option; 2796 - email : string; (** The user email *) 2797 - password : Password.T.t; 2798 - role : UserRole.T.t; 2799 - username : Username.T.t; 2800 - video_quota : int option; (** The user video quota in bytes *) 2801 - video_quota_daily : int option; (** The user daily video quota in bytes *) 2802 - } 3411 + include Types.T 2803 3412 2804 3413 let v ~email ~password ~role ~username ?admin_flags ?channel_name ?video_quota ?video_quota_daily () = { admin_flags; channel_name; email; password; role; username; video_quota; video_quota_daily } 2805 3414 ··· 2842 3451 if Requests.Response.ok response then 2843 3452 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 2844 3453 else 3454 + let body = Requests.Response.text response in 3455 + let parsed_body = 3456 + match Jsont_bytesrw.decode_string Jsont.json body with 3457 + | Ok json -> Some (Openapi.Runtime.Json json) 3458 + | Error _ -> Some (Openapi.Runtime.Raw body) 3459 + in 2845 3460 raise (Openapi.Runtime.Api_error { 2846 3461 operation = op_name; 2847 3462 method_ = "POST"; 2848 3463 url; 2849 3464 status = Requests.Response.status_code response; 2850 - body = Requests.Response.text response; 3465 + body; 3466 + parsed_body; 2851 3467 }) 2852 3468 end 2853 3469 2854 3470 module OauthTokenRefreshToken = struct 3471 + module Types = struct 3472 + module T = struct 3473 + type t = { 3474 + client_id : string; 3475 + client_secret : string; 3476 + grant_type : string; 3477 + refresh_token : string; 3478 + } 3479 + end 3480 + end 3481 + 2855 3482 module T = struct 2856 - type t = { 2857 - client_id : string; 2858 - client_secret : string; 2859 - grant_type : string; 2860 - refresh_token : string; 2861 - } 3483 + include Types.T 2862 3484 2863 3485 let v ~client_id ~client_secret ~grant_type ~refresh_token () = { client_id; client_secret; grant_type; refresh_token } 2864 3486 ··· 2870 3492 let jsont : t Jsont.t = 2871 3493 Jsont.Object.map ~kind:"OAuthToken-refresh_token" 2872 3494 (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) 3495 + |> Jsont.Object.mem "client_id" (Openapi.Runtime.validated_string ~min_length:32 ~max_length:32 ~pattern:"/^[a-z0-9]$/" Jsont.string) ~enc:(fun r -> r.client_id) 3496 + |> Jsont.Object.mem "client_secret" (Openapi.Runtime.validated_string ~min_length:32 ~max_length:32 ~pattern:"/^[a-zA-Z0-9]$/" Jsont.string) ~enc:(fun r -> r.client_secret) 2875 3497 |> Jsont.Object.mem "grant_type" Jsont.string ~enc:(fun r -> r.grant_type) 2876 3498 |> Jsont.Object.mem "refresh_token" Jsont.string ~enc:(fun r -> r.refresh_token) 2877 3499 |> Jsont.Object.skip_unknown ··· 2880 3502 end 2881 3503 2882 3504 module OauthClient = struct 3505 + module Types = struct 3506 + module T = struct 3507 + type t = { 3508 + client_id : string option; 3509 + client_secret : string option; 3510 + } 3511 + end 3512 + end 3513 + 2883 3514 module T = struct 2884 - type t = { 2885 - client_id : string option; 2886 - client_secret : string option; 2887 - } 3515 + include Types.T 2888 3516 2889 3517 let v ?client_id ?client_secret () = { client_id; client_secret } 2890 3518 ··· 2894 3522 let jsont : t Jsont.t = 2895 3523 Jsont.Object.map ~kind:"OAuthClient" 2896 3524 (fun client_id client_secret -> { client_id; client_secret }) 2897 - |> Jsont.Object.opt_mem "client_id" Jsont.string ~enc:(fun r -> r.client_id) 2898 - |> Jsont.Object.opt_mem "client_secret" Jsont.string ~enc:(fun r -> r.client_secret) 3525 + |> Jsont.Object.opt_mem "client_id" (Openapi.Runtime.validated_string ~min_length:32 ~max_length:32 ~pattern:"/^[a-z0-9]$/" Jsont.string) ~enc:(fun r -> r.client_id) 3526 + |> Jsont.Object.opt_mem "client_secret" (Openapi.Runtime.validated_string ~min_length:32 ~max_length:32 ~pattern:"/^[a-zA-Z0-9]$/" Jsont.string) ~enc:(fun r -> r.client_secret) 2899 3527 |> Jsont.Object.skip_unknown 2900 3528 |> Jsont.Object.finish 2901 3529 end ··· 2917 3545 if Requests.Response.ok response then 2918 3546 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 2919 3547 else 3548 + let body = Requests.Response.text response in 3549 + let parsed_body = 3550 + match Jsont_bytesrw.decode_string Jsont.json body with 3551 + | Ok json -> Some (Openapi.Runtime.Json json) 3552 + | Error _ -> Some (Openapi.Runtime.Raw body) 3553 + in 2920 3554 raise (Openapi.Runtime.Api_error { 2921 3555 operation = op_name; 2922 3556 method_ = "GET"; 2923 3557 url; 2924 3558 status = Requests.Response.status_code response; 2925 - body = Requests.Response.text response; 3559 + body; 3560 + parsed_body; 2926 3561 }) 2927 3562 end 2928 3563 2929 3564 module Nsfwpolicy = struct 3565 + module Types = struct 3566 + module T = struct 3567 + type t = [ 3568 + | `Display 3569 + | `Warn 3570 + | `Do_not_list 3571 + ] 3572 + end 3573 + end 3574 + 2930 3575 module T = struct 2931 - type t = [ 2932 - | `Display 2933 - | `Warn 2934 - | `Do_not_list 2935 - ] 3576 + include Types.T 2936 3577 2937 3578 let jsont : t Jsont.t = 2938 3579 Jsont.map Jsont.string ~kind:"NSFWPolicy" ··· 2949 3590 end 2950 3591 2951 3592 module Nsfwflag = struct 3593 + module Types = struct 3594 + module T = struct 3595 + (** 3596 + NSFW flags (can be combined using bitwise or operator) 3597 + - `0` NONE 3598 + - `1` VIOLENT 3599 + - `2` EXPLICIT_SEX 3600 + *) 3601 + type t = string 3602 + end 3603 + end 3604 + 2952 3605 module T = struct 2953 - (** 2954 - NSFW flags (can be combined using bitwise or operator) 2955 - - `0` NONE 2956 - - `1` VIOLENT 2957 - - `2` EXPLICIT_SEX 2958 - *) 2959 - type t = string 2960 - 3606 + include Types.T 2961 3607 let jsont = Jsont.string 2962 3608 end 2963 3609 end 2964 3610 2965 3611 module UpdateMe = struct 3612 + module Types = struct 3613 + module T = struct 3614 + type t = { 3615 + auto_play_next_video : bool option; (** new preference regarding playing following videos automatically *) 3616 + auto_play_next_video_playlist : bool option; (** new preference regarding playing following playlist videos automatically *) 3617 + auto_play_video : bool option; (** new preference regarding playing videos automatically *) 3618 + current_password : Password.T.t option; 3619 + display_name : string option; (** new name of the user in its representations *) 3620 + email : Jsont.json option; (** new email used for login and service communications *) 3621 + language : string option; (** default language for this user *) 3622 + no_account_setup_warning_modal : bool option; 3623 + no_instance_config_warning_modal : bool option; 3624 + no_welcome_modal : bool option; 3625 + nsfw_flags_blurred : Nsfwflag.T.t option; 3626 + nsfw_flags_displayed : Nsfwflag.T.t option; 3627 + nsfw_flags_hidden : Nsfwflag.T.t option; 3628 + nsfw_flags_warned : Nsfwflag.T.t option; 3629 + nsfw_policy : string option; (** new NSFW display policy *) 3630 + p2p_enabled : bool option; (** whether to enable P2P in the player or not *) 3631 + password : Password.T.t option; 3632 + theme : string option; 3633 + video_languages : string list option; (** list of languages to filter videos down to *) 3634 + videos_history_enabled : bool option; (** whether to keep track of watched history or not *) 3635 + } 3636 + end 3637 + end 3638 + 2966 3639 module T = struct 2967 - type t = { 2968 - auto_play_next_video : bool option; (** new preference regarding playing following videos automatically *) 2969 - auto_play_next_video_playlist : bool option; (** new preference regarding playing following playlist videos automatically *) 2970 - auto_play_video : bool option; (** new preference regarding playing videos automatically *) 2971 - current_password : Password.T.t option; 2972 - display_name : string option; (** new name of the user in its representations *) 2973 - email : Jsont.json option; (** new email used for login and service communications *) 2974 - language : string option; (** default language for this user *) 2975 - no_account_setup_warning_modal : bool option; 2976 - no_instance_config_warning_modal : bool option; 2977 - no_welcome_modal : bool option; 2978 - nsfw_flags_blurred : Nsfwflag.T.t option; 2979 - nsfw_flags_displayed : Nsfwflag.T.t option; 2980 - nsfw_flags_hidden : Nsfwflag.T.t option; 2981 - nsfw_flags_warned : Nsfwflag.T.t option; 2982 - nsfw_policy : string option; (** new NSFW display policy *) 2983 - p2p_enabled : bool option; (** whether to enable P2P in the player or not *) 2984 - password : Password.T.t option; 2985 - theme : string option; 2986 - video_languages : string list option; (** list of languages to filter videos down to *) 2987 - videos_history_enabled : bool option; (** whether to keep track of watched history or not *) 2988 - } 3640 + include Types.T 2989 3641 2990 3642 let v ?auto_play_next_video ?auto_play_next_video_playlist ?auto_play_video ?current_password ?display_name ?email ?language ?no_account_setup_warning_modal ?no_instance_config_warning_modal ?no_welcome_modal ?nsfw_flags_blurred ?nsfw_flags_displayed ?nsfw_flags_hidden ?nsfw_flags_warned ?nsfw_policy ?p2p_enabled ?password ?theme ?video_languages ?videos_history_enabled () = { auto_play_next_video; auto_play_next_video_playlist; auto_play_video; current_password; display_name; email; language; no_account_setup_warning_modal; no_instance_config_warning_modal; no_welcome_modal; nsfw_flags_blurred; nsfw_flags_displayed; nsfw_flags_hidden; nsfw_flags_warned; nsfw_policy; p2p_enabled; password; theme; video_languages; videos_history_enabled } 2991 3643 ··· 3017 3669 |> Jsont.Object.opt_mem "autoPlayNextVideoPlaylist" Jsont.bool ~enc:(fun r -> r.auto_play_next_video_playlist) 3018 3670 |> Jsont.Object.opt_mem "autoPlayVideo" Jsont.bool ~enc:(fun r -> r.auto_play_video) 3019 3671 |> Jsont.Object.opt_mem "currentPassword" Password.T.jsont ~enc:(fun r -> r.current_password) 3020 - |> Jsont.Object.opt_mem "displayName" Jsont.string ~enc:(fun r -> r.display_name) 3672 + |> Jsont.Object.opt_mem "displayName" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.display_name) 3021 3673 |> Jsont.Object.opt_mem "email" Jsont.json ~enc:(fun r -> r.email) 3022 3674 |> Jsont.Object.opt_mem "language" Jsont.string ~enc:(fun r -> r.language) 3023 3675 |> Jsont.Object.opt_mem "noAccountSetupWarningModal" Jsont.bool ~enc:(fun r -> r.no_account_setup_warning_modal) ··· 3039 3691 end 3040 3692 3041 3693 module NotificationSettingValue = struct 3694 + module Types = struct 3695 + module T = struct 3696 + (** Notification type. One of the following values, or a sum of multiple values: 3697 + - `0` NONE 3698 + - `1` WEB 3699 + - `2` EMAIL 3700 + *) 3701 + type t = Jsont.json 3702 + end 3703 + end 3704 + 3042 3705 module T = struct 3043 - (** Notification type. One of the following values, or a sum of multiple values: 3044 - - `0` NONE 3045 - - `1` WEB 3046 - - `2` EMAIL 3047 - *) 3048 - type t = Jsont.json 3049 - 3706 + include Types.T 3050 3707 let jsont = Jsont.json 3051 - 3052 3708 let v () = Jsont.Null ((), Jsont.Meta.none) 3053 3709 end 3054 3710 end 3055 3711 3056 3712 module UserNotificationSettings = struct 3713 + module Types = struct 3714 + module T = struct 3715 + type t = { 3716 + abuse_as_moderator : NotificationSettingValue.T.t option; 3717 + abuse_new_message : NotificationSettingValue.T.t option; 3718 + abuse_state_change : NotificationSettingValue.T.t option; 3719 + auto_instance_following : NotificationSettingValue.T.t option; 3720 + blacklist_on_my_video : NotificationSettingValue.T.t option; 3721 + comment_mention : NotificationSettingValue.T.t option; 3722 + my_video_import_finished : NotificationSettingValue.T.t option; 3723 + my_video_published : NotificationSettingValue.T.t option; 3724 + my_video_studio_edition_finished : NotificationSettingValue.T.t option; 3725 + my_video_transcription_generated : NotificationSettingValue.T.t option; 3726 + new_comment_on_my_video : NotificationSettingValue.T.t option; 3727 + new_follow : NotificationSettingValue.T.t option; 3728 + new_instance_follower : NotificationSettingValue.T.t option; 3729 + new_peer_tube_version : NotificationSettingValue.T.t option; 3730 + new_plugin_version : NotificationSettingValue.T.t option; 3731 + new_user_registration : NotificationSettingValue.T.t option; 3732 + new_video_from_subscription : NotificationSettingValue.T.t option; 3733 + video_auto_blacklist_as_moderator : NotificationSettingValue.T.t option; 3734 + } 3735 + end 3736 + end 3737 + 3057 3738 module T = struct 3058 - type t = { 3059 - abuse_as_moderator : NotificationSettingValue.T.t option; 3060 - abuse_new_message : NotificationSettingValue.T.t option; 3061 - abuse_state_change : NotificationSettingValue.T.t option; 3062 - auto_instance_following : NotificationSettingValue.T.t option; 3063 - blacklist_on_my_video : NotificationSettingValue.T.t option; 3064 - comment_mention : NotificationSettingValue.T.t option; 3065 - my_video_import_finished : NotificationSettingValue.T.t option; 3066 - my_video_published : NotificationSettingValue.T.t option; 3067 - my_video_studio_edition_finished : NotificationSettingValue.T.t option; 3068 - my_video_transcription_generated : NotificationSettingValue.T.t option; 3069 - new_comment_on_my_video : NotificationSettingValue.T.t option; 3070 - new_follow : NotificationSettingValue.T.t option; 3071 - new_instance_follower : NotificationSettingValue.T.t option; 3072 - new_peer_tube_version : NotificationSettingValue.T.t option; 3073 - new_plugin_version : NotificationSettingValue.T.t option; 3074 - new_user_registration : NotificationSettingValue.T.t option; 3075 - new_video_from_subscription : NotificationSettingValue.T.t option; 3076 - video_auto_blacklist_as_moderator : NotificationSettingValue.T.t option; 3077 - } 3739 + include Types.T 3078 3740 3079 3741 let v ?abuse_as_moderator ?abuse_new_message ?abuse_state_change ?auto_instance_following ?blacklist_on_my_video ?comment_mention ?my_video_import_finished ?my_video_published ?my_video_studio_edition_finished ?my_video_transcription_generated ?new_comment_on_my_video ?new_follow ?new_instance_follower ?new_peer_tube_version ?new_plugin_version ?new_user_registration ?new_video_from_subscription ?video_auto_blacklist_as_moderator () = { abuse_as_moderator; abuse_new_message; abuse_state_change; auto_instance_following; blacklist_on_my_video; comment_mention; my_video_import_finished; my_video_published; my_video_studio_edition_finished; my_video_transcription_generated; new_comment_on_my_video; new_follow; new_instance_follower; new_peer_tube_version; new_plugin_version; new_user_registration; new_video_from_subscription; video_auto_blacklist_as_moderator } 3080 3742 ··· 3124 3786 end 3125 3787 3126 3788 module NewFeatureInfo = struct 3789 + module Types = struct 3790 + module Type = struct 3791 + (** Represent a new feature that can be displayed to inform users. One of the following values: 3792 + 3793 + - `1` CHANNEL_COLLABORATION 3794 + *) 3795 + type t = string 3796 + end 3797 + end 3798 + 3127 3799 module Type = struct 3128 - (** Represent a new feature that can be displayed to inform users. One of the following values: 3129 - 3130 - - `1` CHANNEL_COLLABORATION 3131 - *) 3132 - type t = string 3133 - 3800 + include Types.Type 3134 3801 let jsont = Jsont.string 3135 3802 end 3136 3803 end 3137 3804 3138 3805 module MrsspeerLink = struct 3806 + module Types = struct 3807 + module T = struct 3808 + type t = { 3809 + href : string option; 3810 + type_ : string option; 3811 + } 3812 + end 3813 + end 3814 + 3139 3815 module T = struct 3140 - type t = { 3141 - href : string option; 3142 - type_ : string option; 3143 - } 3816 + include Types.T 3144 3817 3145 3818 let v ?href ?type_ () = { href; type_ } 3146 3819 ··· 3158 3831 end 3159 3832 3160 3833 module MrssgroupContent = struct 3834 + module Types = struct 3835 + module T = struct 3836 + type t = { 3837 + duration : int option; 3838 + file_size : int option; 3839 + framerate : int option; 3840 + height : int option; 3841 + lang : string option; 3842 + type_ : string option; 3843 + url : string option; 3844 + } 3845 + end 3846 + end 3847 + 3161 3848 module T = struct 3162 - type t = { 3163 - duration : int option; 3164 - file_size : int option; 3165 - framerate : int option; 3166 - height : int option; 3167 - lang : string option; 3168 - type_ : string option; 3169 - url : string option; 3170 - } 3849 + include Types.T 3171 3850 3172 3851 let v ?duration ?file_size ?framerate ?height ?lang ?type_ ?url () = { duration; file_size; framerate; height; lang; type_; url } 3173 3852 ··· 3195 3874 end 3196 3875 3197 3876 module LiveVideoSession = struct 3877 + module Types = struct 3878 + module Response = struct 3879 + type t = { 3880 + end_date : Ptime.t option; (** End date of the live session *) 3881 + error : int option; (** Error type if an error occurred during the live session: 3882 + - `1`: Bad socket health (transcoding is too slow) 3883 + - `2`: Max duration exceeded 3884 + - `3`: Quota exceeded 3885 + - `4`: Quota FFmpeg error 3886 + - `5`: Video has been blacklisted during the live 3887 + *) 3888 + id : int option; 3889 + replay_video : Jsont.json option; (** Video replay information *) 3890 + start_date : Ptime.t option; (** Start date of the live session *) 3891 + } 3892 + end 3893 + end 3894 + 3198 3895 module Response = struct 3199 - type t = { 3200 - end_date : Ptime.t option; (** End date of the live session *) 3201 - error : int option; (** Error type if an error occurred during the live session: 3202 - - `1`: Bad socket health (transcoding is too slow) 3203 - - `2`: Max duration exceeded 3204 - - `3`: Quota exceeded 3205 - - `4`: Quota FFmpeg error 3206 - - `5`: Video has been blacklisted during the live 3207 - *) 3208 - id : int option; 3209 - replay_video : Jsont.json option; (** Video replay information *) 3210 - start_date : Ptime.t option; (** Start date of the live session *) 3211 - } 3896 + include Types.Response 3212 3897 3213 3898 let v ?end_date ?error ?id ?replay_video ?start_date () = { end_date; error; id; replay_video; start_date } 3214 3899 ··· 3251 3936 if Requests.Response.ok response then 3252 3937 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 3253 3938 else 3939 + let body = Requests.Response.text response in 3940 + let parsed_body = 3941 + match Jsont_bytesrw.decode_string Jsont.json body with 3942 + | Ok json -> Some (Openapi.Runtime.Json json) 3943 + | Error _ -> Some (Openapi.Runtime.Raw body) 3944 + in 3254 3945 raise (Openapi.Runtime.Api_error { 3255 3946 operation = op_name; 3256 3947 method_ = "GET"; 3257 3948 url; 3258 3949 status = Requests.Response.status_code response; 3259 - body = Requests.Response.text response; 3950 + body; 3951 + parsed_body; 3260 3952 }) 3261 3953 end 3262 3954 3263 3955 module LiveVideoLatencyMode = struct 3956 + module Types = struct 3957 + module T = struct 3958 + (** The live latency mode (Default = `1`, High latency = `2`, Small Latency = `3`) *) 3959 + type t = string 3960 + end 3961 + end 3962 + 3264 3963 module T = struct 3265 - (** The live latency mode (Default = `1`, High latency = `2`, Small Latency = `3`) *) 3266 - type t = string 3267 - 3964 + include Types.T 3268 3965 let jsont = Jsont.string 3269 3966 end 3270 3967 end 3271 3968 3272 3969 module LiveSchedule = struct 3970 + module Types = struct 3971 + module T = struct 3972 + type t = { 3973 + start_at : Ptime.t option; (** Date when the stream is scheduled to air at *) 3974 + } 3975 + end 3976 + end 3977 + 3273 3978 module T = struct 3274 - type t = { 3275 - start_at : Ptime.t option; (** Date when the stream is scheduled to air at *) 3276 - } 3979 + include Types.T 3277 3980 3278 3981 let v ?start_at () = { start_at } 3279 3982 ··· 3289 3992 end 3290 3993 3291 3994 module LiveVideo = struct 3995 + module Types = struct 3996 + module Update = struct 3997 + type t = { 3998 + latency_mode : LiveVideoLatencyMode.T.t option; (** User can select live latency mode if enabled by the instance *) 3999 + permanent_live : bool option; (** User can stream multiple times in a permanent live *) 4000 + replay_settings : LiveVideoReplaySettings.T.t option; 4001 + save_replay : bool option; 4002 + schedules : LiveSchedule.T.t list option; 4003 + } 4004 + end 4005 + 4006 + module Response = struct 4007 + type t = { 4008 + latency_mode : LiveVideoLatencyMode.T.t option; (** User can select live latency mode if enabled by the instance *) 4009 + permanent_live : bool option; (** User can stream multiple times in a permanent live *) 4010 + replay_settings : LiveVideoReplaySettings.T.t option; 4011 + rtmp_url : string option; (** Included in the response if an appropriate token is provided *) 4012 + rtmps_url : string option; (** Included in the response if an appropriate token is provided *) 4013 + save_replay : bool option; 4014 + schedules : LiveSchedule.T.t list option; 4015 + stream_key : string option; (** RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided *) 4016 + } 4017 + end 4018 + end 4019 + 3292 4020 module Update = struct 3293 - type t = { 3294 - latency_mode : LiveVideoLatencyMode.T.t option; (** User can select live latency mode if enabled by the instance *) 3295 - permanent_live : bool option; (** User can stream multiple times in a permanent live *) 3296 - replay_settings : LiveVideoReplaySettings.T.t option; 3297 - save_replay : bool option; 3298 - schedules : LiveSchedule.T.t list option; 3299 - } 4021 + include Types.Update 3300 4022 3301 4023 let v ?latency_mode ?permanent_live ?replay_settings ?save_replay ?schedules () = { latency_mode; permanent_live; replay_settings; save_replay; schedules } 3302 4024 ··· 3319 4041 end 3320 4042 3321 4043 module Response = struct 3322 - type t = { 3323 - latency_mode : LiveVideoLatencyMode.T.t option; (** User can select live latency mode if enabled by the instance *) 3324 - permanent_live : bool option; (** User can stream multiple times in a permanent live *) 3325 - replay_settings : LiveVideoReplaySettings.T.t option; 3326 - rtmp_url : string option; (** Included in the response if an appropriate token is provided *) 3327 - rtmps_url : string option; (** Included in the response if an appropriate token is provided *) 3328 - save_replay : bool option; 3329 - schedules : LiveSchedule.T.t list option; 3330 - stream_key : string option; (** RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided *) 3331 - } 4044 + include Types.Response 3332 4045 3333 4046 let v ?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 } 3334 4047 ··· 3373 4086 if Requests.Response.ok response then 3374 4087 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 3375 4088 else 4089 + let body = Requests.Response.text response in 4090 + let parsed_body = 4091 + match Jsont_bytesrw.decode_string Jsont.json body with 4092 + | Ok json -> Some (Openapi.Runtime.Json json) 4093 + | Error _ -> Some (Openapi.Runtime.Raw body) 4094 + in 3376 4095 raise (Openapi.Runtime.Api_error { 3377 4096 operation = op_name; 3378 4097 method_ = "GET"; 3379 4098 url; 3380 4099 status = Requests.Response.status_code response; 3381 - body = Requests.Response.text response; 4100 + body; 4101 + parsed_body; 3382 4102 }) 3383 4103 end 3384 4104 3385 4105 module ImportVideosInChannel = struct 4106 + module Types = struct 4107 + module Create = struct 4108 + type t = { 4109 + external_channel_url : string; 4110 + video_channel_sync_id : int option; (** If part of a channel sync process, specify its id to assign video imports to this channel synchronization *) 4111 + } 4112 + end 4113 + end 4114 + 3386 4115 module Create = struct 3387 - type t = { 3388 - external_channel_url : string; 3389 - video_channel_sync_id : int option; (** If part of a channel sync process, specify its id to assign video imports to this channel synchronization *) 3390 - } 4116 + include Types.Create 3391 4117 3392 4118 let v ~external_channel_url ?video_channel_sync_id () = { external_channel_url; video_channel_sync_id } 3393 4119 ··· 3405 4131 end 3406 4132 3407 4133 module Id = struct 4134 + module Types = struct 4135 + module T = struct 4136 + type t = Jsont.json 4137 + end 4138 + end 4139 + 3408 4140 module T = struct 3409 - type t = Jsont.json 3410 - 4141 + include Types.T 3411 4142 let jsont = Jsont.json 3412 - 3413 4143 let v () = Jsont.Null ((), Jsont.Meta.none) 3414 4144 end 3415 4145 end 3416 4146 3417 4147 module WatchedWordsLists = struct 4148 + module Types = struct 4149 + module T = struct 4150 + type t = { 4151 + created_at : Ptime.t option; 4152 + id : Id.T.t option; 4153 + list_name : string option; 4154 + updated_at : Ptime.t option; 4155 + words : string list option; 4156 + } 4157 + end 4158 + end 4159 + 3418 4160 module T = struct 3419 - type t = { 3420 - created_at : Ptime.t option; 3421 - id : Id.T.t option; 3422 - list_name : string option; 3423 - updated_at : Ptime.t option; 3424 - words : string list option; 3425 - } 4161 + include Types.T 3426 4162 3427 4163 let v ?created_at ?id ?list_name ?updated_at ?words () = { created_at; id; list_name; updated_at; words } 3428 4164 ··· 3446 4182 end 3447 4183 3448 4184 module VideoRedundancy = struct 4185 + module Types = struct 4186 + module T = struct 4187 + type t = { 4188 + id : Id.T.t option; 4189 + name : string option; 4190 + redundancies : Jsont.json option; 4191 + url : string option; 4192 + uuid : Uuidv4.T.t option; 4193 + } 4194 + end 4195 + end 4196 + 3449 4197 module T = struct 3450 - type t = { 3451 - id : Id.T.t option; 3452 - name : string option; 3453 - redundancies : Jsont.json option; 3454 - url : string option; 3455 - uuid : Uuidv4.T.t option; 3456 - } 4198 + include Types.T 3457 4199 3458 4200 let v ?id ?name ?redundancies ?url ?uuid () = { id; name; redundancies; url; uuid } 3459 4201 ··· 3495 4237 if Requests.Response.ok response then 3496 4238 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 3497 4239 else 4240 + let body = Requests.Response.text response in 4241 + let parsed_body = 4242 + match Jsont_bytesrw.decode_string Jsont.json body with 4243 + | Ok json -> Some (Openapi.Runtime.Json json) 4244 + | Error _ -> Some (Openapi.Runtime.Raw body) 4245 + in 3498 4246 raise (Openapi.Runtime.Api_error { 3499 4247 operation = op_name; 3500 4248 method_ = "GET"; 3501 4249 url; 3502 4250 status = Requests.Response.status_code response; 3503 - body = Requests.Response.text response; 4251 + body; 4252 + parsed_body; 3504 4253 }) 3505 4254 end 3506 4255 3507 4256 module VideoPassword = struct 4257 + module Types = struct 4258 + module T = struct 4259 + type t = { 4260 + id : Id.T.t option; 4261 + password : string option; 4262 + video_id : Id.T.t option; 4263 + } 4264 + end 4265 + end 4266 + 3508 4267 module T = struct 3509 - type t = { 3510 - id : Id.T.t option; 3511 - password : string option; 3512 - video_id : Id.T.t option; 3513 - } 4268 + include Types.T 3514 4269 3515 4270 let v ?id ?password ?video_id () = { id; password; video_id } 3516 4271 ··· 3522 4277 Jsont.Object.map ~kind:"VideoPassword" 3523 4278 (fun id password video_id -> { id; password; video_id }) 3524 4279 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3525 - |> Jsont.Object.opt_mem "password" Jsont.string ~enc:(fun r -> r.password) 4280 + |> Jsont.Object.opt_mem "password" (Openapi.Runtime.validated_string ~min_length:2 Jsont.string) ~enc:(fun r -> r.password) 3526 4281 |> Jsont.Object.opt_mem "videoId" Id.T.jsont ~enc:(fun r -> r.video_id) 3527 4282 |> Jsont.Object.skip_unknown 3528 4283 |> Jsont.Object.finish ··· 3530 4285 end 3531 4286 3532 4287 module VideoPasswordList = struct 4288 + module Types = struct 4289 + module T = struct 4290 + type t = { 4291 + data : VideoPassword.T.t list option; 4292 + total : int option; 4293 + } 4294 + end 4295 + end 4296 + 3533 4297 module T = struct 3534 - type t = { 3535 - data : VideoPassword.T.t list option; 3536 - total : int option; 3537 - } 4298 + include Types.T 3538 4299 3539 4300 let v ?data ?total () = { data; total } 3540 4301 ··· 3552 4313 end 3553 4314 3554 4315 module VideoBlacklist = struct 4316 + module Types = struct 4317 + module T = struct 4318 + type t = { 4319 + created_at : Ptime.t option; 4320 + description : string option; 4321 + dislikes : int option; 4322 + duration : int option; 4323 + id : Id.T.t option; 4324 + likes : int option; 4325 + name : string option; 4326 + nsfw : bool option; 4327 + updated_at : Ptime.t option; 4328 + uuid : Uuidv4.T.t option; 4329 + video_id : Jsont.json option; 4330 + views : int option; 4331 + } 4332 + end 4333 + end 4334 + 3555 4335 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 - } 4336 + include Types.T 3570 4337 3571 4338 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 4339 ··· 3587 4354 Jsont.Object.map ~kind:"VideoBlacklist" 3588 4355 (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 4356 |> 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) 4357 + |> Jsont.Object.opt_mem "description" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:10000 Jsont.string) ~enc:(fun r -> r.description) 3591 4358 |> Jsont.Object.opt_mem "dislikes" Jsont.int ~enc:(fun r -> r.dislikes) 3592 4359 |> Jsont.Object.opt_mem "duration" Jsont.int ~enc:(fun r -> r.duration) 3593 4360 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 3594 4361 |> 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) 4362 + |> Jsont.Object.opt_mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 3596 4363 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 3597 4364 |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 3598 4365 |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) ··· 3604 4371 end 3605 4372 3606 4373 module UserRegistration = struct 4374 + module Types = struct 4375 + module Request = struct 4376 + type t = { 4377 + channel : Jsont.json option; (** channel base information used to create the first channel of the user *) 4378 + display_name : string option; (** editable name of the user, displayed in its representations *) 4379 + email : string; (** email of the user, used for login or service communications *) 4380 + password : Password.T.t; 4381 + username : Username.T.t; (** immutable name of the user, used to find or mention its actor *) 4382 + registration_reason : string; (** reason for the user to register on the instance *) 4383 + } 4384 + end 4385 + 4386 + module T = struct 4387 + type t = { 4388 + account_display_name : string option; 4389 + channel_display_name : string option; 4390 + channel_handle : string option; 4391 + created_at : Ptime.t option; 4392 + email : string option; 4393 + email_verified : bool option; 4394 + id : Id.T.t option; 4395 + moderation_response : string option; 4396 + registration_reason : string option; 4397 + state : Jsont.json option; 4398 + updated_at : Ptime.t option; 4399 + user : Jsont.json option; (** If the registration has been accepted, this is a partial user object created by the registration *) 4400 + username : string option; 4401 + } 4402 + end 4403 + end 4404 + 3607 4405 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 - } 4406 + include Types.Request 3616 4407 3617 4408 let v ~email ~password ~username ~registration_reason ?channel ?display_name () = { channel; display_name; email; password; username; registration_reason } 3618 4409 ··· 3627 4418 Jsont.Object.map ~kind:"UserRegistrationRequest" 3628 4419 (fun channel display_name email password username registration_reason -> { channel; display_name; email; password; username; registration_reason }) 3629 4420 |> 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) 4421 + |> Jsont.Object.opt_mem "displayName" (Openapi.Runtime.validated_string ~min_length:1 ~max_length:120 Jsont.string) ~enc:(fun r -> r.display_name) 3631 4422 |> Jsont.Object.mem "email" Jsont.string ~enc:(fun r -> r.email) 3632 4423 |> Jsont.Object.mem "password" Password.T.jsont ~enc:(fun r -> r.password) 3633 4424 |> Jsont.Object.mem "username" Username.T.jsont ~enc:(fun r -> r.username) ··· 3637 4428 end 3638 4429 3639 4430 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 - } 4431 + include Types.T 3655 4432 3656 4433 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 4434 ··· 3708 4485 if Requests.Response.ok response then 3709 4486 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 3710 4487 else 4488 + let body = Requests.Response.text response in 4489 + let parsed_body = 4490 + match Jsont_bytesrw.decode_string Jsont.json body with 4491 + | Ok json -> Some (Openapi.Runtime.Json json) 4492 + | Error _ -> Some (Openapi.Runtime.Raw body) 4493 + in 3711 4494 raise (Openapi.Runtime.Api_error { 3712 4495 operation = op_name; 3713 4496 method_ = "POST"; 3714 4497 url; 3715 4498 status = Requests.Response.status_code response; 3716 - body = Requests.Response.text response; 4499 + body; 4500 + parsed_body; 3717 4501 }) 3718 4502 end 3719 4503 3720 4504 module Job = struct 4505 + module Types = struct 4506 + module T = struct 4507 + type t = { 4508 + created_at : Ptime.t option; 4509 + data : Jsont.json option; 4510 + error : Jsont.json option; 4511 + finished_on : Ptime.t option; 4512 + id : Id.T.t option; 4513 + processed_on : Ptime.t option; 4514 + state : string option; 4515 + type_ : string option; 4516 + } 4517 + end 4518 + end 4519 + 3721 4520 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 - } 4521 + include Types.T 3732 4522 3733 4523 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 4524 ··· 3758 4548 end 3759 4549 3760 4550 module GetMeVideoRating = struct 4551 + module Types = struct 4552 + module T = struct 4553 + type t = { 4554 + id : Id.T.t; 4555 + rating : string; (** Rating of the video *) 4556 + } 4557 + end 4558 + end 4559 + 3761 4560 module T = struct 3762 - type t = { 3763 - id : Id.T.t; 3764 - rating : string; (** Rating of the video *) 3765 - } 4561 + include Types.T 3766 4562 3767 4563 let v ~id ~rating () = { id; rating } 3768 4564 ··· 3795 4591 if Requests.Response.ok response then 3796 4592 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 3797 4593 else 4594 + let body = Requests.Response.text response in 4595 + let parsed_body = 4596 + match Jsont_bytesrw.decode_string Jsont.json body with 4597 + | Ok json -> Some (Openapi.Runtime.Json json) 4598 + | Error _ -> Some (Openapi.Runtime.Raw body) 4599 + in 3798 4600 raise (Openapi.Runtime.Api_error { 3799 4601 operation = op_name; 3800 4602 method_ = "GET"; 3801 4603 url; 3802 4604 status = Requests.Response.status_code response; 3803 - body = Requests.Response.text response; 4605 + body; 4606 + parsed_body; 3804 4607 }) 3805 4608 end 3806 4609 3807 4610 module FileRedundancyInformation = struct 4611 + module Types = struct 4612 + module T = struct 4613 + type t = { 4614 + created_at : Ptime.t option; 4615 + expires_on : Ptime.t option; 4616 + file_url : string option; 4617 + id : Id.T.t option; 4618 + size : int option; 4619 + strategy : string option; 4620 + updated_at : Ptime.t option; 4621 + } 4622 + end 4623 + end 4624 + 3808 4625 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 - } 4626 + include Types.T 3818 4627 3819 4628 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 4629 ··· 3842 4651 end 3843 4652 3844 4653 module FileStorage = struct 4654 + module Types = struct 4655 + module T = struct 4656 + (** The file storage type: 4657 + - `0` File system 4658 + - `1` Object storage 4659 + *) 4660 + type t = string 4661 + end 4662 + end 4663 + 3845 4664 module T = struct 3846 - (** The file storage type: 3847 - - `0` File system 3848 - - `1` Object storage 3849 - *) 3850 - type t = string 3851 - 4665 + include Types.T 3852 4666 let jsont = Jsont.string 3853 4667 end 3854 4668 end 3855 4669 3856 4670 module VideoFile = struct 4671 + module Types = struct 4672 + module T = struct 4673 + type t = { 4674 + file_download_url : string option; (** URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) *) 4675 + file_url : string option; (** Direct URL of the video *) 4676 + fps : float option; (** Frames per second of the video file *) 4677 + has_audio : bool option; (** **PeerTube >= 6.2** The file container has an audio stream *) 4678 + has_video : bool option; (** **PeerTube >= 6.2** The file container has a video stream *) 4679 + height : float option; (** **PeerTube >= 6.1** Video stream height *) 4680 + id : Id.T.t option; 4681 + magnet_uri : string option; (** magnet URI allowing to resolve the video via BitTorrent without a metainfo file *) 4682 + metadata_url : string option; (** URL dereferencing the output of ffprobe on the file *) 4683 + playlist_url : string option; (** Playlist URL of the file if it is owned by a playlist *) 4684 + resolution : VideoResolutionConstant.T.t option; 4685 + size : int option; (** Video file size in bytes *) 4686 + storage : FileStorage.T.t option; 4687 + torrent_download_url : string option; (** URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) *) 4688 + torrent_url : string option; (** Direct URL of the torrent file *) 4689 + width : float option; (** **PeerTube >= 6.1** Video stream width *) 4690 + } 4691 + end 4692 + end 4693 + 3857 4694 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 - } 4695 + include Types.T 3876 4696 3877 4697 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 4698 ··· 3903 4723 |> Jsont.Object.opt_mem "hasVideo" Jsont.bool ~enc:(fun r -> r.has_video) 3904 4724 |> Jsont.Object.opt_mem "height" Jsont.number ~enc:(fun r -> r.height) 3905 4725 |> 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) 4726 + |> Jsont.Object.opt_mem "magnetUri" (Openapi.Runtime.validated_string ~pattern:"/magnet:\\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i" Jsont.string) ~enc:(fun r -> r.magnet_uri) 3907 4727 |> Jsont.Object.opt_mem "metadataUrl" Jsont.string ~enc:(fun r -> r.metadata_url) 3908 4728 |> Jsont.Object.opt_mem "playlistUrl" Jsont.string ~enc:(fun r -> r.playlist_url) 3909 4729 |> Jsont.Object.opt_mem "resolution" VideoResolutionConstant.T.jsont ~enc:(fun r -> r.resolution) ··· 3918 4738 end 3919 4739 3920 4740 module VideoStreamingPlaylistsHls = struct 4741 + module Types = struct 4742 + module T = struct 4743 + type t = { 4744 + files : VideoFile.T.t list option; (** Video files associated to this playlist. 4745 + 4746 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 4747 + *) 4748 + playlist_url : string option; 4749 + redundancies : Jsont.json list option; 4750 + segments_sha256_url : string option; 4751 + } 4752 + end 4753 + end 4754 + 3921 4755 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 - } 4756 + include Types.T 3931 4757 3932 4758 let v ?files ?playlist_url ?redundancies ?segments_sha256_url () = { files; playlist_url; redundancies; segments_sha256_url } 3933 4759 ··· 3949 4775 end 3950 4776 3951 4777 module VideoStreamingPlaylists = struct 4778 + module Types = struct 4779 + module T = struct 4780 + type t = { 4781 + id : Id.T.t option; 4782 + type_ : int option; (** Playlist type: 4783 + - `1`: HLS 4784 + *) 4785 + files : VideoFile.T.t list option; (** Video files associated to this playlist. 4786 + 4787 + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) 4788 + *) 4789 + playlist_url : string option; 4790 + redundancies : Jsont.json list option; 4791 + segments_sha256_url : string option; 4792 + } 4793 + end 4794 + end 4795 + 3952 4796 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 - } 4797 + include Types.T 3966 4798 3967 4799 let v ?id ?type_ ?files ?playlist_url ?redundancies ?segments_sha256_url () = { id; type_; files; playlist_url; redundancies; segments_sha256_url } 3968 4800 ··· 3988 4820 end 3989 4821 3990 4822 module CustomHomepage = struct 4823 + module Types = struct 4824 + module T = struct 4825 + type t = { 4826 + content : string option; 4827 + } 4828 + end 4829 + end 4830 + 3991 4831 module T = struct 3992 - type t = { 3993 - content : string option; 3994 - } 4832 + include Types.T 3995 4833 3996 4834 let v ?content () = { content } 3997 4835 ··· 4020 4858 if Requests.Response.ok response then 4021 4859 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4022 4860 else 4861 + let body = Requests.Response.text response in 4862 + let parsed_body = 4863 + match Jsont_bytesrw.decode_string Jsont.json body with 4864 + | Ok json -> Some (Openapi.Runtime.Json json) 4865 + | Error _ -> Some (Openapi.Runtime.Raw body) 4866 + in 4023 4867 raise (Openapi.Runtime.Api_error { 4024 4868 operation = op_name; 4025 4869 method_ = "GET"; 4026 4870 url; 4027 4871 status = Requests.Response.status_code response; 4028 - body = Requests.Response.text response; 4872 + body; 4873 + parsed_body; 4029 4874 }) 4030 4875 end 4031 4876 4032 4877 module CommentAutoTagPolicies = struct 4878 + module Types = struct 4879 + module T = struct 4880 + type t = { 4881 + review : string list option; (** Auto tags that automatically set the comment in review state *) 4882 + } 4883 + end 4884 + end 4885 + 4033 4886 module T = struct 4034 - type t = { 4035 - review : string list option; (** Auto tags that automatically set the comment in review state *) 4036 - } 4887 + include Types.T 4037 4888 4038 4889 let v ?review () = { review } 4039 4890 ··· 4066 4917 if Requests.Response.ok response then 4067 4918 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4068 4919 else 4920 + let body = Requests.Response.text response in 4921 + let parsed_body = 4922 + match Jsont_bytesrw.decode_string Jsont.json body with 4923 + | Ok json -> Some (Openapi.Runtime.Json json) 4924 + | Error _ -> Some (Openapi.Runtime.Raw body) 4925 + in 4069 4926 raise (Openapi.Runtime.Api_error { 4070 4927 operation = op_name; 4071 4928 method_ = "GET"; 4072 4929 url; 4073 4930 status = Requests.Response.status_code response; 4074 - body = Requests.Response.text response; 4931 + body; 4932 + parsed_body; 4075 4933 }) 4076 4934 end 4077 4935 4078 4936 module ChannelActivityList = struct 4937 + module Types = struct 4938 + module Response = struct 4939 + type t = { 4940 + data : Jsont.json list option; 4941 + total : int option; 4942 + } 4943 + end 4944 + end 4945 + 4079 4946 module Response = struct 4080 - type t = { 4081 - data : Jsont.json list option; 4082 - total : int option; 4083 - } 4947 + include Types.Response 4084 4948 4085 4949 let v ?data ?total () = { data; total } 4086 4950 ··· 4118 4982 if Requests.Response.ok response then 4119 4983 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 4120 4984 else 4985 + let body = Requests.Response.text response in 4986 + let parsed_body = 4987 + match Jsont_bytesrw.decode_string Jsont.json body with 4988 + | Ok json -> Some (Openapi.Runtime.Json json) 4989 + | Error _ -> Some (Openapi.Runtime.Raw body) 4990 + in 4121 4991 raise (Openapi.Runtime.Api_error { 4122 4992 operation = op_name; 4123 4993 method_ = "GET"; 4124 4994 url; 4125 4995 status = Requests.Response.status_code response; 4126 - body = Requests.Response.text response; 4996 + body; 4997 + parsed_body; 4127 4998 }) 4128 4999 end 4129 5000 4130 5001 module Block = struct 5002 + module Types = struct 5003 + module Status = struct 5004 + type t = { 5005 + accounts : Jsont.json option; 5006 + hosts : Jsont.json option; 5007 + } 5008 + end 5009 + end 5010 + 4131 5011 module Status = struct 4132 - type t = { 4133 - accounts : Jsont.json option; 4134 - hosts : Jsont.json option; 4135 - } 5012 + include Types.Status 4136 5013 4137 5014 let v ?accounts ?hosts () = { accounts; hosts } 4138 5015 ··· 4166 5043 if Requests.Response.ok response then 4167 5044 Openapi.Runtime.Json.decode_json_exn Status.jsont (Requests.Response.json response) 4168 5045 else 5046 + let body = Requests.Response.text response in 5047 + let parsed_body = 5048 + match Jsont_bytesrw.decode_string Jsont.json body with 5049 + | Ok json -> Some (Openapi.Runtime.Json json) 5050 + | Error _ -> Some (Openapi.Runtime.Raw body) 5051 + in 4169 5052 raise (Openapi.Runtime.Api_error { 4170 5053 operation = op_name; 4171 5054 method_ = "GET"; 4172 5055 url; 4173 5056 status = Requests.Response.status_code response; 4174 - body = Requests.Response.text response; 5057 + body; 5058 + parsed_body; 4175 5059 }) 4176 5060 end 4177 5061 4178 5062 module AutomaticTagAvailable = struct 5063 + module Types = struct 5064 + module T = struct 5065 + type t = { 5066 + available : Jsont.json list option; (** Available auto tags that can be used to filter objects or set a comment in review state *) 5067 + } 5068 + end 5069 + end 5070 + 4179 5071 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 - } 5072 + include Types.T 4183 5073 4184 5074 let v ?available () = { available } 4185 5075 ··· 4212 5102 if Requests.Response.ok response then 4213 5103 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4214 5104 else 5105 + let body = Requests.Response.text response in 5106 + let parsed_body = 5107 + match Jsont_bytesrw.decode_string Jsont.json body with 5108 + | Ok json -> Some (Openapi.Runtime.Json json) 5109 + | Error _ -> Some (Openapi.Runtime.Raw body) 5110 + in 4215 5111 raise (Openapi.Runtime.Api_error { 4216 5112 operation = op_name; 4217 5113 method_ = "GET"; 4218 5114 url; 4219 5115 status = Requests.Response.status_code response; 4220 - body = Requests.Response.text response; 5116 + body; 5117 + parsed_body; 4221 5118 }) 4222 5119 4223 5120 (** Get server available auto tags ··· 4237 5134 if Requests.Response.ok response then 4238 5135 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4239 5136 else 5137 + let body = Requests.Response.text response in 5138 + let parsed_body = 5139 + match Jsont_bytesrw.decode_string Jsont.json body with 5140 + | Ok json -> Some (Openapi.Runtime.Json json) 5141 + | Error _ -> Some (Openapi.Runtime.Raw body) 5142 + in 4240 5143 raise (Openapi.Runtime.Api_error { 4241 5144 operation = op_name; 4242 5145 method_ = "GET"; 4243 5146 url; 4244 5147 status = Requests.Response.status_code response; 4245 - body = Requests.Response.text response; 5148 + body; 5149 + parsed_body; 4246 5150 }) 4247 5151 end 4248 5152 4249 5153 module AddVideoPasswords = struct 5154 + module Types = struct 5155 + module T = struct 5156 + type t = Jsont.json 5157 + end 5158 + end 5159 + 4250 5160 module T = struct 4251 - type t = Jsont.json 4252 - 5161 + include Types.T 4253 5162 let jsont = Jsont.json 4254 - 4255 5163 let v () = Jsont.Null ((), Jsont.Meta.none) 4256 5164 end 4257 5165 end 4258 5166 4259 5167 module VideoUploadRequestResumable = struct 5168 + module Types = struct 5169 + module T = struct 5170 + type t = { 5171 + category : VideoCategorySet.T.t option; 5172 + channel_id : int; (** Channel id that will contain this video *) 5173 + comments_policy : VideoCommentsPolicySet.T.t option; 5174 + description : string option; (** Video description *) 5175 + download_enabled : bool option; (** Enable or disable downloading for this video *) 5176 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 5177 + language : VideoLanguageSet.T.t option; 5178 + licence : VideoLicenceSet.T.t option; 5179 + name : string; (** Video name *) 5180 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 5181 + nsfw_flags : Nsfwflag.T.t option; 5182 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 5183 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 5184 + privacy : VideoPrivacySet.T.t option; 5185 + schedule_update : VideoScheduled.Update.t option; 5186 + support : string option; (** A text tell the audience how to support the video creator *) 5187 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 5188 + video_passwords : AddVideoPasswords.T.t option; 5189 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 5190 + filename : string; (** Video filename including extension *) 5191 + thumbnailfile : string option; (** Video thumbnail file *) 5192 + previewfile : string option; (** Video preview file *) 5193 + } 5194 + end 5195 + end 5196 + 4260 5197 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 - } 5198 + include Types.T 4285 5199 4286 5200 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 5201 ··· 4312 5226 Jsont.Object.map ~kind:"VideoUploadRequestResumable" 4313 5227 (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 5228 |> 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) 5229 + |> Jsont.Object.mem "channelId" (Openapi.Runtime.validated_int ~minimum:1. Jsont.int) ~enc:(fun r -> r.channel_id) 4316 5230 |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4317 5231 |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4318 5232 |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4319 5233 |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4320 5234 |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4321 5235 |> 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) 5236 + |> Jsont.Object.mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 4323 5237 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4324 5238 |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4325 5239 |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) ··· 4327 5241 |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4328 5242 |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4329 5243 |> 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) 5244 + |> Jsont.Object.opt_mem "tags" (Openapi.Runtime.validated_list ~min_items:1 ~max_items:5 ~unique_items:true Jsont.string) ~enc:(fun r -> r.tags) 4331 5245 |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4332 5246 |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) 4333 5247 |> Jsont.Object.mem "filename" Jsont.string ~enc:(fun r -> r.filename) ··· 4339 5253 end 4340 5254 4341 5255 module VideoUploadRequestLegacy = struct 5256 + module Types = struct 5257 + module T = struct 5258 + type t = { 5259 + category : VideoCategorySet.T.t option; 5260 + channel_id : int; (** Channel id that will contain this video *) 5261 + comments_policy : VideoCommentsPolicySet.T.t option; 5262 + description : string option; (** Video description *) 5263 + download_enabled : bool option; (** Enable or disable downloading for this video *) 5264 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 5265 + language : VideoLanguageSet.T.t option; 5266 + licence : VideoLicenceSet.T.t option; 5267 + name : string; (** Video name *) 5268 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 5269 + nsfw_flags : Nsfwflag.T.t option; 5270 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 5271 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 5272 + previewfile : string option; (** Video preview file *) 5273 + privacy : VideoPrivacySet.T.t option; 5274 + schedule_update : VideoScheduled.Update.t option; 5275 + support : string option; (** A text tell the audience how to support the video creator *) 5276 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 5277 + thumbnailfile : string option; (** Video thumbnail file *) 5278 + video_passwords : AddVideoPasswords.T.t option; 5279 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 5280 + videofile : string; (** Video file *) 5281 + } 5282 + end 5283 + end 5284 + 4342 5285 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 - } 5286 + include Types.T 4367 5287 4368 5288 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 5289 ··· 4394 5314 Jsont.Object.map ~kind:"VideoUploadRequestLegacy" 4395 5315 (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 5316 |> 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) 5317 + |> Jsont.Object.mem "channelId" (Openapi.Runtime.validated_int ~minimum:1. Jsont.int) ~enc:(fun r -> r.channel_id) 4398 5318 |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4399 5319 |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4400 5320 |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4401 5321 |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4402 5322 |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4403 5323 |> 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) 5324 + |> Jsont.Object.mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 4405 5325 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4406 5326 |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4407 5327 |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) ··· 4410 5330 |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4411 5331 |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4412 5332 |> 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) 5333 + |> Jsont.Object.opt_mem "tags" (Openapi.Runtime.validated_list ~min_items:1 ~max_items:5 ~unique_items:true Jsont.string) ~enc:(fun r -> r.tags) 4414 5334 |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4415 5335 |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4416 5336 |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) ··· 4421 5341 end 4422 5342 4423 5343 module VideoUploadRequestCommon = struct 5344 + module Types = struct 5345 + module T = struct 5346 + type t = { 5347 + category : VideoCategorySet.T.t option; 5348 + channel_id : int; (** Channel id that will contain this video *) 5349 + comments_policy : VideoCommentsPolicySet.T.t option; 5350 + description : string option; (** Video description *) 5351 + download_enabled : bool option; (** Enable or disable downloading for this video *) 5352 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 5353 + language : VideoLanguageSet.T.t option; 5354 + licence : VideoLicenceSet.T.t option; 5355 + name : string; (** Video name *) 5356 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 5357 + nsfw_flags : Nsfwflag.T.t option; 5358 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 5359 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 5360 + previewfile : string option; (** Video preview file *) 5361 + privacy : VideoPrivacySet.T.t option; 5362 + schedule_update : VideoScheduled.Update.t option; 5363 + support : string option; (** A text tell the audience how to support the video creator *) 5364 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 5365 + thumbnailfile : string option; (** Video thumbnail file *) 5366 + video_passwords : AddVideoPasswords.T.t option; 5367 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 5368 + } 5369 + end 5370 + end 5371 + 4424 5372 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 - } 5373 + include Types.T 4448 5374 4449 5375 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 5376 ··· 4474 5400 Jsont.Object.map ~kind:"VideoUploadRequestCommon" 4475 5401 (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 5402 |> 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) 5403 + |> Jsont.Object.mem "channelId" (Openapi.Runtime.validated_int ~minimum:1. Jsont.int) ~enc:(fun r -> r.channel_id) 4478 5404 |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4479 5405 |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4480 5406 |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4481 5407 |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4482 5408 |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4483 5409 |> 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) 5410 + |> Jsont.Object.mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 4485 5411 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4486 5412 |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4487 5413 |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) ··· 4490 5416 |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4491 5417 |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4492 5418 |> 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) 5419 + |> Jsont.Object.opt_mem "tags" (Openapi.Runtime.validated_list ~min_items:1 ~max_items:5 ~unique_items:true Jsont.string) ~enc:(fun r -> r.tags) 4494 5420 |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4495 5421 |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4496 5422 |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) ··· 4500 5426 end 4501 5427 4502 5428 module VideoCreateImport = struct 5429 + module Types = struct 5430 + module T = struct 5431 + type t = { 5432 + category : VideoCategorySet.T.t option; 5433 + channel_id : int; (** Channel id that will contain this video *) 5434 + comments_policy : VideoCommentsPolicySet.T.t option; 5435 + description : string option; (** Video description *) 5436 + download_enabled : bool option; (** Enable or disable downloading for this video *) 5437 + generate_transcription : bool option; (** **PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video *) 5438 + language : VideoLanguageSet.T.t option; 5439 + licence : VideoLicenceSet.T.t option; 5440 + name : string; (** Video name *) 5441 + nsfw : bool option; (** Whether or not this video contains sensitive content *) 5442 + nsfw_flags : Nsfwflag.T.t option; 5443 + nsfw_summary : Jsont.json option; (** More information about the sensitive content of the video *) 5444 + originally_published_at : Ptime.t option; (** Date when the content was originally published *) 5445 + previewfile : string option; (** Video preview file *) 5446 + privacy : VideoPrivacySet.T.t option; 5447 + schedule_update : VideoScheduled.Update.t option; 5448 + support : string option; (** A text tell the audience how to support the video creator *) 5449 + tags : string list option; (** Video tags (maximum 5 tags each between 2 and 30 characters) *) 5450 + thumbnailfile : string option; (** Video thumbnail file *) 5451 + video_passwords : AddVideoPasswords.T.t option; 5452 + wait_transcoding : bool option; (** Whether or not we wait transcoding before publish the video *) 5453 + } 5454 + end 5455 + end 5456 + 4503 5457 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 - } 5458 + include Types.T 4527 5459 4528 5460 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 5461 ··· 4553 5485 Jsont.Object.map ~kind:"VideoCreateImport" 4554 5486 (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 5487 |> 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) 5488 + |> Jsont.Object.mem "channelId" (Openapi.Runtime.validated_int ~minimum:1. Jsont.int) ~enc:(fun r -> r.channel_id) 4557 5489 |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicySet.T.jsont ~enc:(fun r -> r.comments_policy) 4558 5490 |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun r -> r.description) 4559 5491 |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 4560 5492 |> Jsont.Object.opt_mem "generateTranscription" Jsont.bool ~enc:(fun r -> r.generate_transcription) 4561 5493 |> Jsont.Object.opt_mem "language" VideoLanguageSet.T.jsont ~enc:(fun r -> r.language) 4562 5494 |> 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) 5495 + |> Jsont.Object.mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 4564 5496 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 4565 5497 |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 4566 5498 |> Jsont.Object.opt_mem "nsfwSummary" Jsont.json ~enc:(fun r -> r.nsfw_summary) ··· 4569 5501 |> Jsont.Object.opt_mem "privacy" VideoPrivacySet.T.jsont ~enc:(fun r -> r.privacy) 4570 5502 |> Jsont.Object.opt_mem "scheduleUpdate" VideoScheduled.Update.jsont ~enc:(fun r -> r.schedule_update) 4571 5503 |> 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) 5504 + |> Jsont.Object.opt_mem "tags" (Openapi.Runtime.validated_list ~min_items:1 ~max_items:5 ~unique_items:true Jsont.string) ~enc:(fun r -> r.tags) 4573 5505 |> Jsont.Object.opt_mem "thumbnailfile" Jsont.string ~enc:(fun r -> r.thumbnailfile) 4574 5506 |> Jsont.Object.opt_mem "videoPasswords" AddVideoPasswords.T.jsont ~enc:(fun r -> r.video_passwords) 4575 5507 |> Jsont.Object.opt_mem "waitTranscoding" Jsont.bool ~enc:(fun r -> r.wait_transcoding) ··· 4579 5511 end 4580 5512 4581 5513 module ActorImage = struct 5514 + module Types = struct 5515 + module T = struct 5516 + type t = { 5517 + created_at : Ptime.t option; 5518 + file_url : string option; (** **PeerTube >= 7.1** *) 5519 + height : int option; (** **PeerTube >= 7.3** *) 5520 + path : string option; (** Deprecated in PeerTube v8.0, use fileUrl instead *) 5521 + updated_at : Ptime.t option; 5522 + width : int option; 5523 + } 5524 + end 5525 + end 5526 + 4582 5527 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 - } 5528 + include Types.T 4591 5529 4592 5530 let v ?created_at ?file_url ?height ?path ?updated_at ?width () = { created_at; file_url; height; path; updated_at; width } 4593 5531 ··· 4613 5551 end 4614 5552 4615 5553 module VideoChannelSummary = struct 5554 + module Types = struct 5555 + module T = struct 5556 + type t = { 5557 + avatars : ActorImage.T.t list option; 5558 + display_name : string option; 5559 + host : string option; 5560 + id : Id.T.t option; 5561 + name : string option; 5562 + url : string option; 5563 + } 5564 + end 5565 + end 5566 + 4616 5567 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 - } 5568 + include Types.T 4625 5569 4626 5570 let v ?avatars ?display_name ?host ?id ?name ?url () = { avatars; display_name; host; id; name; url } 4627 5571 ··· 4647 5591 end 4648 5592 4649 5593 module Actor = struct 5594 + module Types = struct 5595 + module Info = struct 5596 + type t = { 5597 + avatars : ActorImage.T.t list option; 5598 + display_name : string option; 5599 + host : string option; 5600 + id : Id.T.t option; 5601 + name : string option; 5602 + } 5603 + end 5604 + 5605 + module T = struct 5606 + type t = { 5607 + avatars : ActorImage.T.t list option; 5608 + created_at : Ptime.t option; 5609 + followers_count : int option; (** number of followers of this actor, as seen by this instance *) 5610 + following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 5611 + host : string option; (** server on which the actor is resident *) 5612 + host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 5613 + id : Id.T.t option; 5614 + name : Username.T.t option; (** immutable name of the actor, used to find or mention it *) 5615 + updated_at : Ptime.t option; 5616 + url : string option; 5617 + } 5618 + end 5619 + end 5620 + 4650 5621 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 - } 5622 + include Types.Info 4658 5623 4659 5624 let v ?avatars ?display_name ?host ?id ?name () = { avatars; display_name; host; id; name } 4660 5625 ··· 4677 5642 end 4678 5643 4679 5644 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 - } 5645 + include Types.T 4692 5646 4693 5647 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 5648 ··· 4708 5662 (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 5663 |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 4710 5664 |> 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) 5665 + |> Jsont.Object.opt_mem "followersCount" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.followers_count) 5666 + |> Jsont.Object.opt_mem "followingCount" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.following_count) 4713 5667 |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 4714 5668 |> Jsont.Object.mem "hostRedundancyAllowed" Openapi.Runtime.nullable_bool 4715 5669 ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.host_redundancy_allowed) ··· 4723 5677 end 4724 5678 4725 5679 module Follow = struct 5680 + module Types = struct 5681 + module T = struct 5682 + type t = { 5683 + created_at : Ptime.t option; 5684 + follower : Actor.T.t option; 5685 + following : Actor.T.t option; 5686 + id : Id.T.t option; 5687 + score : float option; (** score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. *) 5688 + state : string option; 5689 + updated_at : Ptime.t option; 5690 + } 5691 + end 5692 + end 5693 + 4726 5694 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 - } 5695 + include Types.T 4736 5696 4737 5697 let v ?created_at ?follower ?following ?id ?score ?state ?updated_at () = { created_at; follower; following; id; score; state; updated_at } 4738 5698 ··· 4760 5720 end 4761 5721 4762 5722 module AccountSummary = struct 5723 + module Types = struct 5724 + module T = struct 5725 + type t = { 5726 + avatars : ActorImage.T.t list option; 5727 + display_name : string option; 5728 + host : string option; 5729 + id : int option; 5730 + name : string option; 5731 + url : string option; 5732 + } 5733 + end 5734 + end 5735 + 4763 5736 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 - } 5737 + include Types.T 4772 5738 4773 5739 let v ?avatars ?display_name ?host ?id ?name ?url () = { avatars; display_name; host; id; name; url } 4774 5740 ··· 4794 5760 end 4795 5761 4796 5762 module VideoPlaylist = struct 5763 + module Types = struct 5764 + module T = struct 5765 + type t = { 5766 + created_at : Ptime.t option; 5767 + description : string option; 5768 + display_name : string option; 5769 + id : Id.T.t option; 5770 + is_local : bool option; 5771 + owner_account : AccountSummary.T.t option; 5772 + privacy : VideoPlaylistPrivacyConstant.T.t option; 5773 + short_uuid : ShortUuid.T.t option; 5774 + thumbnail_path : string option; 5775 + type_ : VideoPlaylistTypeConstant.T.t option; 5776 + updated_at : Ptime.t option; 5777 + uuid : Uuidv4.T.t option; 5778 + video_channel : VideoChannelSummary.T.t option; 5779 + video_channel_position : int option; (** Position of the playlist in the channel *) 5780 + video_length : int option; 5781 + } 5782 + end 5783 + end 5784 + 4797 5785 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 - } 5786 + include Types.T 4815 5787 4816 5788 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 5789 ··· 4835 5807 Jsont.Object.map ~kind:"VideoPlaylist" 4836 5808 (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 5809 |> 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) 5810 + |> Jsont.Object.opt_mem "description" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:1000 Jsont.string) ~enc:(fun r -> r.description) 5811 + |> Jsont.Object.opt_mem "displayName" (Openapi.Runtime.validated_string ~min_length:1 ~max_length:120 Jsont.string) ~enc:(fun r -> r.display_name) 4840 5812 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 4841 5813 |> Jsont.Object.opt_mem "isLocal" Jsont.bool ~enc:(fun r -> r.is_local) 4842 5814 |> Jsont.Object.opt_mem "ownerAccount" AccountSummary.T.jsont ~enc:(fun r -> r.owner_account) ··· 4847 5819 |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 4848 5820 |> Jsont.Object.opt_mem "uuid" Uuidv4.T.jsont ~enc:(fun r -> r.uuid) 4849 5821 |> 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) 5822 + |> Jsont.Object.opt_mem "videoChannelPosition" (Openapi.Runtime.validated_int ~minimum:1. Jsont.int) ~enc:(fun r -> r.video_channel_position) 5823 + |> Jsont.Object.opt_mem "videoLength" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.video_length) 4852 5824 |> Jsont.Object.skip_unknown 4853 5825 |> Jsont.Object.finish 4854 5826 end ··· 4870 5842 if Requests.Response.ok response then 4871 5843 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 4872 5844 else 5845 + let body = Requests.Response.text response in 5846 + let parsed_body = 5847 + match Jsont_bytesrw.decode_string Jsont.json body with 5848 + | Ok json -> Some (Openapi.Runtime.Json json) 5849 + | Error _ -> Some (Openapi.Runtime.Raw body) 5850 + in 4873 5851 raise (Openapi.Runtime.Api_error { 4874 5852 operation = op_name; 4875 5853 method_ = "GET"; 4876 5854 url; 4877 5855 status = Requests.Response.status_code response; 4878 - body = Requests.Response.text response; 5856 + body; 5857 + parsed_body; 4879 5858 }) 4880 5859 end 4881 5860 4882 5861 module VideoChannelCollaborator = struct 5862 + module Types = struct 5863 + module T = struct 5864 + (** Representation of a channel collaboration *) 5865 + type t = { 5866 + account : AccountSummary.T.t option; 5867 + created_at : Ptime.t option; 5868 + id : Id.T.t option; 5869 + state : Jsont.json option; 5870 + updated_at : Ptime.t option; 5871 + } 5872 + end 5873 + end 5874 + 4883 5875 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 - } 5876 + include Types.T 4892 5877 4893 5878 let v ?account ?created_at ?id ?state ?updated_at () = { account; created_at; id; state; updated_at } 4894 5879 ··· 4912 5897 end 4913 5898 4914 5899 module Video = struct 5900 + module Types = struct 5901 + module Info = struct 5902 + type t = { 5903 + id : Jsont.json option; 5904 + name : Jsont.json option; 5905 + state : Jsont.json option; 5906 + uuid : Jsont.json option; 5907 + } 5908 + end 5909 + 5910 + module T = struct 5911 + type t = { 5912 + account : AccountSummary.T.t option; 5913 + aspect_ratio : float option; (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 5914 + blacklisted : bool option; 5915 + blacklisted_reason : string option; 5916 + category : VideoConstantNumberCategory.T.t option; (** category in which the video is classified *) 5917 + channel : VideoChannelSummary.T.t option; 5918 + comments : int option; (** **PeerTube >= 7.2** Number of comments on the video *) 5919 + created_at : Ptime.t option; (** time at which the video object was first drafted *) 5920 + dislikes : int option; 5921 + duration : int option; (** duration of the video in seconds *) 5922 + embed_path : string option; 5923 + id : Id.T.t option; (** object id for the video *) 5924 + is_live : bool option; 5925 + is_local : bool option; 5926 + language : VideoConstantStringLanguage.T.t option; (** main language used in the video *) 5927 + licence : VideoConstantNumberLicence.T.t option; (** licence under which the video is distributed *) 5928 + likes : int option; 5929 + live_schedules : LiveSchedule.T.t list option; 5930 + name : string option; (** title of the video *) 5931 + nsfw : bool option; 5932 + nsfw_flags : Nsfwflag.T.t option; 5933 + nsfw_summary : string option; (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 5934 + originally_published_at : Ptime.t option; (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 5935 + preview_path : string option; 5936 + privacy : VideoPrivacyConstant.T.t option; (** privacy policy used to distribute the video *) 5937 + 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. *) 5938 + scheduled_update : VideoScheduled.Update.t option; 5939 + short_uuid : ShortUuid.T.t option; 5940 + state : VideoStateConstant.T.t option; (** represents the internal state of the video processing within the PeerTube instance *) 5941 + thumbnail_path : string option; 5942 + truncated_description : string option; (** truncated description of the video, written in Markdown. 5943 + *) 5944 + updated_at : Ptime.t option; (** last time the video's metadata was modified *) 5945 + user_history : Jsont.json option; 5946 + uuid : Uuidv4.T.t option; (** universal identifier for the video, that can be used across instances *) 5947 + views : int option; 5948 + wait_transcoding : bool option; 5949 + } 5950 + end 5951 + end 5952 + 4915 5953 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 - } 5954 + include Types.Info 4922 5955 4923 5956 let v ?id ?name ?state ?uuid () = { id; name; state; uuid } 4924 5957 ··· 4939 5972 end 4940 5973 4941 5974 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 - } 5975 + include Types.T 4981 5976 4982 5977 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 5978 ··· 5042 6037 |> Jsont.Object.opt_mem "licence" VideoConstantNumberLicence.T.jsont ~enc:(fun r -> r.licence) 5043 6038 |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 5044 6039 |> 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) 6040 + |> Jsont.Object.opt_mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 5046 6041 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 5047 6042 |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 5048 6043 |> Jsont.Object.opt_mem "nsfwSummary" Jsont.string ~enc:(fun r -> r.nsfw_summary) ··· 5070 6065 end 5071 6066 5072 6067 module VideoRating = struct 6068 + module Types = struct 6069 + module T = struct 6070 + type t = { 6071 + rating : string; (** Rating of the video *) 6072 + video : Video.T.t; 6073 + } 6074 + end 6075 + end 6076 + 5073 6077 module T = struct 5074 - type t = { 5075 - rating : string; (** Rating of the video *) 5076 - video : Video.T.t; 5077 - } 6078 + include Types.T 5078 6079 5079 6080 let v ~rating ~video () = { rating; video } 5080 6081 ··· 5111 6112 if Requests.Response.ok response then 5112 6113 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 5113 6114 else 6115 + let body = Requests.Response.text response in 6116 + let parsed_body = 6117 + match Jsont_bytesrw.decode_string Jsont.json body with 6118 + | Ok json -> Some (Openapi.Runtime.Json json) 6119 + | Error _ -> Some (Openapi.Runtime.Raw body) 6120 + in 5114 6121 raise (Openapi.Runtime.Api_error { 5115 6122 operation = op_name; 5116 6123 method_ = "GET"; 5117 6124 url; 5118 6125 status = Requests.Response.status_code response; 5119 - body = Requests.Response.text response; 6126 + body; 6127 + parsed_body; 5120 6128 }) 5121 6129 end 5122 6130 5123 6131 module VideoList = struct 6132 + module Types = struct 6133 + module Response = struct 6134 + type t = { 6135 + data : Video.T.t list option; 6136 + total : int option; 6137 + } 6138 + end 6139 + end 6140 + 5124 6141 module Response = struct 5125 - type t = { 5126 - data : Video.T.t list option; 5127 - total : int option; 5128 - } 6142 + include Types.Response 5129 6143 5130 6144 let v ?data ?total () = { data; total } 5131 6145 ··· 5135 6149 let jsont : t Jsont.t = 5136 6150 Jsont.Object.map ~kind:"VideoListResponse" 5137 6151 (fun data total -> { data; total }) 5138 - |> Jsont.Object.opt_mem "data" (Jsont.list Video.T.jsont) ~enc:(fun r -> r.data) 6152 + |> Jsont.Object.opt_mem "data" (Openapi.Runtime.validated_list ~max_items:100 Video.T.jsont) ~enc:(fun r -> r.data) 5139 6153 |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 5140 6154 |> Jsont.Object.skip_unknown 5141 6155 |> Jsont.Object.finish ··· 5188 6202 if Requests.Response.ok response then 5189 6203 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5190 6204 else 6205 + let body = Requests.Response.text response in 6206 + let parsed_body = 6207 + match Jsont_bytesrw.decode_string Jsont.json body with 6208 + | Ok json -> Some (Openapi.Runtime.Json json) 6209 + | Error _ -> Some (Openapi.Runtime.Raw body) 6210 + in 5191 6211 raise (Openapi.Runtime.Api_error { 5192 6212 operation = op_name; 5193 6213 method_ = "GET"; 5194 6214 url; 5195 6215 status = Requests.Response.status_code response; 5196 - body = Requests.Response.text response; 6216 + body; 6217 + parsed_body; 5197 6218 }) 5198 6219 5199 6220 (** Search videos ··· 5259 6280 if Requests.Response.ok response then 5260 6281 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5261 6282 else 6283 + let body = Requests.Response.text response in 6284 + let parsed_body = 6285 + match Jsont_bytesrw.decode_string Jsont.json body with 6286 + | Ok json -> Some (Openapi.Runtime.Json json) 6287 + | Error _ -> Some (Openapi.Runtime.Raw body) 6288 + in 5262 6289 raise (Openapi.Runtime.Api_error { 5263 6290 operation = op_name; 5264 6291 method_ = "GET"; 5265 6292 url; 5266 6293 status = Requests.Response.status_code response; 5267 - body = Requests.Response.text response; 6294 + body; 6295 + parsed_body; 5268 6296 }) 5269 6297 5270 6298 (** List watched videos history ··· 5286 6314 if Requests.Response.ok response then 5287 6315 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5288 6316 else 6317 + let body = Requests.Response.text response in 6318 + let parsed_body = 6319 + match Jsont_bytesrw.decode_string Jsont.json body with 6320 + | Ok json -> Some (Openapi.Runtime.Json json) 6321 + | Error _ -> Some (Openapi.Runtime.Raw body) 6322 + in 5289 6323 raise (Openapi.Runtime.Api_error { 5290 6324 operation = op_name; 5291 6325 method_ = "GET"; 5292 6326 url; 5293 6327 status = Requests.Response.status_code response; 5294 - body = Requests.Response.text response; 6328 + body; 6329 + parsed_body; 5295 6330 }) 5296 6331 5297 6332 (** List videos of subscriptions of my user ··· 5340 6375 if Requests.Response.ok response then 5341 6376 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5342 6377 else 6378 + let body = Requests.Response.text response in 6379 + let parsed_body = 6380 + match Jsont_bytesrw.decode_string Jsont.json body with 6381 + | Ok json -> Some (Openapi.Runtime.Json json) 6382 + | Error _ -> Some (Openapi.Runtime.Raw body) 6383 + in 5343 6384 raise (Openapi.Runtime.Api_error { 5344 6385 operation = op_name; 5345 6386 method_ = "GET"; 5346 6387 url; 5347 6388 status = Requests.Response.status_code response; 5348 - body = Requests.Response.text response; 6389 + body; 6390 + parsed_body; 5349 6391 }) 5350 6392 5351 6393 (** List videos of my user ··· 5396 6438 if Requests.Response.ok response then 5397 6439 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5398 6440 else 6441 + let body = Requests.Response.text response in 6442 + let parsed_body = 6443 + match Jsont_bytesrw.decode_string Jsont.json body with 6444 + | Ok json -> Some (Openapi.Runtime.Json json) 6445 + | Error _ -> Some (Openapi.Runtime.Raw body) 6446 + in 5399 6447 raise (Openapi.Runtime.Api_error { 5400 6448 operation = op_name; 5401 6449 method_ = "GET"; 5402 6450 url; 5403 6451 status = Requests.Response.status_code response; 5404 - body = Requests.Response.text response; 6452 + body; 6453 + parsed_body; 5405 6454 }) 5406 6455 5407 6456 (** List videos of a video channel ··· 5451 6500 if Requests.Response.ok response then 5452 6501 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5453 6502 else 6503 + let body = Requests.Response.text response in 6504 + let parsed_body = 6505 + match Jsont_bytesrw.decode_string Jsont.json body with 6506 + | Ok json -> Some (Openapi.Runtime.Json json) 6507 + | Error _ -> Some (Openapi.Runtime.Raw body) 6508 + in 5454 6509 raise (Openapi.Runtime.Api_error { 5455 6510 operation = op_name; 5456 6511 method_ = "GET"; 5457 6512 url; 5458 6513 status = Requests.Response.status_code response; 5459 - body = Requests.Response.text response; 6514 + body; 6515 + parsed_body; 5460 6516 }) 5461 6517 5462 6518 (** List videos ··· 5505 6561 if Requests.Response.ok response then 5506 6562 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5507 6563 else 6564 + let body = Requests.Response.text response in 6565 + let parsed_body = 6566 + match Jsont_bytesrw.decode_string Jsont.json body with 6567 + | Ok json -> Some (Openapi.Runtime.Json json) 6568 + | Error _ -> Some (Openapi.Runtime.Raw body) 6569 + in 5508 6570 raise (Openapi.Runtime.Api_error { 5509 6571 operation = op_name; 5510 6572 method_ = "GET"; 5511 6573 url; 5512 6574 status = Requests.Response.status_code response; 5513 - body = Requests.Response.text response; 6575 + body; 6576 + parsed_body; 5514 6577 }) 5515 6578 end 5516 6579 5517 6580 module VideoImport = struct 6581 + module Types = struct 6582 + module T = struct 6583 + type t = { 6584 + created_at : Ptime.t option; 6585 + error : string option; 6586 + id : Id.T.t option; 6587 + magnet_uri : string option; (** magnet URI allowing to resolve the import's source video *) 6588 + state : VideoImportStateConstant.T.t option; 6589 + target_url : string option; (** remote URL where to find the import's source video *) 6590 + torrent_name : string option; 6591 + torrentfile : string option; (** Torrent file containing only the video file *) 6592 + updated_at : Ptime.t option; 6593 + video : Video.T.t option; 6594 + } 6595 + end 6596 + end 6597 + 5518 6598 module T = struct 5519 - type t = { 5520 - created_at : Ptime.t option; 5521 - error : string option; 5522 - id : Id.T.t option; 5523 - magnet_uri : string option; (** magnet URI allowing to resolve the import's source video *) 5524 - state : VideoImportStateConstant.T.t option; 5525 - target_url : string option; (** remote URL where to find the import's source video *) 5526 - torrent_name : string option; 5527 - torrentfile : string option; (** Torrent file containing only the video file *) 5528 - updated_at : Ptime.t option; 5529 - video : Video.T.t option; 5530 - } 6599 + include Types.T 5531 6600 5532 6601 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 } 5533 6602 ··· 5548 6617 |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 5549 6618 |> Jsont.Object.opt_mem "error" Jsont.string ~enc:(fun r -> r.error) 5550 6619 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 5551 - |> Jsont.Object.opt_mem "magnetUri" Jsont.string ~enc:(fun r -> r.magnet_uri) 6620 + |> Jsont.Object.opt_mem "magnetUri" (Openapi.Runtime.validated_string ~pattern:"/magnet:\\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i" Jsont.string) ~enc:(fun r -> r.magnet_uri) 5552 6621 |> Jsont.Object.opt_mem "state" VideoImportStateConstant.T.jsont ~enc:(fun r -> r.state) 5553 6622 |> Jsont.Object.opt_mem "targetUrl" Jsont.string ~enc:(fun r -> r.target_url) 5554 6623 |> Jsont.Object.opt_mem "torrentName" Jsont.string ~enc:(fun r -> r.torrent_name) ··· 5561 6630 end 5562 6631 5563 6632 module VideoImportsList = struct 6633 + module Types = struct 6634 + module T = struct 6635 + type t = { 6636 + data : VideoImport.T.t list option; 6637 + total : int option; 6638 + } 6639 + end 6640 + end 6641 + 5564 6642 module T = struct 5565 - type t = { 5566 - data : VideoImport.T.t list option; 5567 - total : int option; 5568 - } 6643 + include Types.T 5569 6644 5570 6645 let v ?data ?total () = { data; total } 5571 6646 ··· 5575 6650 let jsont : t Jsont.t = 5576 6651 Jsont.Object.map ~kind:"VideoImportsList" 5577 6652 (fun data total -> { data; total }) 5578 - |> Jsont.Object.opt_mem "data" (Jsont.list VideoImport.T.jsont) ~enc:(fun r -> r.data) 6653 + |> Jsont.Object.opt_mem "data" (Openapi.Runtime.validated_list ~max_items:100 VideoImport.T.jsont) ~enc:(fun r -> r.data) 5579 6654 |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 5580 6655 |> Jsont.Object.skip_unknown 5581 6656 |> Jsont.Object.finish ··· 5606 6681 if Requests.Response.ok response then 5607 6682 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 5608 6683 else 6684 + let body = Requests.Response.text response in 6685 + let parsed_body = 6686 + match Jsont_bytesrw.decode_string Jsont.json body with 6687 + | Ok json -> Some (Openapi.Runtime.Json json) 6688 + | Error _ -> Some (Openapi.Runtime.Raw body) 6689 + in 5609 6690 raise (Openapi.Runtime.Api_error { 5610 6691 operation = op_name; 5611 6692 method_ = "GET"; 5612 6693 url; 5613 6694 status = Requests.Response.status_code response; 5614 - body = Requests.Response.text response; 6695 + body; 6696 + parsed_body; 5615 6697 }) 5616 6698 end 5617 6699 5618 6700 module VideoCommentForOwnerOrAdmin = struct 6701 + module Types = struct 6702 + module T = struct 6703 + type t = { 6704 + account : Jsont.json option; 6705 + automatic_tags : string list option; 6706 + created_at : Jsont.json option; 6707 + held_for_review : Jsont.json option; 6708 + id : Id.T.t option; 6709 + in_reply_to_comment_id : Jsont.json option; 6710 + text : Jsont.json option; 6711 + thread_id : Jsont.json option; 6712 + updated_at : Jsont.json option; 6713 + url : Jsont.json option; 6714 + video : Video.Info.t option; 6715 + } 6716 + end 6717 + end 6718 + 5619 6719 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 - } 6720 + include Types.T 5633 6721 5634 6722 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 6723 ··· 5665 6753 end 5666 6754 5667 6755 module PlaylistElement = struct 6756 + module Types = struct 6757 + module T = struct 6758 + type t = { 6759 + position : int option; 6760 + start_timestamp : int option; 6761 + stop_timestamp : int option; 6762 + video : Video.T.t option; 6763 + } 6764 + end 6765 + end 6766 + 5668 6767 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 - } 6768 + include Types.T 5675 6769 5676 6770 let v ?position ?start_timestamp ?stop_timestamp ?video () = { position; start_timestamp; stop_timestamp; video } 5677 6771 ··· 5693 6787 end 5694 6788 5695 6789 module Notification = struct 6790 + module Types = struct 6791 + module Type = struct 6792 + (** Notification type. One of the following values: 6793 + 6794 + - `1` NEW_VIDEO_FROM_SUBSCRIPTION 6795 + 6796 + - `2` NEW_COMMENT_ON_MY_VIDEO 6797 + 6798 + - `3` NEW_ABUSE_FOR_MODERATORS 6799 + 6800 + - `4` BLACKLIST_ON_MY_VIDEO 6801 + 6802 + - `5` UNBLACKLIST_ON_MY_VIDEO 6803 + 6804 + - `6` MY_VIDEO_PUBLISHED 6805 + 6806 + - `7` MY_VIDEO_IMPORT_SUCCESS 6807 + 6808 + - `8` MY_VIDEO_IMPORT_ERROR 6809 + 6810 + - `9` NEW_USER_REGISTRATION 6811 + 6812 + - `10` NEW_FOLLOW 6813 + 6814 + - `11` COMMENT_MENTION 6815 + 6816 + - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS 6817 + 6818 + - `13` NEW_INSTANCE_FOLLOWER 6819 + 6820 + - `14` AUTO_INSTANCE_FOLLOWING 6821 + 6822 + - `15` ABUSE_STATE_CHANGE 6823 + 6824 + - `16` ABUSE_NEW_MESSAGE 6825 + 6826 + - `17` NEW_PLUGIN_VERSION 6827 + 6828 + - `18` NEW_PEERTUBE_VERSION 6829 + 6830 + - `19` MY_VIDEO_STUDIO_EDITION_FINISHED 6831 + 6832 + - `20` NEW_USER_REGISTRATION_REQUEST 6833 + 6834 + - `21` NEW_LIVE_FROM_SUBSCRIPTION 6835 + 6836 + - `22` MY_VIDEO_TRANSCRIPTION_GENERATED 6837 + *) 6838 + type t = string 6839 + end 6840 + 6841 + module T = struct 6842 + type t = { 6843 + account : Actor.Info.t option; 6844 + actor_follow : Jsont.json option; 6845 + comment : Jsont.json option; 6846 + created_at : Ptime.t option; 6847 + id : Id.T.t option; 6848 + read : bool option; 6849 + type_ : Type.t option; 6850 + updated_at : Ptime.t option; 6851 + video : Video.Info.t option; 6852 + video_abuse : Jsont.json option; 6853 + video_blacklist : Jsont.json option; 6854 + video_import : Jsont.json option; 6855 + } 6856 + end 6857 + end 6858 + 5696 6859 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 - 6860 + include Types.Type 5745 6861 let jsont = Jsont.string 5746 6862 end 5747 6863 5748 6864 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 - } 6865 + include Types.T 5763 6866 5764 6867 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 6868 ··· 5803 6906 end 5804 6907 5805 6908 module NotificationList = struct 6909 + module Types = struct 6910 + module Response = struct 6911 + type t = { 6912 + data : Notification.T.t list option; 6913 + total : int option; 6914 + } 6915 + end 6916 + end 6917 + 5806 6918 module Response = struct 5807 - type t = { 5808 - data : Notification.T.t list option; 5809 - total : int option; 5810 - } 6919 + include Types.Response 5811 6920 5812 6921 let v ?data ?total () = { data; total } 5813 6922 ··· 5817 6926 let jsont : t Jsont.t = 5818 6927 Jsont.Object.map ~kind:"NotificationListResponse" 5819 6928 (fun data total -> { data; total }) 5820 - |> Jsont.Object.opt_mem "data" (Jsont.list Notification.T.jsont) ~enc:(fun r -> r.data) 6929 + |> Jsont.Object.opt_mem "data" (Openapi.Runtime.validated_list ~max_items:100 Notification.T.jsont) ~enc:(fun r -> r.data) 5821 6930 |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 5822 6931 |> Jsont.Object.skip_unknown 5823 6932 |> Jsont.Object.finish ··· 5844 6953 if Requests.Response.ok response then 5845 6954 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 5846 6955 else 6956 + let body = Requests.Response.text response in 6957 + let parsed_body = 6958 + match Jsont_bytesrw.decode_string Jsont.json body with 6959 + | Ok json -> Some (Openapi.Runtime.Json json) 6960 + | Error _ -> Some (Openapi.Runtime.Raw body) 6961 + in 5847 6962 raise (Openapi.Runtime.Api_error { 5848 6963 operation = op_name; 5849 6964 method_ = "GET"; 5850 6965 url; 5851 6966 status = Requests.Response.status_code response; 5852 - body = Requests.Response.text response; 6967 + body; 6968 + parsed_body; 5853 6969 }) 5854 6970 end 5855 6971 5856 6972 module AbuseMessage = struct 6973 + module Types = struct 6974 + module T = struct 6975 + type t = { 6976 + account : AccountSummary.T.t option; 6977 + by_moderator : bool option; 6978 + created_at : Ptime.t option; 6979 + id : Id.T.t option; 6980 + message : string option; 6981 + } 6982 + end 6983 + end 6984 + 5857 6985 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 - } 6986 + include Types.T 5865 6987 5866 6988 let v ?account ?by_moderator ?created_at ?id ?message () = { account; by_moderator; created_at; id; message } 5867 6989 ··· 5878 7000 |> Jsont.Object.opt_mem "byModerator" Jsont.bool ~enc:(fun r -> r.by_moderator) 5879 7001 |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 5880 7002 |> 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) 7003 + |> Jsont.Object.opt_mem "message" (Openapi.Runtime.validated_string ~min_length:2 ~max_length:3000 Jsont.string) ~enc:(fun r -> r.message) 5882 7004 |> Jsont.Object.skip_unknown 5883 7005 |> Jsont.Object.finish 5884 7006 end 5885 7007 end 5886 7008 5887 7009 module Account = struct 7010 + module Types = struct 7011 + module T = struct 7012 + type t = { 7013 + avatars : ActorImage.T.t list option; 7014 + created_at : Ptime.t option; 7015 + followers_count : int option; (** number of followers of this actor, as seen by this instance *) 7016 + following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 7017 + host : string option; (** server on which the actor is resident *) 7018 + host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 7019 + id : Id.T.t option; 7020 + name : Username.T.t option; (** immutable name of the actor, used to find or mention it *) 7021 + updated_at : Ptime.t option; 7022 + url : string option; 7023 + user_id : Jsont.json option; (** object id for the user tied to this account *) 7024 + display_name : string option; (** editable name of the account, displayed in its representations *) 7025 + description : string option; (** text or bio displayed on the account's profile *) 7026 + } 7027 + end 7028 + end 7029 + 5888 7030 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 - } 7031 + include Types.T 5904 7032 5905 7033 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 7034 ··· 5923 7051 (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 7052 |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 5925 7053 |> 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) 7054 + |> Jsont.Object.opt_mem "followersCount" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.followers_count) 7055 + |> Jsont.Object.opt_mem "followingCount" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.following_count) 5928 7056 |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 5929 7057 |> Jsont.Object.mem "hostRedundancyAllowed" Openapi.Runtime.nullable_bool 5930 7058 ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.host_redundancy_allowed) ··· 5933 7061 |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 5934 7062 |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 5935 7063 |> 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) 7064 + |> Jsont.Object.opt_mem "displayName" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.display_name) 5937 7065 |> Jsont.Object.mem "description" Openapi.Runtime.nullable_string 5938 7066 ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.description) 5939 7067 |> Jsont.Object.skip_unknown ··· 5957 7085 if Requests.Response.ok response then 5958 7086 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 5959 7087 else 7088 + let body = Requests.Response.text response in 7089 + let parsed_body = 7090 + match Jsont_bytesrw.decode_string Jsont.json body with 7091 + | Ok json -> Some (Openapi.Runtime.Json json) 7092 + | Error _ -> Some (Openapi.Runtime.Raw body) 7093 + in 5960 7094 raise (Openapi.Runtime.Api_error { 5961 7095 operation = op_name; 5962 7096 method_ = "GET"; 5963 7097 url; 5964 7098 status = Requests.Response.status_code response; 5965 - body = Requests.Response.text response; 7099 + body; 7100 + parsed_body; 5966 7101 }) 5967 7102 end 5968 7103 5969 7104 module VideoComment = struct 7105 + module Types = struct 7106 + module T = struct 7107 + type t = { 7108 + account : Account.T.t option; 7109 + created_at : Ptime.t option; 7110 + deleted_at : Ptime.t option; 7111 + held_for_review : bool option; 7112 + id : Id.T.t option; 7113 + in_reply_to_comment_id : Id.T.t option; 7114 + is_deleted : bool; 7115 + text : string option; (** Text of the comment *) 7116 + thread_id : Id.T.t option; 7117 + total_replies : int option; 7118 + total_replies_from_video_author : int option; 7119 + updated_at : Ptime.t option; 7120 + url : string option; 7121 + video_id : Jsont.json option; 7122 + } 7123 + end 7124 + end 7125 + 5970 7126 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 - } 7127 + include Types.T 5987 7128 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 } 7129 + let v ?(deleted_at=None) ?(is_deleted=false) ?account ?created_at ?held_for_review ?id ?in_reply_to_comment_id ?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 7130 5990 7131 let account t = t.account 5991 7132 let created_at t = t.created_at ··· 6012 7153 |> Jsont.Object.opt_mem "heldForReview" Jsont.bool ~enc:(fun r -> r.held_for_review) 6013 7154 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 6014 7155 |> 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) 7156 + |> Jsont.Object.mem "isDeleted" Jsont.bool ~dec_absent:false ~enc:(fun r -> r.is_deleted) 7157 + |> Jsont.Object.opt_mem "text" (Openapi.Runtime.validated_string ~min_length:1 Jsont.string) ~enc:(fun r -> r.text) 6017 7158 |> 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) 7159 + |> Jsont.Object.opt_mem "totalReplies" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.total_replies) 7160 + |> Jsont.Object.opt_mem "totalRepliesFromVideoAuthor" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.total_replies_from_video_author) 6020 7161 |> Jsont.Object.opt_mem "updatedAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.updated_at) 6021 7162 |> Jsont.Object.opt_mem "url" Jsont.string ~enc:(fun r -> r.url) 6022 7163 |> Jsont.Object.opt_mem "videoId" Jsont.json ~enc:(fun r -> r.video_id) ··· 6026 7167 end 6027 7168 6028 7169 module VideoCommentThreadTree = struct 7170 + module Types = struct 7171 + module T = struct 7172 + type t = { 7173 + children : Jsont.json list option; 7174 + comment : VideoComment.T.t option; 7175 + } 7176 + end 7177 + end 7178 + 6029 7179 module T = struct 6030 - type t = { 6031 - children : Jsont.json list option; 6032 - comment : VideoComment.T.t option; 6033 - } 7180 + include Types.T 6034 7181 6035 7182 let v ?children ?comment () = { children; comment } 6036 7183 ··· 6064 7211 if Requests.Response.ok response then 6065 7212 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6066 7213 else 7214 + let body = Requests.Response.text response in 7215 + let parsed_body = 7216 + match Jsont_bytesrw.decode_string Jsont.json body with 7217 + | Ok json -> Some (Openapi.Runtime.Json json) 7218 + | Error _ -> Some (Openapi.Runtime.Raw body) 7219 + in 6067 7220 raise (Openapi.Runtime.Api_error { 6068 7221 operation = op_name; 6069 7222 method_ = "GET"; 6070 7223 url; 6071 7224 status = Requests.Response.status_code response; 6072 - body = Requests.Response.text response; 7225 + body; 7226 + parsed_body; 6073 7227 }) 6074 7228 end 6075 7229 6076 7230 module CommentThreadPost = struct 7231 + module Types = struct 7232 + module Response = struct 7233 + type t = { 7234 + comment : VideoComment.T.t option; 7235 + } 7236 + end 7237 + end 7238 + 6077 7239 module Response = struct 6078 - type t = { 6079 - comment : VideoComment.T.t option; 6080 - } 7240 + include Types.Response 6081 7241 6082 7242 let v ?comment () = { comment } 6083 7243 ··· 6108 7268 if Requests.Response.ok response then 6109 7269 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 6110 7270 else 7271 + let body = Requests.Response.text response in 7272 + let parsed_body = 7273 + match Jsont_bytesrw.decode_string Jsont.json body with 7274 + | Ok json -> Some (Openapi.Runtime.Json json) 7275 + | Error _ -> Some (Openapi.Runtime.Raw body) 7276 + in 6111 7277 raise (Openapi.Runtime.Api_error { 6112 7278 operation = op_name; 6113 7279 method_ = "POST"; 6114 7280 url; 6115 7281 status = Requests.Response.status_code response; 6116 - body = Requests.Response.text response; 7282 + body; 7283 + parsed_body; 6117 7284 }) 6118 7285 6119 7286 (** Reply to a thread of a video ··· 6134 7301 if Requests.Response.ok response then 6135 7302 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 6136 7303 else 7304 + let body = Requests.Response.text response in 7305 + let parsed_body = 7306 + match Jsont_bytesrw.decode_string Jsont.json body with 7307 + | Ok json -> Some (Openapi.Runtime.Json json) 7308 + | Error _ -> Some (Openapi.Runtime.Raw body) 7309 + in 6137 7310 raise (Openapi.Runtime.Api_error { 6138 7311 operation = op_name; 6139 7312 method_ = "POST"; 6140 7313 url; 6141 7314 status = Requests.Response.status_code response; 6142 - body = Requests.Response.text response; 7315 + body; 7316 + parsed_body; 6143 7317 }) 6144 7318 end 6145 7319 6146 7320 module CommentThread = struct 7321 + module Types = struct 7322 + module Response = struct 7323 + type t = { 7324 + data : VideoComment.T.t list option; 7325 + total : int option; (** Total threads (included deleted ones) on this video *) 7326 + total_not_deleted_comments : int option; (** Total not-deleted threads (included deleted ones) on this video *) 7327 + } 7328 + end 7329 + end 7330 + 6147 7331 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 - } 7332 + include Types.Response 6153 7333 6154 7334 let v ?data ?total ?total_not_deleted_comments () = { data; total; total_not_deleted_comments } 6155 7335 ··· 6160 7340 let jsont : t Jsont.t = 6161 7341 Jsont.Object.map ~kind:"CommentThreadResponse" 6162 7342 (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) 7343 + |> Jsont.Object.opt_mem "data" (Openapi.Runtime.validated_list ~max_items:100 VideoComment.T.jsont) ~enc:(fun r -> r.data) 6164 7344 |> Jsont.Object.opt_mem "total" Jsont.int ~enc:(fun r -> r.total) 6165 7345 |> Jsont.Object.opt_mem "totalNotDeletedComments" Jsont.int ~enc:(fun r -> r.total_not_deleted_comments) 6166 7346 |> Jsont.Object.skip_unknown ··· 6187 7367 if Requests.Response.ok response then 6188 7368 Openapi.Runtime.Json.decode_json_exn Response.jsont (Requests.Response.json response) 6189 7369 else 7370 + let body = Requests.Response.text response in 7371 + let parsed_body = 7372 + match Jsont_bytesrw.decode_string Jsont.json body with 7373 + | Ok json -> Some (Openapi.Runtime.Json json) 7374 + | Error _ -> Some (Openapi.Runtime.Raw body) 7375 + in 6190 7376 raise (Openapi.Runtime.Api_error { 6191 7377 operation = op_name; 6192 7378 method_ = "GET"; 6193 7379 url; 6194 7380 status = Requests.Response.status_code response; 6195 - body = Requests.Response.text response; 7381 + body; 7382 + parsed_body; 6196 7383 }) 6197 7384 end 6198 7385 6199 7386 module VideoChannel = struct 7387 + module Types = struct 7388 + module Update = struct 7389 + type t = { 7390 + description : Jsont.json option; (** Channel description *) 7391 + display_name : Jsont.json option; (** Channel display name *) 7392 + support : Jsont.json option; (** How to support/fund the channel *) 7393 + bulk_videos_support_update : bool option; (** Update the support field for all videos of this channel *) 7394 + } 7395 + end 7396 + 7397 + module Create = struct 7398 + type t = { 7399 + description : Jsont.json option; (** Channel description *) 7400 + display_name : Jsont.json; (** Channel display name *) 7401 + support : Jsont.json option; (** How to support/fund the channel *) 7402 + name : UsernameChannel.T.t; (** username of the channel to create *) 7403 + } 7404 + end 7405 + 7406 + module T = struct 7407 + type t = { 7408 + avatars : ActorImage.T.t list option; 7409 + created_at : Ptime.t option; 7410 + followers_count : int option; (** number of followers of this actor, as seen by this instance *) 7411 + following_count : int option; (** number of actors subscribed to by this actor, as seen by this instance *) 7412 + host : string option; (** server on which the actor is resident *) 7413 + host_redundancy_allowed : bool option; (** whether this actor's host allows redundancy of its videos *) 7414 + id : Id.T.t option; 7415 + name : Username.T.t option; (** immutable name of the actor, used to find or mention it *) 7416 + url : string option; 7417 + display_name : string option; (** editable name of the channel, displayed in its representations *) 7418 + description : string option; 7419 + support : string option; (** text shown by default on all videos of this channel, to tell the audience how to support it *) 7420 + is_local : bool option; 7421 + updated_at : Ptime.t option; 7422 + banners : ActorImage.T.t list option; 7423 + owner_account : Account.T.t option; 7424 + } 7425 + end 7426 + end 7427 + 6200 7428 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 - } 7429 + include Types.Update 6207 7430 6208 7431 let v ?description ?display_name ?support ?bulk_videos_support_update () = { description; display_name; support; bulk_videos_support_update } 6209 7432 ··· 6224 7447 end 6225 7448 6226 7449 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 - } 7450 + include Types.Create 6233 7451 6234 7452 let v ~display_name ~name ?description ?support () = { description; display_name; support; name } 6235 7453 ··· 6250 7468 end 6251 7469 6252 7470 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 - } 7471 + include Types.T 6271 7472 6272 7473 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 7474 ··· 6293 7494 (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 7495 |> Jsont.Object.opt_mem "avatars" (Jsont.list ActorImage.T.jsont) ~enc:(fun r -> r.avatars) 6295 7496 |> 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) 7497 + |> Jsont.Object.opt_mem "followersCount" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.followers_count) 7498 + |> Jsont.Object.opt_mem "followingCount" (Openapi.Runtime.validated_int ~minimum:0. Jsont.int) ~enc:(fun r -> r.following_count) 6298 7499 |> Jsont.Object.opt_mem "host" Jsont.string ~enc:(fun r -> r.host) 6299 7500 |> Jsont.Object.mem "hostRedundancyAllowed" Openapi.Runtime.nullable_bool 6300 7501 ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.host_redundancy_allowed) 6301 7502 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 6302 7503 |> Jsont.Object.opt_mem "name" Username.T.jsont ~enc:(fun r -> r.name) 6303 7504 |> 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) 7505 + |> Jsont.Object.opt_mem "displayName" (Openapi.Runtime.validated_string ~min_length:1 ~max_length:120 Jsont.string) ~enc:(fun r -> r.display_name) 6305 7506 |> Jsont.Object.mem "description" Openapi.Runtime.nullable_string 6306 7507 ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.description) 6307 7508 |> Jsont.Object.mem "support" Openapi.Runtime.nullable_string ··· 6331 7532 if Requests.Response.ok response then 6332 7533 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6333 7534 else 7535 + let body = Requests.Response.text response in 7536 + let parsed_body = 7537 + match Jsont_bytesrw.decode_string Jsont.json body with 7538 + | Ok json -> Some (Openapi.Runtime.Json json) 7539 + | Error _ -> Some (Openapi.Runtime.Raw body) 7540 + in 6334 7541 raise (Openapi.Runtime.Api_error { 6335 7542 operation = op_name; 6336 7543 method_ = "GET"; 6337 7544 url; 6338 7545 status = Requests.Response.status_code response; 6339 - body = Requests.Response.text response; 7546 + body; 7547 + parsed_body; 6340 7548 }) 6341 7549 6342 7550 (** Get a video channel ··· 6356 7564 if Requests.Response.ok response then 6357 7565 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6358 7566 else 7567 + let body = Requests.Response.text response in 7568 + let parsed_body = 7569 + match Jsont_bytesrw.decode_string Jsont.json body with 7570 + | Ok json -> Some (Openapi.Runtime.Json json) 7571 + | Error _ -> Some (Openapi.Runtime.Raw body) 7572 + in 6359 7573 raise (Openapi.Runtime.Api_error { 6360 7574 operation = op_name; 6361 7575 method_ = "GET"; 6362 7576 url; 6363 7577 status = Requests.Response.status_code response; 6364 - body = Requests.Response.text response; 7578 + body; 7579 + parsed_body; 6365 7580 }) 6366 7581 end 6367 7582 6368 7583 module VideoDetails = struct 7584 + module Types = struct 7585 + module T = struct 7586 + type t = { 7587 + aspect_ratio : float option; (** **PeerTube >= 6.1** Aspect ratio of the video stream *) 7588 + blacklisted : bool option; 7589 + blacklisted_reason : string option; 7590 + category : VideoConstantNumberCategory.T.t option; (** category in which the video is classified *) 7591 + comments : int option; (** **PeerTube >= 7.2** Number of comments on the video *) 7592 + created_at : Ptime.t option; (** time at which the video object was first drafted *) 7593 + dislikes : int option; 7594 + duration : int option; (** duration of the video in seconds *) 7595 + embed_path : string option; 7596 + id : Id.T.t option; (** object id for the video *) 7597 + is_live : bool option; 7598 + is_local : bool option; 7599 + language : VideoConstantStringLanguage.T.t option; (** main language used in the video *) 7600 + licence : VideoConstantNumberLicence.T.t option; (** licence under which the video is distributed *) 7601 + likes : int option; 7602 + live_schedules : LiveSchedule.T.t list option; 7603 + name : string option; (** title of the video *) 7604 + nsfw : bool option; 7605 + nsfw_flags : Nsfwflag.T.t option; 7606 + nsfw_summary : string option; (** **PeerTube >= 7.2** More information about the sensitive content of the video *) 7607 + originally_published_at : Ptime.t option; (** used to represent a date of first publication, prior to the practical publication date of `publishedAt` *) 7608 + preview_path : string option; 7609 + privacy : VideoPrivacyConstant.T.t option; (** privacy policy used to distribute the video *) 7610 + 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. *) 7611 + scheduled_update : VideoScheduled.Update.t option; 7612 + short_uuid : ShortUuid.T.t option; 7613 + state : VideoStateConstant.T.t option; (** represents the internal state of the video processing within the PeerTube instance *) 7614 + thumbnail_path : string option; 7615 + truncated_description : string option; (** truncated description of the video, written in Markdown. 7616 + *) 7617 + updated_at : Ptime.t option; (** last time the video's metadata was modified *) 7618 + user_history : Jsont.json option; 7619 + uuid : Uuidv4.T.t option; (** universal identifier for the video, that can be used across instances *) 7620 + views : int option; 7621 + wait_transcoding : bool option; 7622 + viewers : int option; (** If the video is a live, you have the amount of current viewers *) 7623 + description : string option; (** full description of the video, written in Markdown. 7624 + *) 7625 + support : string option; (** A text tell the audience how to support the video creator *) 7626 + channel : VideoChannel.T.t option; 7627 + account : Account.T.t option; 7628 + tags : string list option; 7629 + comments_policy : VideoCommentsPolicyConstant.T.t option; 7630 + download_enabled : bool option; 7631 + input_file_updated_at : Ptime.t option; (** Latest input file update. Null if the file has never been replaced since the original upload *) 7632 + tracker_urls : string list option; 7633 + files : VideoFile.T.t list option; (** Web compatible video files. If Web Video is disabled on the server: 7634 + 7635 + - field will be empty 7636 + - video files will be found in `streamingPlaylists[].files` field 7637 + *) 7638 + streaming_playlists : VideoStreamingPlaylists.T.t list option; (** HLS playlists/manifest files. If HLS is disabled on the server: 7639 + 7640 + - field will be empty 7641 + - video files will be found in `files` field 7642 + *) 7643 + } 7644 + end 7645 + end 7646 + 6369 7647 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 - } 7648 + include Types.T 6428 7649 6429 7650 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 7651 ··· 6497 7718 |> Jsont.Object.opt_mem "licence" VideoConstantNumberLicence.T.jsont ~enc:(fun r -> r.licence) 6498 7719 |> Jsont.Object.opt_mem "likes" Jsont.int ~enc:(fun r -> r.likes) 6499 7720 |> 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) 7721 + |> Jsont.Object.opt_mem "name" (Openapi.Runtime.validated_string ~min_length:3 ~max_length:120 Jsont.string) ~enc:(fun r -> r.name) 6501 7722 |> Jsont.Object.opt_mem "nsfw" Jsont.bool ~enc:(fun r -> r.nsfw) 6502 7723 |> Jsont.Object.opt_mem "nsfwFlags" Nsfwflag.T.jsont ~enc:(fun r -> r.nsfw_flags) 6503 7724 |> Jsont.Object.opt_mem "nsfwSummary" Jsont.string ~enc:(fun r -> r.nsfw_summary) ··· 6526 7747 ~dec_absent:None ~enc_omit:Option.is_none ~enc:(fun r -> r.support) 6527 7748 |> Jsont.Object.opt_mem "channel" VideoChannel.T.jsont ~enc:(fun r -> r.channel) 6528 7749 |> 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) 7750 + |> Jsont.Object.opt_mem "tags" (Openapi.Runtime.validated_list ~min_items:1 ~max_items:5 Jsont.string) ~enc:(fun r -> r.tags) 6530 7751 |> Jsont.Object.opt_mem "commentsPolicy" VideoCommentsPolicyConstant.T.jsont ~enc:(fun r -> r.comments_policy) 6531 7752 |> Jsont.Object.opt_mem "downloadEnabled" Jsont.bool ~enc:(fun r -> r.download_enabled) 6532 7753 |> Jsont.Object.mem "inputFileUpdatedAt" Openapi.Runtime.nullable_ptime ··· 6555 7776 if Requests.Response.ok response then 6556 7777 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6557 7778 else 7779 + let body = Requests.Response.text response in 7780 + let status = Requests.Response.status_code response in 7781 + let parsed_body = match status with 7782 + | 401 -> 7783 + (match Openapi.Runtime.Json.decode_json ServerError.T.jsont (Requests.Response.json response) with 7784 + | Ok v -> Some (Openapi.Runtime.Typed ("ServerError", Openapi.Runtime.Json.encode_json ServerError.T.jsont v)) 7785 + | Error _ -> None) 7786 + | 403 -> 7787 + (match Openapi.Runtime.Json.decode_json ServerError.T.jsont (Requests.Response.json response) with 7788 + | Ok v -> Some (Openapi.Runtime.Typed ("ServerError", Openapi.Runtime.Json.encode_json ServerError.T.jsont v)) 7789 + | Error _ -> None) 7790 + | _ -> 7791 + (match Jsont_bytesrw.decode_string Jsont.json body with 7792 + | Ok json -> Some (Openapi.Runtime.Json json) 7793 + | Error _ -> Some (Openapi.Runtime.Raw body)) 7794 + in 6558 7795 raise (Openapi.Runtime.Api_error { 6559 7796 operation = op_name; 6560 7797 method_ = "GET"; 6561 7798 url; 6562 - status = Requests.Response.status_code response; 6563 - body = Requests.Response.text response; 7799 + status; 7800 + body; 7801 + parsed_body; 6564 7802 }) 6565 7803 end 6566 7804 6567 7805 module VideoChannelSync = struct 7806 + module Types = struct 7807 + module Create = struct 7808 + type t = { 7809 + external_channel_url : string option; 7810 + video_channel_id : Id.T.t option; 7811 + } 7812 + end 7813 + 7814 + module T = struct 7815 + type t = { 7816 + channel : VideoChannel.T.t option; 7817 + created_at : Ptime.t option; 7818 + external_channel_url : string option; 7819 + id : Id.T.t option; 7820 + last_sync_at : Ptime.t option; 7821 + state : Jsont.json option; 7822 + } 7823 + end 7824 + end 7825 + 6568 7826 module Create = struct 6569 - type t = { 6570 - external_channel_url : string option; 6571 - video_channel_id : Id.T.t option; 6572 - } 7827 + include Types.Create 6573 7828 6574 7829 let v ?external_channel_url ?video_channel_id () = { external_channel_url; video_channel_id } 6575 7830 ··· 6586 7841 end 6587 7842 6588 7843 module T = struct 6589 - type t = { 6590 - channel : VideoChannel.T.t option; 6591 - created_at : Ptime.t option; 6592 - external_channel_url : string option; 6593 - id : Id.T.t option; 6594 - last_sync_at : Ptime.t option; 6595 - state : Jsont.json option; 6596 - } 7844 + include Types.T 6597 7845 6598 7846 let v ?channel ?created_at ?external_channel_url ?id ?last_sync_at ?state () = { channel; created_at; external_channel_url; id; last_sync_at; state } 6599 7847 ··· 6620 7868 end 6621 7869 6622 7870 module VideoChannelSyncList = struct 7871 + module Types = struct 7872 + module T = struct 7873 + type t = { 7874 + data : VideoChannelSync.T.t list option; 7875 + total : int option; 7876 + } 7877 + end 7878 + end 7879 + 6623 7880 module T = struct 6624 - type t = { 6625 - data : VideoChannelSync.T.t list option; 6626 - total : int option; 6627 - } 7881 + include Types.T 6628 7882 6629 7883 let v ?data ?total () = { data; total } 6630 7884 ··· 6661 7915 if Requests.Response.ok response then 6662 7916 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 6663 7917 else 7918 + let body = Requests.Response.text response in 7919 + let parsed_body = 7920 + match Jsont_bytesrw.decode_string Jsont.json body with 7921 + | Ok json -> Some (Openapi.Runtime.Json json) 7922 + | Error _ -> Some (Openapi.Runtime.Raw body) 7923 + in 6664 7924 raise (Openapi.Runtime.Api_error { 6665 7925 operation = op_name; 6666 7926 method_ = "GET"; 6667 7927 url; 6668 7928 status = Requests.Response.status_code response; 6669 - body = Requests.Response.text response; 7929 + body; 7930 + parsed_body; 6670 7931 }) 6671 7932 end 6672 7933 ··· 6699 7960 if Requests.Response.ok response then 6700 7961 Requests.Response.json response 6701 7962 else 7963 + let body = Requests.Response.text response in 7964 + let parsed_body = 7965 + match Jsont_bytesrw.decode_string Jsont.json body with 7966 + | Ok json -> Some (Openapi.Runtime.Json json) 7967 + | Error _ -> Some (Openapi.Runtime.Raw body) 7968 + in 6702 7969 raise (Openapi.Runtime.Api_error { 6703 7970 operation = op_name; 6704 7971 method_ = "GET"; 6705 7972 url; 6706 7973 status = Requests.Response.status_code response; 6707 - body = Requests.Response.text response; 7974 + body; 7975 + parsed_body; 6708 7976 }) 6709 7977 6710 7978 (** Report an abuse *) ··· 6722 7990 if Requests.Response.ok response then 6723 7991 Requests.Response.json response 6724 7992 else 7993 + let body = Requests.Response.text response in 7994 + let parsed_body = 7995 + match Jsont_bytesrw.decode_string Jsont.json body with 7996 + | Ok json -> Some (Openapi.Runtime.Json json) 7997 + | Error _ -> Some (Openapi.Runtime.Raw body) 7998 + in 6725 7999 raise (Openapi.Runtime.Api_error { 6726 8000 operation = op_name; 6727 8001 method_ = "POST"; 6728 8002 url; 6729 8003 status = Requests.Response.status_code response; 6730 - body = Requests.Response.text response; 8004 + body; 8005 + parsed_body; 6731 8006 }) 6732 8007 6733 8008 (** Update an abuse ··· 6747 8022 if Requests.Response.ok response then 6748 8023 Requests.Response.json response 6749 8024 else 8025 + let body = Requests.Response.text response in 8026 + let parsed_body = 8027 + match Jsont_bytesrw.decode_string Jsont.json body with 8028 + | Ok json -> Some (Openapi.Runtime.Json json) 8029 + | Error _ -> Some (Openapi.Runtime.Raw body) 8030 + in 6750 8031 raise (Openapi.Runtime.Api_error { 6751 8032 operation = op_name; 6752 8033 method_ = "PUT"; 6753 8034 url; 6754 8035 status = Requests.Response.status_code response; 6755 - body = Requests.Response.text response; 8036 + body; 8037 + parsed_body; 6756 8038 }) 6757 8039 6758 8040 (** Delete an abuse ··· 6772 8054 if Requests.Response.ok response then 6773 8055 Requests.Response.json response 6774 8056 else 8057 + let body = Requests.Response.text response in 8058 + let parsed_body = 8059 + match Jsont_bytesrw.decode_string Jsont.json body with 8060 + | Ok json -> Some (Openapi.Runtime.Json json) 8061 + | Error _ -> Some (Openapi.Runtime.Raw body) 8062 + in 6775 8063 raise (Openapi.Runtime.Api_error { 6776 8064 operation = op_name; 6777 8065 method_ = "DELETE"; 6778 8066 url; 6779 8067 status = Requests.Response.status_code response; 6780 - body = Requests.Response.text response; 8068 + body; 8069 + parsed_body; 6781 8070 }) 6782 8071 6783 8072 (** List messages of an abuse ··· 6797 8086 if Requests.Response.ok response then 6798 8087 Requests.Response.json response 6799 8088 else 8089 + let body = Requests.Response.text response in 8090 + let parsed_body = 8091 + match Jsont_bytesrw.decode_string Jsont.json body with 8092 + | Ok json -> Some (Openapi.Runtime.Json json) 8093 + | Error _ -> Some (Openapi.Runtime.Raw body) 8094 + in 6800 8095 raise (Openapi.Runtime.Api_error { 6801 8096 operation = op_name; 6802 8097 method_ = "GET"; 6803 8098 url; 6804 8099 status = Requests.Response.status_code response; 6805 - body = Requests.Response.text response; 8100 + body; 8101 + parsed_body; 6806 8102 }) 6807 8103 6808 8104 (** Add message to an abuse ··· 6822 8118 if Requests.Response.ok response then 6823 8119 Requests.Response.json response 6824 8120 else 8121 + let body = Requests.Response.text response in 8122 + let parsed_body = 8123 + match Jsont_bytesrw.decode_string Jsont.json body with 8124 + | Ok json -> Some (Openapi.Runtime.Json json) 8125 + | Error _ -> Some (Openapi.Runtime.Raw body) 8126 + in 6825 8127 raise (Openapi.Runtime.Api_error { 6826 8128 operation = op_name; 6827 8129 method_ = "POST"; 6828 8130 url; 6829 8131 status = Requests.Response.status_code response; 6830 - body = Requests.Response.text response; 8132 + body; 8133 + parsed_body; 6831 8134 }) 6832 8135 6833 8136 (** Delete an abuse message ··· 6848 8151 if Requests.Response.ok response then 6849 8152 Requests.Response.json response 6850 8153 else 8154 + let body = Requests.Response.text response in 8155 + let parsed_body = 8156 + match Jsont_bytesrw.decode_string Jsont.json body with 8157 + | Ok json -> Some (Openapi.Runtime.Json json) 8158 + | Error _ -> Some (Openapi.Runtime.Raw body) 8159 + in 6851 8160 raise (Openapi.Runtime.Api_error { 6852 8161 operation = op_name; 6853 8162 method_ = "DELETE"; 6854 8163 url; 6855 8164 status = Requests.Response.status_code response; 6856 - body = Requests.Response.text response; 8165 + body; 8166 + parsed_body; 6857 8167 }) 6858 8168 6859 8169 (** List accounts ··· 6875 8185 if Requests.Response.ok response then 6876 8186 Requests.Response.json response 6877 8187 else 8188 + let body = Requests.Response.text response in 8189 + let parsed_body = 8190 + match Jsont_bytesrw.decode_string Jsont.json body with 8191 + | Ok json -> Some (Openapi.Runtime.Json json) 8192 + | Error _ -> Some (Openapi.Runtime.Raw body) 8193 + in 6878 8194 raise (Openapi.Runtime.Api_error { 6879 8195 operation = op_name; 6880 8196 method_ = "GET"; 6881 8197 url; 6882 8198 status = Requests.Response.status_code response; 6883 - body = Requests.Response.text response; 8199 + body; 8200 + parsed_body; 6884 8201 }) 6885 8202 6886 8203 (** List followers of an account ··· 6904 8221 if Requests.Response.ok response then 6905 8222 Requests.Response.json response 6906 8223 else 8224 + let body = Requests.Response.text response in 8225 + let parsed_body = 8226 + match Jsont_bytesrw.decode_string Jsont.json body with 8227 + | Ok json -> Some (Openapi.Runtime.Json json) 8228 + | Error _ -> Some (Openapi.Runtime.Raw body) 8229 + in 6907 8230 raise (Openapi.Runtime.Api_error { 6908 8231 operation = op_name; 6909 8232 method_ = "GET"; 6910 8233 url; 6911 8234 status = Requests.Response.status_code response; 6912 - body = Requests.Response.text response; 8235 + body; 8236 + parsed_body; 6913 8237 }) 6914 8238 6915 8239 (** List playlists of an account ··· 6935 8259 if Requests.Response.ok response then 6936 8260 Requests.Response.json response 6937 8261 else 8262 + let body = Requests.Response.text response in 8263 + let parsed_body = 8264 + match Jsont_bytesrw.decode_string Jsont.json body with 8265 + | Ok json -> Some (Openapi.Runtime.Json json) 8266 + | Error _ -> Some (Openapi.Runtime.Raw body) 8267 + in 6938 8268 raise (Openapi.Runtime.Api_error { 6939 8269 operation = op_name; 6940 8270 method_ = "GET"; 6941 8271 url; 6942 8272 status = Requests.Response.status_code response; 6943 - body = Requests.Response.text response; 8273 + body; 8274 + parsed_body; 6944 8275 }) 6945 8276 6946 8277 (** Update account auto tag policies on comments ··· 6962 8293 if Requests.Response.ok response then 6963 8294 Requests.Response.json response 6964 8295 else 8296 + let body = Requests.Response.text response in 8297 + let parsed_body = 8298 + match Jsont_bytesrw.decode_string Jsont.json body with 8299 + | Ok json -> Some (Openapi.Runtime.Json json) 8300 + | Error _ -> Some (Openapi.Runtime.Raw body) 8301 + in 6965 8302 raise (Openapi.Runtime.Api_error { 6966 8303 operation = op_name; 6967 8304 method_ = "PUT"; 6968 8305 url; 6969 8306 status = Requests.Response.status_code response; 6970 - body = Requests.Response.text response; 8307 + body; 8308 + parsed_body; 6971 8309 }) 6972 8310 6973 8311 (** Update client language ··· 6987 8325 if Requests.Response.ok response then 6988 8326 Requests.Response.json response 6989 8327 else 8328 + let body = Requests.Response.text response in 8329 + let parsed_body = 8330 + match Jsont_bytesrw.decode_string Jsont.json body with 8331 + | Ok json -> Some (Openapi.Runtime.Json json) 8332 + | Error _ -> Some (Openapi.Runtime.Raw body) 8333 + in 6990 8334 raise (Openapi.Runtime.Api_error { 6991 8335 operation = op_name; 6992 8336 method_ = "POST"; 6993 8337 url; 6994 8338 status = Requests.Response.status_code response; 6995 - body = Requests.Response.text response; 8339 + body; 8340 + parsed_body; 6996 8341 }) 6997 8342 6998 8343 (** Set instance runtime configuration *) ··· 7010 8355 if Requests.Response.ok response then 7011 8356 Requests.Response.json response 7012 8357 else 8358 + let body = Requests.Response.text response in 8359 + let parsed_body = 8360 + match Jsont_bytesrw.decode_string Jsont.json body with 8361 + | Ok json -> Some (Openapi.Runtime.Json json) 8362 + | Error _ -> Some (Openapi.Runtime.Raw body) 8363 + in 7013 8364 raise (Openapi.Runtime.Api_error { 7014 8365 operation = op_name; 7015 8366 method_ = "PUT"; 7016 8367 url; 7017 8368 status = Requests.Response.status_code response; 7018 - body = Requests.Response.text response; 8369 + body; 8370 + parsed_body; 7019 8371 }) 7020 8372 7021 8373 (** Delete instance runtime configuration *) ··· 7033 8385 if Requests.Response.ok response then 7034 8386 Requests.Response.json response 7035 8387 else 8388 + let body = Requests.Response.text response in 8389 + let parsed_body = 8390 + match Jsont_bytesrw.decode_string Jsont.json body with 8391 + | Ok json -> Some (Openapi.Runtime.Json json) 8392 + | Error _ -> Some (Openapi.Runtime.Raw body) 8393 + in 7036 8394 raise (Openapi.Runtime.Api_error { 7037 8395 operation = op_name; 7038 8396 method_ = "DELETE"; 7039 8397 url; 7040 8398 status = Requests.Response.status_code response; 7041 - body = Requests.Response.text response; 8399 + body; 8400 + parsed_body; 7042 8401 }) 7043 8402 7044 8403 (** Delete instance avatar *) ··· 7056 8415 if Requests.Response.ok response then 7057 8416 Requests.Response.json response 7058 8417 else 8418 + let body = Requests.Response.text response in 8419 + let parsed_body = 8420 + match Jsont_bytesrw.decode_string Jsont.json body with 8421 + | Ok json -> Some (Openapi.Runtime.Json json) 8422 + | Error _ -> Some (Openapi.Runtime.Raw body) 8423 + in 7059 8424 raise (Openapi.Runtime.Api_error { 7060 8425 operation = op_name; 7061 8426 method_ = "DELETE"; 7062 8427 url; 7063 8428 status = Requests.Response.status_code response; 7064 - body = Requests.Response.text response; 8429 + body; 8430 + parsed_body; 7065 8431 }) 7066 8432 7067 8433 (** Update instance avatar *) ··· 7079 8445 if Requests.Response.ok response then 7080 8446 Requests.Response.json response 7081 8447 else 8448 + let body = Requests.Response.text response in 8449 + let parsed_body = 8450 + match Jsont_bytesrw.decode_string Jsont.json body with 8451 + | Ok json -> Some (Openapi.Runtime.Json json) 8452 + | Error _ -> Some (Openapi.Runtime.Raw body) 8453 + in 7082 8454 raise (Openapi.Runtime.Api_error { 7083 8455 operation = op_name; 7084 8456 method_ = "POST"; 7085 8457 url; 7086 8458 status = Requests.Response.status_code response; 7087 - body = Requests.Response.text response; 8459 + body; 8460 + parsed_body; 7088 8461 }) 7089 8462 7090 8463 (** Delete instance banner *) ··· 7102 8475 if Requests.Response.ok response then 7103 8476 Requests.Response.json response 7104 8477 else 8478 + let body = Requests.Response.text response in 8479 + let parsed_body = 8480 + match Jsont_bytesrw.decode_string Jsont.json body with 8481 + | Ok json -> Some (Openapi.Runtime.Json json) 8482 + | Error _ -> Some (Openapi.Runtime.Raw body) 8483 + in 7105 8484 raise (Openapi.Runtime.Api_error { 7106 8485 operation = op_name; 7107 8486 method_ = "DELETE"; 7108 8487 url; 7109 8488 status = Requests.Response.status_code response; 7110 - body = Requests.Response.text response; 8489 + body; 8490 + parsed_body; 7111 8491 }) 7112 8492 7113 8493 (** Update instance banner *) ··· 7125 8505 if Requests.Response.ok response then 7126 8506 Requests.Response.json response 7127 8507 else 8508 + let body = Requests.Response.text response in 8509 + let parsed_body = 8510 + match Jsont_bytesrw.decode_string Jsont.json body with 8511 + | Ok json -> Some (Openapi.Runtime.Json json) 8512 + | Error _ -> Some (Openapi.Runtime.Raw body) 8513 + in 7128 8514 raise (Openapi.Runtime.Api_error { 7129 8515 operation = op_name; 7130 8516 method_ = "POST"; 7131 8517 url; 7132 8518 status = Requests.Response.status_code response; 7133 - body = Requests.Response.text response; 8519 + body; 8520 + parsed_body; 7134 8521 }) 7135 8522 7136 8523 (** Delete instance logo *) ··· 7148 8535 if Requests.Response.ok response then 7149 8536 Requests.Response.json response 7150 8537 else 8538 + let body = Requests.Response.text response in 8539 + let parsed_body = 8540 + match Jsont_bytesrw.decode_string Jsont.json body with 8541 + | Ok json -> Some (Openapi.Runtime.Json json) 8542 + | Error _ -> Some (Openapi.Runtime.Raw body) 8543 + in 7151 8544 raise (Openapi.Runtime.Api_error { 7152 8545 operation = op_name; 7153 8546 method_ = "DELETE"; 7154 8547 url; 7155 8548 status = Requests.Response.status_code response; 7156 - body = Requests.Response.text response; 8549 + body; 8550 + parsed_body; 7157 8551 }) 7158 8552 7159 8553 (** Update instance logo *) ··· 7171 8565 if Requests.Response.ok response then 7172 8566 Requests.Response.json response 7173 8567 else 8568 + let body = Requests.Response.text response in 8569 + let parsed_body = 8570 + match Jsont_bytesrw.decode_string Jsont.json body with 8571 + | Ok json -> Some (Openapi.Runtime.Json json) 8572 + | Error _ -> Some (Openapi.Runtime.Raw body) 8573 + in 7174 8574 raise (Openapi.Runtime.Api_error { 7175 8575 operation = op_name; 7176 8576 method_ = "POST"; 7177 8577 url; 7178 8578 status = Requests.Response.status_code response; 7179 - body = Requests.Response.text response; 8579 + body; 8580 + parsed_body; 7180 8581 }) 7181 8582 7182 8583 (** Set instance custom homepage *) ··· 7194 8595 if Requests.Response.ok response then 7195 8596 Requests.Response.json response 7196 8597 else 8598 + let body = Requests.Response.text response in 8599 + let parsed_body = 8600 + match Jsont_bytesrw.decode_string Jsont.json body with 8601 + | Ok json -> Some (Openapi.Runtime.Json json) 8602 + | Error _ -> Some (Openapi.Runtime.Raw body) 8603 + in 7197 8604 raise (Openapi.Runtime.Api_error { 7198 8605 operation = op_name; 7199 8606 method_ = "PUT"; 7200 8607 url; 7201 8608 status = Requests.Response.status_code response; 7202 - body = Requests.Response.text response; 8609 + body; 8610 + parsed_body; 7203 8611 }) 7204 8612 7205 8613 (** Pause job queue *) ··· 7217 8625 if Requests.Response.ok response then 7218 8626 Requests.Response.json response 7219 8627 else 8628 + let body = Requests.Response.text response in 8629 + let parsed_body = 8630 + match Jsont_bytesrw.decode_string Jsont.json body with 8631 + | Ok json -> Some (Openapi.Runtime.Json json) 8632 + | Error _ -> Some (Openapi.Runtime.Raw body) 8633 + in 7220 8634 raise (Openapi.Runtime.Api_error { 7221 8635 operation = op_name; 7222 8636 method_ = "POST"; 7223 8637 url; 7224 8638 status = Requests.Response.status_code response; 7225 - body = Requests.Response.text response; 8639 + body; 8640 + parsed_body; 7226 8641 }) 7227 8642 7228 8643 (** Resume job queue *) ··· 7240 8655 if Requests.Response.ok response then 7241 8656 Requests.Response.json response 7242 8657 else 8658 + let body = Requests.Response.text response in 8659 + let parsed_body = 8660 + match Jsont_bytesrw.decode_string Jsont.json body with 8661 + | Ok json -> Some (Openapi.Runtime.Json json) 8662 + | Error _ -> Some (Openapi.Runtime.Raw body) 8663 + in 7243 8664 raise (Openapi.Runtime.Api_error { 7244 8665 operation = op_name; 7245 8666 method_ = "POST"; 7246 8667 url; 7247 8668 status = Requests.Response.status_code response; 7248 - body = Requests.Response.text response; 8669 + body; 8670 + parsed_body; 7249 8671 }) 7250 8672 7251 8673 (** List instance jobs ··· 7269 8691 if Requests.Response.ok response then 7270 8692 Requests.Response.json response 7271 8693 else 8694 + let body = Requests.Response.text response in 8695 + let parsed_body = 8696 + match Jsont_bytesrw.decode_string Jsont.json body with 8697 + | Ok json -> Some (Openapi.Runtime.Json json) 8698 + | Error _ -> Some (Openapi.Runtime.Raw body) 8699 + in 7272 8700 raise (Openapi.Runtime.Api_error { 7273 8701 operation = op_name; 7274 8702 method_ = "GET"; 7275 8703 url; 7276 8704 status = Requests.Response.status_code response; 7277 - body = Requests.Response.text response; 8705 + body; 8706 + parsed_body; 7278 8707 }) 7279 8708 7280 8709 (** Create playback metrics ··· 7294 8723 if Requests.Response.ok response then 7295 8724 Requests.Response.json response 7296 8725 else 8726 + let body = Requests.Response.text response in 8727 + let parsed_body = 8728 + match Jsont_bytesrw.decode_string Jsont.json body with 8729 + | Ok json -> Some (Openapi.Runtime.Json json) 8730 + | Error _ -> Some (Openapi.Runtime.Raw body) 8731 + in 7297 8732 raise (Openapi.Runtime.Api_error { 7298 8733 operation = op_name; 7299 8734 method_ = "POST"; 7300 8735 url; 7301 8736 status = Requests.Response.status_code response; 7302 - body = Requests.Response.text response; 8737 + body; 8738 + parsed_body; 7303 8739 }) 7304 8740 7305 8741 (** Install a plugin *) ··· 7317 8753 if Requests.Response.ok response then 7318 8754 Requests.Response.json response 7319 8755 else 8756 + let body = Requests.Response.text response in 8757 + let parsed_body = 8758 + match Jsont_bytesrw.decode_string Jsont.json body with 8759 + | Ok json -> Some (Openapi.Runtime.Json json) 8760 + | Error _ -> Some (Openapi.Runtime.Raw body) 8761 + in 7320 8762 raise (Openapi.Runtime.Api_error { 7321 8763 operation = op_name; 7322 8764 method_ = "POST"; 7323 8765 url; 7324 8766 status = Requests.Response.status_code response; 7325 - body = Requests.Response.text response; 8767 + body; 8768 + parsed_body; 7326 8769 }) 7327 8770 7328 8771 (** Uninstall a plugin *) ··· 7340 8783 if Requests.Response.ok response then 7341 8784 Requests.Response.json response 7342 8785 else 8786 + let body = Requests.Response.text response in 8787 + let parsed_body = 8788 + match Jsont_bytesrw.decode_string Jsont.json body with 8789 + | Ok json -> Some (Openapi.Runtime.Json json) 8790 + | Error _ -> Some (Openapi.Runtime.Raw body) 8791 + in 7343 8792 raise (Openapi.Runtime.Api_error { 7344 8793 operation = op_name; 7345 8794 method_ = "POST"; 7346 8795 url; 7347 8796 status = Requests.Response.status_code response; 7348 - body = Requests.Response.text response; 8797 + body; 8798 + parsed_body; 7349 8799 }) 7350 8800 7351 8801 (** Update a plugin *) ··· 7363 8813 if Requests.Response.ok response then 7364 8814 Requests.Response.json response 7365 8815 else 8816 + let body = Requests.Response.text response in 8817 + let parsed_body = 8818 + match Jsont_bytesrw.decode_string Jsont.json body with 8819 + | Ok json -> Some (Openapi.Runtime.Json json) 8820 + | Error _ -> Some (Openapi.Runtime.Raw body) 8821 + in 7366 8822 raise (Openapi.Runtime.Api_error { 7367 8823 operation = op_name; 7368 8824 method_ = "POST"; 7369 8825 url; 7370 8826 status = Requests.Response.status_code response; 7371 - body = Requests.Response.text response; 8827 + body; 8828 + parsed_body; 7372 8829 }) 7373 8830 7374 8831 (** Get a plugin's public settings ··· 7388 8845 if Requests.Response.ok response then 7389 8846 Requests.Response.json response 7390 8847 else 8848 + let body = Requests.Response.text response in 8849 + let parsed_body = 8850 + match Jsont_bytesrw.decode_string Jsont.json body with 8851 + | Ok json -> Some (Openapi.Runtime.Json json) 8852 + | Error _ -> Some (Openapi.Runtime.Raw body) 8853 + in 7391 8854 raise (Openapi.Runtime.Api_error { 7392 8855 operation = op_name; 7393 8856 method_ = "GET"; 7394 8857 url; 7395 8858 status = Requests.Response.status_code response; 7396 - body = Requests.Response.text response; 8859 + body; 8860 + parsed_body; 7397 8861 }) 7398 8862 7399 8863 (** Get a plugin's registered settings ··· 7413 8877 if Requests.Response.ok response then 7414 8878 Requests.Response.json response 7415 8879 else 8880 + let body = Requests.Response.text response in 8881 + let parsed_body = 8882 + match Jsont_bytesrw.decode_string Jsont.json body with 8883 + | Ok json -> Some (Openapi.Runtime.Json json) 8884 + | Error _ -> Some (Openapi.Runtime.Raw body) 8885 + in 7416 8886 raise (Openapi.Runtime.Api_error { 7417 8887 operation = op_name; 7418 8888 method_ = "GET"; 7419 8889 url; 7420 8890 status = Requests.Response.status_code response; 7421 - body = Requests.Response.text response; 8891 + body; 8892 + parsed_body; 7422 8893 }) 7423 8894 7424 8895 (** Set a plugin's settings ··· 7438 8909 if Requests.Response.ok response then 7439 8910 Requests.Response.json response 7440 8911 else 8912 + let body = Requests.Response.text response in 8913 + let parsed_body = 8914 + match Jsont_bytesrw.decode_string Jsont.json body with 8915 + | Ok json -> Some (Openapi.Runtime.Json json) 8916 + | Error _ -> Some (Openapi.Runtime.Raw body) 8917 + in 7441 8918 raise (Openapi.Runtime.Api_error { 7442 8919 operation = op_name; 7443 8920 method_ = "PUT"; 7444 8921 url; 7445 8922 status = Requests.Response.status_code response; 7446 - body = Requests.Response.text response; 8923 + body; 8924 + parsed_body; 7447 8925 }) 7448 8926 7449 8927 (** List runners ··· 7465 8943 if Requests.Response.ok response then 7466 8944 Requests.Response.json response 7467 8945 else 8946 + let body = Requests.Response.text response in 8947 + let parsed_body = 8948 + match Jsont_bytesrw.decode_string Jsont.json body with 8949 + | Ok json -> Some (Openapi.Runtime.Json json) 8950 + | Error _ -> Some (Openapi.Runtime.Raw body) 8951 + in 7468 8952 raise (Openapi.Runtime.Api_error { 7469 8953 operation = op_name; 7470 8954 method_ = "GET"; 7471 8955 url; 7472 8956 status = Requests.Response.status_code response; 7473 - body = Requests.Response.text response; 8957 + body; 8958 + parsed_body; 7474 8959 }) 7475 8960 7476 8961 (** List jobs ··· 7493 8978 if Requests.Response.ok response then 7494 8979 Requests.Response.json response 7495 8980 else 8981 + let body = Requests.Response.text response in 8982 + let parsed_body = 8983 + match Jsont_bytesrw.decode_string Jsont.json body with 8984 + | Ok json -> Some (Openapi.Runtime.Json json) 8985 + | Error _ -> Some (Openapi.Runtime.Raw body) 8986 + in 7496 8987 raise (Openapi.Runtime.Api_error { 7497 8988 operation = op_name; 7498 8989 method_ = "GET"; 7499 8990 url; 7500 8991 status = Requests.Response.status_code response; 7501 - body = Requests.Response.text response; 8992 + body; 8993 + parsed_body; 7502 8994 }) 7503 8995 7504 8996 (** Request a new job ··· 7518 9010 if Requests.Response.ok response then 7519 9011 Requests.Response.json response 7520 9012 else 9013 + let body = Requests.Response.text response in 9014 + let parsed_body = 9015 + match Jsont_bytesrw.decode_string Jsont.json body with 9016 + | Ok json -> Some (Openapi.Runtime.Json json) 9017 + | Error _ -> Some (Openapi.Runtime.Raw body) 9018 + in 7521 9019 raise (Openapi.Runtime.Api_error { 7522 9020 operation = op_name; 7523 9021 method_ = "POST"; 7524 9022 url; 7525 9023 status = Requests.Response.status_code response; 7526 - body = Requests.Response.text response; 9024 + body; 9025 + parsed_body; 7527 9026 }) 7528 9027 7529 9028 (** Delete a job ··· 7543 9042 if Requests.Response.ok response then 7544 9043 Requests.Response.json response 7545 9044 else 9045 + let body = Requests.Response.text response in 9046 + let parsed_body = 9047 + match Jsont_bytesrw.decode_string Jsont.json body with 9048 + | Ok json -> Some (Openapi.Runtime.Json json) 9049 + | Error _ -> Some (Openapi.Runtime.Raw body) 9050 + in 7546 9051 raise (Openapi.Runtime.Api_error { 7547 9052 operation = op_name; 7548 9053 method_ = "DELETE"; 7549 9054 url; 7550 9055 status = Requests.Response.status_code response; 7551 - body = Requests.Response.text response; 9056 + body; 9057 + parsed_body; 7552 9058 }) 7553 9059 7554 9060 (** Abort job ··· 7568 9074 if Requests.Response.ok response then 7569 9075 Requests.Response.json response 7570 9076 else 9077 + let body = Requests.Response.text response in 9078 + let parsed_body = 9079 + match Jsont_bytesrw.decode_string Jsont.json body with 9080 + | Ok json -> Some (Openapi.Runtime.Json json) 9081 + | Error _ -> Some (Openapi.Runtime.Raw body) 9082 + in 7571 9083 raise (Openapi.Runtime.Api_error { 7572 9084 operation = op_name; 7573 9085 method_ = "POST"; 7574 9086 url; 7575 9087 status = Requests.Response.status_code response; 7576 - body = Requests.Response.text response; 9088 + body; 9089 + parsed_body; 7577 9090 }) 7578 9091 7579 9092 (** Accept job ··· 7593 9106 if Requests.Response.ok response then 7594 9107 Requests.Response.json response 7595 9108 else 9109 + let body = Requests.Response.text response in 9110 + let parsed_body = 9111 + match Jsont_bytesrw.decode_string Jsont.json body with 9112 + | Ok json -> Some (Openapi.Runtime.Json json) 9113 + | Error _ -> Some (Openapi.Runtime.Raw body) 9114 + in 7596 9115 raise (Openapi.Runtime.Api_error { 7597 9116 operation = op_name; 7598 9117 method_ = "POST"; 7599 9118 url; 7600 9119 status = Requests.Response.status_code response; 7601 - body = Requests.Response.text response; 9120 + body; 9121 + parsed_body; 7602 9122 }) 7603 9123 7604 9124 (** Cancel a job *) ··· 7616 9136 if Requests.Response.ok response then 7617 9137 Requests.Response.json response 7618 9138 else 9139 + let body = Requests.Response.text response in 9140 + let parsed_body = 9141 + match Jsont_bytesrw.decode_string Jsont.json body with 9142 + | Ok json -> Some (Openapi.Runtime.Json json) 9143 + | Error _ -> Some (Openapi.Runtime.Raw body) 9144 + in 7619 9145 raise (Openapi.Runtime.Api_error { 7620 9146 operation = op_name; 7621 9147 method_ = "GET"; 7622 9148 url; 7623 9149 status = Requests.Response.status_code response; 7624 - body = Requests.Response.text response; 9150 + body; 9151 + parsed_body; 7625 9152 }) 7626 9153 7627 9154 (** Post job error ··· 7641 9168 if Requests.Response.ok response then 7642 9169 Requests.Response.json response 7643 9170 else 9171 + let body = Requests.Response.text response in 9172 + let parsed_body = 9173 + match Jsont_bytesrw.decode_string Jsont.json body with 9174 + | Ok json -> Some (Openapi.Runtime.Json json) 9175 + | Error _ -> Some (Openapi.Runtime.Raw body) 9176 + in 7644 9177 raise (Openapi.Runtime.Api_error { 7645 9178 operation = op_name; 7646 9179 method_ = "POST"; 7647 9180 url; 7648 9181 status = Requests.Response.status_code response; 7649 - body = Requests.Response.text response; 9182 + body; 9183 + parsed_body; 7650 9184 }) 7651 9185 7652 9186 (** Post job success ··· 7666 9200 if Requests.Response.ok response then 7667 9201 Requests.Response.json response 7668 9202 else 9203 + let body = Requests.Response.text response in 9204 + let parsed_body = 9205 + match Jsont_bytesrw.decode_string Jsont.json body with 9206 + | Ok json -> Some (Openapi.Runtime.Json json) 9207 + | Error _ -> Some (Openapi.Runtime.Raw body) 9208 + in 7669 9209 raise (Openapi.Runtime.Api_error { 7670 9210 operation = op_name; 7671 9211 method_ = "POST"; 7672 9212 url; 7673 9213 status = Requests.Response.status_code response; 7674 - body = Requests.Response.text response; 9214 + body; 9215 + parsed_body; 7675 9216 }) 7676 9217 7677 9218 (** Update job ··· 7691 9232 if Requests.Response.ok response then 7692 9233 Requests.Response.json response 7693 9234 else 9235 + let body = Requests.Response.text response in 9236 + let parsed_body = 9237 + match Jsont_bytesrw.decode_string Jsont.json body with 9238 + | Ok json -> Some (Openapi.Runtime.Json json) 9239 + | Error _ -> Some (Openapi.Runtime.Raw body) 9240 + in 7694 9241 raise (Openapi.Runtime.Api_error { 7695 9242 operation = op_name; 7696 9243 method_ = "POST"; 7697 9244 url; 7698 9245 status = Requests.Response.status_code response; 7699 - body = Requests.Response.text response; 9246 + body; 9247 + parsed_body; 7700 9248 }) 7701 9249 7702 9250 (** Register a new runner ··· 7716 9264 if Requests.Response.ok response then 7717 9265 Requests.Response.json response 7718 9266 else 9267 + let body = Requests.Response.text response in 9268 + let parsed_body = 9269 + match Jsont_bytesrw.decode_string Jsont.json body with 9270 + | Ok json -> Some (Openapi.Runtime.Json json) 9271 + | Error _ -> Some (Openapi.Runtime.Raw body) 9272 + in 7719 9273 raise (Openapi.Runtime.Api_error { 7720 9274 operation = op_name; 7721 9275 method_ = "POST"; 7722 9276 url; 7723 9277 status = Requests.Response.status_code response; 7724 - body = Requests.Response.text response; 9278 + body; 9279 + parsed_body; 7725 9280 }) 7726 9281 7727 9282 (** List registration tokens ··· 7743 9298 if Requests.Response.ok response then 7744 9299 Requests.Response.json response 7745 9300 else 9301 + let body = Requests.Response.text response in 9302 + let parsed_body = 9303 + match Jsont_bytesrw.decode_string Jsont.json body with 9304 + | Ok json -> Some (Openapi.Runtime.Json json) 9305 + | Error _ -> Some (Openapi.Runtime.Raw body) 9306 + in 7746 9307 raise (Openapi.Runtime.Api_error { 7747 9308 operation = op_name; 7748 9309 method_ = "GET"; 7749 9310 url; 7750 9311 status = Requests.Response.status_code response; 7751 - body = Requests.Response.text response; 9312 + body; 9313 + parsed_body; 7752 9314 }) 7753 9315 7754 9316 (** Generate registration token ··· 7768 9330 if Requests.Response.ok response then 7769 9331 Requests.Response.json response 7770 9332 else 9333 + let body = Requests.Response.text response in 9334 + let parsed_body = 9335 + match Jsont_bytesrw.decode_string Jsont.json body with 9336 + | Ok json -> Some (Openapi.Runtime.Json json) 9337 + | Error _ -> Some (Openapi.Runtime.Raw body) 9338 + in 7771 9339 raise (Openapi.Runtime.Api_error { 7772 9340 operation = op_name; 7773 9341 method_ = "POST"; 7774 9342 url; 7775 9343 status = Requests.Response.status_code response; 7776 - body = Requests.Response.text response; 9344 + body; 9345 + parsed_body; 7777 9346 }) 7778 9347 7779 9348 (** Remove registration token ··· 7793 9362 if Requests.Response.ok response then 7794 9363 Requests.Response.json response 7795 9364 else 9365 + let body = Requests.Response.text response in 9366 + let parsed_body = 9367 + match Jsont_bytesrw.decode_string Jsont.json body with 9368 + | Ok json -> Some (Openapi.Runtime.Json json) 9369 + | Error _ -> Some (Openapi.Runtime.Raw body) 9370 + in 7796 9371 raise (Openapi.Runtime.Api_error { 7797 9372 operation = op_name; 7798 9373 method_ = "DELETE"; 7799 9374 url; 7800 9375 status = Requests.Response.status_code response; 7801 - body = Requests.Response.text response; 9376 + body; 9377 + parsed_body; 7802 9378 }) 7803 9379 7804 9380 (** Unregister a runner ··· 7818 9394 if Requests.Response.ok response then 7819 9395 Requests.Response.json response 7820 9396 else 9397 + let body = Requests.Response.text response in 9398 + let parsed_body = 9399 + match Jsont_bytesrw.decode_string Jsont.json body with 9400 + | Ok json -> Some (Openapi.Runtime.Json json) 9401 + | Error _ -> Some (Openapi.Runtime.Raw body) 9402 + in 7821 9403 raise (Openapi.Runtime.Api_error { 7822 9404 operation = op_name; 7823 9405 method_ = "POST"; 7824 9406 url; 7825 9407 status = Requests.Response.status_code response; 7826 - body = Requests.Response.text response; 9408 + body; 9409 + parsed_body; 7827 9410 }) 7828 9411 7829 9412 (** Delete a runner *) ··· 7841 9424 if Requests.Response.ok response then 7842 9425 Requests.Response.json response 7843 9426 else 9427 + let body = Requests.Response.text response in 9428 + let parsed_body = 9429 + match Jsont_bytesrw.decode_string Jsont.json body with 9430 + | Ok json -> Some (Openapi.Runtime.Json json) 9431 + | Error _ -> Some (Openapi.Runtime.Raw body) 9432 + in 7844 9433 raise (Openapi.Runtime.Api_error { 7845 9434 operation = op_name; 7846 9435 method_ = "DELETE"; 7847 9436 url; 7848 9437 status = Requests.Response.status_code response; 7849 - body = Requests.Response.text response; 9438 + body; 9439 + parsed_body; 7850 9440 }) 7851 9441 7852 9442 (** Search playlists ··· 7881 9471 if Requests.Response.ok response then 7882 9472 Requests.Response.json response 7883 9473 else 9474 + let body = Requests.Response.text response in 9475 + let parsed_body = 9476 + match Jsont_bytesrw.decode_string Jsont.json body with 9477 + | Ok json -> Some (Openapi.Runtime.Json json) 9478 + | Error _ -> Some (Openapi.Runtime.Raw body) 9479 + in 7884 9480 raise (Openapi.Runtime.Api_error { 7885 9481 operation = op_name; 7886 9482 method_ = "GET"; 7887 9483 url; 7888 9484 status = Requests.Response.status_code response; 7889 - body = Requests.Response.text response; 9485 + body; 9486 + parsed_body; 7890 9487 }) 7891 9488 7892 9489 (** Get instance audit logs *) ··· 7904 9501 if Requests.Response.ok response then 7905 9502 Requests.Response.json response 7906 9503 else 9504 + let body = Requests.Response.text response in 9505 + let parsed_body = 9506 + match Jsont_bytesrw.decode_string Jsont.json body with 9507 + | Ok json -> Some (Openapi.Runtime.Json json) 9508 + | Error _ -> Some (Openapi.Runtime.Raw body) 9509 + in 7907 9510 raise (Openapi.Runtime.Api_error { 7908 9511 operation = op_name; 7909 9512 method_ = "GET"; 7910 9513 url; 7911 9514 status = Requests.Response.status_code response; 7912 - body = Requests.Response.text response; 9515 + body; 9516 + parsed_body; 7913 9517 }) 7914 9518 7915 9519 (** List account blocks ··· 7931 9535 if Requests.Response.ok response then 7932 9536 Requests.Response.json response 7933 9537 else 9538 + let body = Requests.Response.text response in 9539 + let parsed_body = 9540 + match Jsont_bytesrw.decode_string Jsont.json body with 9541 + | Ok json -> Some (Openapi.Runtime.Json json) 9542 + | Error _ -> Some (Openapi.Runtime.Raw body) 9543 + in 7934 9544 raise (Openapi.Runtime.Api_error { 7935 9545 operation = op_name; 7936 9546 method_ = "GET"; 7937 9547 url; 7938 9548 status = Requests.Response.status_code response; 7939 - body = Requests.Response.text response; 9549 + body; 9550 + parsed_body; 7940 9551 }) 7941 9552 7942 9553 (** Block an account *) ··· 7954 9565 if Requests.Response.ok response then 7955 9566 Requests.Response.json response 7956 9567 else 9568 + let body = Requests.Response.text response in 9569 + let parsed_body = 9570 + match Jsont_bytesrw.decode_string Jsont.json body with 9571 + | Ok json -> Some (Openapi.Runtime.Json json) 9572 + | Error _ -> Some (Openapi.Runtime.Raw body) 9573 + in 7957 9574 raise (Openapi.Runtime.Api_error { 7958 9575 operation = op_name; 7959 9576 method_ = "POST"; 7960 9577 url; 7961 9578 status = Requests.Response.status_code response; 7962 - body = Requests.Response.text response; 9579 + body; 9580 + parsed_body; 7963 9581 }) 7964 9582 7965 9583 (** Unblock an account by its handle ··· 7979 9597 if Requests.Response.ok response then 7980 9598 Requests.Response.json response 7981 9599 else 9600 + let body = Requests.Response.text response in 9601 + let parsed_body = 9602 + match Jsont_bytesrw.decode_string Jsont.json body with 9603 + | Ok json -> Some (Openapi.Runtime.Json json) 9604 + | Error _ -> Some (Openapi.Runtime.Raw body) 9605 + in 7982 9606 raise (Openapi.Runtime.Api_error { 7983 9607 operation = op_name; 7984 9608 method_ = "DELETE"; 7985 9609 url; 7986 9610 status = Requests.Response.status_code response; 7987 - body = Requests.Response.text response; 9611 + body; 9612 + parsed_body; 7988 9613 }) 7989 9614 7990 9615 (** List server blocks ··· 8006 9631 if Requests.Response.ok response then 8007 9632 Requests.Response.json response 8008 9633 else 9634 + let body = Requests.Response.text response in 9635 + let parsed_body = 9636 + match Jsont_bytesrw.decode_string Jsont.json body with 9637 + | Ok json -> Some (Openapi.Runtime.Json json) 9638 + | Error _ -> Some (Openapi.Runtime.Raw body) 9639 + in 8009 9640 raise (Openapi.Runtime.Api_error { 8010 9641 operation = op_name; 8011 9642 method_ = "GET"; 8012 9643 url; 8013 9644 status = Requests.Response.status_code response; 8014 - body = Requests.Response.text response; 9645 + body; 9646 + parsed_body; 8015 9647 }) 8016 9648 8017 9649 (** Block a server *) ··· 8029 9661 if Requests.Response.ok response then 8030 9662 Requests.Response.json response 8031 9663 else 9664 + let body = Requests.Response.text response in 9665 + let parsed_body = 9666 + match Jsont_bytesrw.decode_string Jsont.json body with 9667 + | Ok json -> Some (Openapi.Runtime.Json json) 9668 + | Error _ -> Some (Openapi.Runtime.Raw body) 9669 + in 8032 9670 raise (Openapi.Runtime.Api_error { 8033 9671 operation = op_name; 8034 9672 method_ = "POST"; 8035 9673 url; 8036 9674 status = Requests.Response.status_code response; 8037 - body = Requests.Response.text response; 9675 + body; 9676 + parsed_body; 8038 9677 }) 8039 9678 8040 9679 (** Unblock a server by its domain ··· 8054 9693 if Requests.Response.ok response then 8055 9694 Requests.Response.json response 8056 9695 else 9696 + let body = Requests.Response.text response in 9697 + let parsed_body = 9698 + match Jsont_bytesrw.decode_string Jsont.json body with 9699 + | Ok json -> Some (Openapi.Runtime.Json json) 9700 + | Error _ -> Some (Openapi.Runtime.Raw body) 9701 + in 8057 9702 raise (Openapi.Runtime.Api_error { 8058 9703 operation = op_name; 8059 9704 method_ = "DELETE"; 8060 9705 url; 8061 9706 status = Requests.Response.status_code response; 8062 - body = Requests.Response.text response; 9707 + body; 9708 + parsed_body; 8063 9709 }) 8064 9710 8065 9711 (** List instances following the server ··· 8081 9727 if Requests.Response.ok response then 8082 9728 Requests.Response.json response 8083 9729 else 9730 + let body = Requests.Response.text response in 9731 + let parsed_body = 9732 + match Jsont_bytesrw.decode_string Jsont.json body with 9733 + | Ok json -> Some (Openapi.Runtime.Json json) 9734 + | Error _ -> Some (Openapi.Runtime.Raw body) 9735 + in 8084 9736 raise (Openapi.Runtime.Api_error { 8085 9737 operation = op_name; 8086 9738 method_ = "GET"; 8087 9739 url; 8088 9740 status = Requests.Response.status_code response; 8089 - body = Requests.Response.text response; 9741 + body; 9742 + parsed_body; 8090 9743 }) 8091 9744 8092 9745 (** Remove or reject a follower to your server ··· 8106 9759 if Requests.Response.ok response then 8107 9760 Requests.Response.json response 8108 9761 else 9762 + let body = Requests.Response.text response in 9763 + let parsed_body = 9764 + match Jsont_bytesrw.decode_string Jsont.json body with 9765 + | Ok json -> Some (Openapi.Runtime.Json json) 9766 + | Error _ -> Some (Openapi.Runtime.Raw body) 9767 + in 8109 9768 raise (Openapi.Runtime.Api_error { 8110 9769 operation = op_name; 8111 9770 method_ = "DELETE"; 8112 9771 url; 8113 9772 status = Requests.Response.status_code response; 8114 - body = Requests.Response.text response; 9773 + body; 9774 + parsed_body; 8115 9775 }) 8116 9776 8117 9777 (** Accept a pending follower to your server ··· 8131 9791 if Requests.Response.ok response then 8132 9792 Requests.Response.json response 8133 9793 else 9794 + let body = Requests.Response.text response in 9795 + let parsed_body = 9796 + match Jsont_bytesrw.decode_string Jsont.json body with 9797 + | Ok json -> Some (Openapi.Runtime.Json json) 9798 + | Error _ -> Some (Openapi.Runtime.Raw body) 9799 + in 8134 9800 raise (Openapi.Runtime.Api_error { 8135 9801 operation = op_name; 8136 9802 method_ = "POST"; 8137 9803 url; 8138 9804 status = Requests.Response.status_code response; 8139 - body = Requests.Response.text response; 9805 + body; 9806 + parsed_body; 8140 9807 }) 8141 9808 8142 9809 (** Reject a pending follower to your server ··· 8156 9823 if Requests.Response.ok response then 8157 9824 Requests.Response.json response 8158 9825 else 9826 + let body = Requests.Response.text response in 9827 + let parsed_body = 9828 + match Jsont_bytesrw.decode_string Jsont.json body with 9829 + | Ok json -> Some (Openapi.Runtime.Json json) 9830 + | Error _ -> Some (Openapi.Runtime.Raw body) 9831 + in 8159 9832 raise (Openapi.Runtime.Api_error { 8160 9833 operation = op_name; 8161 9834 method_ = "POST"; 8162 9835 url; 8163 9836 status = Requests.Response.status_code response; 8164 - body = Requests.Response.text response; 9837 + body; 9838 + parsed_body; 8165 9839 }) 8166 9840 8167 9841 (** List instances followed by the server ··· 8183 9857 if Requests.Response.ok response then 8184 9858 Requests.Response.json response 8185 9859 else 9860 + let body = Requests.Response.text response in 9861 + let parsed_body = 9862 + match Jsont_bytesrw.decode_string Jsont.json body with 9863 + | Ok json -> Some (Openapi.Runtime.Json json) 9864 + | Error _ -> Some (Openapi.Runtime.Raw body) 9865 + in 8186 9866 raise (Openapi.Runtime.Api_error { 8187 9867 operation = op_name; 8188 9868 method_ = "GET"; 8189 9869 url; 8190 9870 status = Requests.Response.status_code response; 8191 - body = Requests.Response.text response; 9871 + body; 9872 + parsed_body; 8192 9873 }) 8193 9874 8194 9875 (** Follow a list of actors (PeerTube instance, channel or account) *) ··· 8206 9887 if Requests.Response.ok response then 8207 9888 Requests.Response.json response 8208 9889 else 9890 + let body = Requests.Response.text response in 9891 + let parsed_body = 9892 + match Jsont_bytesrw.decode_string Jsont.json body with 9893 + | Ok json -> Some (Openapi.Runtime.Json json) 9894 + | Error _ -> Some (Openapi.Runtime.Raw body) 9895 + in 8209 9896 raise (Openapi.Runtime.Api_error { 8210 9897 operation = op_name; 8211 9898 method_ = "POST"; 8212 9899 url; 8213 9900 status = Requests.Response.status_code response; 8214 - body = Requests.Response.text response; 9901 + body; 9902 + parsed_body; 8215 9903 }) 8216 9904 8217 9905 (** Unfollow an actor (PeerTube instance, channel or account) ··· 8231 9919 if Requests.Response.ok response then 8232 9920 Requests.Response.json response 8233 9921 else 9922 + let body = Requests.Response.text response in 9923 + let parsed_body = 9924 + match Jsont_bytesrw.decode_string Jsont.json body with 9925 + | Ok json -> Some (Openapi.Runtime.Json json) 9926 + | Error _ -> Some (Openapi.Runtime.Raw body) 9927 + in 8234 9928 raise (Openapi.Runtime.Api_error { 8235 9929 operation = op_name; 8236 9930 method_ = "DELETE"; 8237 9931 url; 8238 9932 status = Requests.Response.status_code response; 8239 - body = Requests.Response.text response; 9933 + body; 9934 + parsed_body; 8240 9935 }) 8241 9936 8242 9937 (** Get instance logs *) ··· 8254 9949 if Requests.Response.ok response then 8255 9950 Requests.Response.json response 8256 9951 else 9952 + let body = Requests.Response.text response in 9953 + let parsed_body = 9954 + match Jsont_bytesrw.decode_string Jsont.json body with 9955 + | Ok json -> Some (Openapi.Runtime.Json json) 9956 + | Error _ -> Some (Openapi.Runtime.Raw body) 9957 + in 8257 9958 raise (Openapi.Runtime.Api_error { 8258 9959 operation = op_name; 8259 9960 method_ = "GET"; 8260 9961 url; 8261 9962 status = Requests.Response.status_code response; 8262 - body = Requests.Response.text response; 9963 + body; 9964 + parsed_body; 8263 9965 }) 8264 9966 8265 9967 (** Send client log *) ··· 8277 9979 if Requests.Response.ok response then 8278 9980 Requests.Response.json response 8279 9981 else 9982 + let body = Requests.Response.text response in 9983 + let parsed_body = 9984 + match Jsont_bytesrw.decode_string Jsont.json body with 9985 + | Ok json -> Some (Openapi.Runtime.Json json) 9986 + | Error _ -> Some (Openapi.Runtime.Raw body) 9987 + in 8280 9988 raise (Openapi.Runtime.Api_error { 8281 9989 operation = op_name; 8282 9990 method_ = "POST"; 8283 9991 url; 8284 9992 status = Requests.Response.status_code response; 8285 - body = Requests.Response.text response; 9993 + body; 9994 + parsed_body; 8286 9995 }) 8287 9996 8288 9997 (** Mirror a video *) ··· 8300 10009 if Requests.Response.ok response then 8301 10010 Requests.Response.json response 8302 10011 else 10012 + let body = Requests.Response.text response in 10013 + let parsed_body = 10014 + match Jsont_bytesrw.decode_string Jsont.json body with 10015 + | Ok json -> Some (Openapi.Runtime.Json json) 10016 + | Error _ -> Some (Openapi.Runtime.Raw body) 10017 + in 8303 10018 raise (Openapi.Runtime.Api_error { 8304 10019 operation = op_name; 8305 10020 method_ = "POST"; 8306 10021 url; 8307 10022 status = Requests.Response.status_code response; 8308 - body = Requests.Response.text response; 10023 + body; 10024 + parsed_body; 8309 10025 }) 8310 10026 8311 10027 (** Delete a mirror done on a video ··· 8325 10041 if Requests.Response.ok response then 8326 10042 Requests.Response.json response 8327 10043 else 10044 + let body = Requests.Response.text response in 10045 + let parsed_body = 10046 + match Jsont_bytesrw.decode_string Jsont.json body with 10047 + | Ok json -> Some (Openapi.Runtime.Json json) 10048 + | Error _ -> Some (Openapi.Runtime.Raw body) 10049 + in 8328 10050 raise (Openapi.Runtime.Api_error { 8329 10051 operation = op_name; 8330 10052 method_ = "DELETE"; 8331 10053 url; 8332 10054 status = Requests.Response.status_code response; 8333 - body = Requests.Response.text response; 10055 + body; 10056 + parsed_body; 8334 10057 }) 8335 10058 8336 10059 (** Update a server redundancy policy ··· 8350 10073 if Requests.Response.ok response then 8351 10074 Requests.Response.json response 8352 10075 else 10076 + let body = Requests.Response.text response in 10077 + let parsed_body = 10078 + match Jsont_bytesrw.decode_string Jsont.json body with 10079 + | Ok json -> Some (Openapi.Runtime.Json json) 10080 + | Error _ -> Some (Openapi.Runtime.Raw body) 10081 + in 8353 10082 raise (Openapi.Runtime.Api_error { 8354 10083 operation = op_name; 8355 10084 method_ = "PUT"; 8356 10085 url; 8357 10086 status = Requests.Response.status_code response; 8358 - body = Requests.Response.text response; 10087 + body; 10088 + parsed_body; 8359 10089 }) 8360 10090 8361 10091 (** Ask to reset password ··· 8375 10105 if Requests.Response.ok response then 8376 10106 Requests.Response.json response 8377 10107 else 10108 + let body = Requests.Response.text response in 10109 + let parsed_body = 10110 + match Jsont_bytesrw.decode_string Jsont.json body with 10111 + | Ok json -> Some (Openapi.Runtime.Json json) 10112 + | Error _ -> Some (Openapi.Runtime.Raw body) 10113 + in 8378 10114 raise (Openapi.Runtime.Api_error { 8379 10115 operation = op_name; 8380 10116 method_ = "POST"; 8381 10117 url; 8382 10118 status = Requests.Response.status_code response; 8383 - body = Requests.Response.text response; 10119 + body; 10120 + parsed_body; 8384 10121 }) 8385 10122 8386 10123 (** Resend user verification link *) ··· 8398 10135 if Requests.Response.ok response then 8399 10136 Requests.Response.json response 8400 10137 else 10138 + let body = Requests.Response.text response in 10139 + let parsed_body = 10140 + match Jsont_bytesrw.decode_string Jsont.json body with 10141 + | Ok json -> Some (Openapi.Runtime.Json json) 10142 + | Error _ -> Some (Openapi.Runtime.Raw body) 10143 + in 8401 10144 raise (Openapi.Runtime.Api_error { 8402 10145 operation = op_name; 8403 10146 method_ = "POST"; 8404 10147 url; 8405 10148 status = Requests.Response.status_code response; 8406 - body = Requests.Response.text response; 10149 + body; 10150 + parsed_body; 8407 10151 }) 8408 10152 8409 10153 (** Update my user information *) ··· 8421 10165 if Requests.Response.ok response then 8422 10166 Requests.Response.json response 8423 10167 else 10168 + let body = Requests.Response.text response in 10169 + let parsed_body = 10170 + match Jsont_bytesrw.decode_string Jsont.json body with 10171 + | Ok json -> Some (Openapi.Runtime.Json json) 10172 + | Error _ -> Some (Openapi.Runtime.Raw body) 10173 + in 8424 10174 raise (Openapi.Runtime.Api_error { 8425 10175 operation = op_name; 8426 10176 method_ = "PUT"; 8427 10177 url; 8428 10178 status = Requests.Response.status_code response; 8429 - body = Requests.Response.text response; 10179 + body; 10180 + parsed_body; 8430 10181 }) 8431 10182 8432 10183 (** List my abuses ··· 8449 10200 if Requests.Response.ok response then 8450 10201 Requests.Response.json response 8451 10202 else 10203 + let body = Requests.Response.text response in 10204 + let parsed_body = 10205 + match Jsont_bytesrw.decode_string Jsont.json body with 10206 + | Ok json -> Some (Openapi.Runtime.Json json) 10207 + | Error _ -> Some (Openapi.Runtime.Raw body) 10208 + in 8452 10209 raise (Openapi.Runtime.Api_error { 8453 10210 operation = op_name; 8454 10211 method_ = "GET"; 8455 10212 url; 8456 10213 status = Requests.Response.status_code response; 8457 - body = Requests.Response.text response; 10214 + body; 10215 + parsed_body; 8458 10216 }) 8459 10217 8460 10218 (** Delete my avatar *) ··· 8472 10230 if Requests.Response.ok response then 8473 10231 Requests.Response.json response 8474 10232 else 10233 + let body = Requests.Response.text response in 10234 + let parsed_body = 10235 + match Jsont_bytesrw.decode_string Jsont.json body with 10236 + | Ok json -> Some (Openapi.Runtime.Json json) 10237 + | Error _ -> Some (Openapi.Runtime.Raw body) 10238 + in 8475 10239 raise (Openapi.Runtime.Api_error { 8476 10240 operation = op_name; 8477 10241 method_ = "DELETE"; 8478 10242 url; 8479 10243 status = Requests.Response.status_code response; 8480 - body = Requests.Response.text response; 10244 + body; 10245 + parsed_body; 8481 10246 }) 8482 10247 8483 10248 (** Update my user avatar *) ··· 8495 10260 if Requests.Response.ok response then 8496 10261 Requests.Response.json response 8497 10262 else 10263 + let body = Requests.Response.text response in 10264 + let parsed_body = 10265 + match Jsont_bytesrw.decode_string Jsont.json body with 10266 + | Ok json -> Some (Openapi.Runtime.Json json) 10267 + | Error _ -> Some (Openapi.Runtime.Raw body) 10268 + in 8498 10269 raise (Openapi.Runtime.Api_error { 8499 10270 operation = op_name; 8500 10271 method_ = "POST"; 8501 10272 url; 8502 10273 status = Requests.Response.status_code response; 8503 - body = Requests.Response.text response; 10274 + body; 10275 + parsed_body; 8504 10276 }) 8505 10277 8506 10278 (** Clear video history *) ··· 8518 10290 if Requests.Response.ok response then 8519 10291 Requests.Response.json response 8520 10292 else 10293 + let body = Requests.Response.text response in 10294 + let parsed_body = 10295 + match Jsont_bytesrw.decode_string Jsont.json body with 10296 + | Ok json -> Some (Openapi.Runtime.Json json) 10297 + | Error _ -> Some (Openapi.Runtime.Raw body) 10298 + in 8521 10299 raise (Openapi.Runtime.Api_error { 8522 10300 operation = op_name; 8523 10301 method_ = "POST"; 8524 10302 url; 8525 10303 status = Requests.Response.status_code response; 8526 - body = Requests.Response.text response; 10304 + body; 10305 + parsed_body; 8527 10306 }) 8528 10307 8529 10308 (** Delete history element *) ··· 8541 10320 if Requests.Response.ok response then 8542 10321 Requests.Response.json response 8543 10322 else 10323 + let body = Requests.Response.text response in 10324 + let parsed_body = 10325 + match Jsont_bytesrw.decode_string Jsont.json body with 10326 + | Ok json -> Some (Openapi.Runtime.Json json) 10327 + | Error _ -> Some (Openapi.Runtime.Raw body) 10328 + in 8544 10329 raise (Openapi.Runtime.Api_error { 8545 10330 operation = op_name; 8546 10331 method_ = "DELETE"; 8547 10332 url; 8548 10333 status = Requests.Response.status_code response; 8549 - body = Requests.Response.text response; 10334 + body; 10335 + parsed_body; 8550 10336 }) 8551 10337 8552 10338 (** Mark feature info as read ··· 8566 10352 if Requests.Response.ok response then 8567 10353 Requests.Response.json response 8568 10354 else 10355 + let body = Requests.Response.text response in 10356 + let parsed_body = 10357 + match Jsont_bytesrw.decode_string Jsont.json body with 10358 + | Ok json -> Some (Openapi.Runtime.Json json) 10359 + | Error _ -> Some (Openapi.Runtime.Raw body) 10360 + in 8569 10361 raise (Openapi.Runtime.Api_error { 8570 10362 operation = op_name; 8571 10363 method_ = "POST"; 8572 10364 url; 8573 10365 status = Requests.Response.status_code response; 8574 - body = Requests.Response.text response; 10366 + body; 10367 + parsed_body; 8575 10368 }) 8576 10369 8577 10370 (** Update my notification settings *) ··· 8589 10382 if Requests.Response.ok response then 8590 10383 Requests.Response.json response 8591 10384 else 10385 + let body = Requests.Response.text response in 10386 + let parsed_body = 10387 + match Jsont_bytesrw.decode_string Jsont.json body with 10388 + | Ok json -> Some (Openapi.Runtime.Json json) 10389 + | Error _ -> Some (Openapi.Runtime.Raw body) 10390 + in 8592 10391 raise (Openapi.Runtime.Api_error { 8593 10392 operation = op_name; 8594 10393 method_ = "PUT"; 8595 10394 url; 8596 10395 status = Requests.Response.status_code response; 8597 - body = Requests.Response.text response; 10396 + body; 10397 + parsed_body; 8598 10398 }) 8599 10399 8600 10400 (** Mark notifications as read by their id *) ··· 8612 10412 if Requests.Response.ok response then 8613 10413 Requests.Response.json response 8614 10414 else 10415 + let body = Requests.Response.text response in 10416 + let parsed_body = 10417 + match Jsont_bytesrw.decode_string Jsont.json body with 10418 + | Ok json -> Some (Openapi.Runtime.Json json) 10419 + | Error _ -> Some (Openapi.Runtime.Raw body) 10420 + in 8615 10421 raise (Openapi.Runtime.Api_error { 8616 10422 operation = op_name; 8617 10423 method_ = "POST"; 8618 10424 url; 8619 10425 status = Requests.Response.status_code response; 8620 - body = Requests.Response.text response; 10426 + body; 10427 + parsed_body; 8621 10428 }) 8622 10429 8623 10430 (** Mark all my notification as read *) ··· 8635 10442 if Requests.Response.ok response then 8636 10443 Requests.Response.json response 8637 10444 else 10445 + let body = Requests.Response.text response in 10446 + let parsed_body = 10447 + match Jsont_bytesrw.decode_string Jsont.json body with 10448 + | Ok json -> Some (Openapi.Runtime.Json json) 10449 + | Error _ -> Some (Openapi.Runtime.Raw body) 10450 + in 8638 10451 raise (Openapi.Runtime.Api_error { 8639 10452 operation = op_name; 8640 10453 method_ = "POST"; 8641 10454 url; 8642 10455 status = Requests.Response.status_code response; 8643 - body = Requests.Response.text response; 10456 + body; 10457 + parsed_body; 8644 10458 }) 8645 10459 8646 10460 (** Add subscription to my user *) ··· 8658 10472 if Requests.Response.ok response then 8659 10473 Requests.Response.json response 8660 10474 else 10475 + let body = Requests.Response.text response in 10476 + let parsed_body = 10477 + match Jsont_bytesrw.decode_string Jsont.json body with 10478 + | Ok json -> Some (Openapi.Runtime.Json json) 10479 + | Error _ -> Some (Openapi.Runtime.Raw body) 10480 + in 8661 10481 raise (Openapi.Runtime.Api_error { 8662 10482 operation = op_name; 8663 10483 method_ = "POST"; 8664 10484 url; 8665 10485 status = Requests.Response.status_code response; 8666 - body = Requests.Response.text response; 10486 + body; 10487 + parsed_body; 8667 10488 }) 8668 10489 8669 10490 (** Get if subscriptions exist for my user ··· 8683 10504 if Requests.Response.ok response then 8684 10505 Requests.Response.json response 8685 10506 else 10507 + let body = Requests.Response.text response in 10508 + let parsed_body = 10509 + match Jsont_bytesrw.decode_string Jsont.json body with 10510 + | Ok json -> Some (Openapi.Runtime.Json json) 10511 + | Error _ -> Some (Openapi.Runtime.Raw body) 10512 + in 8686 10513 raise (Openapi.Runtime.Api_error { 8687 10514 operation = op_name; 8688 10515 method_ = "GET"; 8689 10516 url; 8690 10517 status = Requests.Response.status_code response; 8691 - body = Requests.Response.text response; 10518 + body; 10519 + parsed_body; 8692 10520 }) 8693 10521 8694 10522 (** Delete subscription of my user ··· 8708 10536 if Requests.Response.ok response then 8709 10537 Requests.Response.json response 8710 10538 else 10539 + let body = Requests.Response.text response in 10540 + let parsed_body = 10541 + match Jsont_bytesrw.decode_string Jsont.json body with 10542 + | Ok json -> Some (Openapi.Runtime.Json json) 10543 + | Error _ -> Some (Openapi.Runtime.Raw body) 10544 + in 8711 10545 raise (Openapi.Runtime.Api_error { 8712 10546 operation = op_name; 8713 10547 method_ = "DELETE"; 8714 10548 url; 8715 10549 status = Requests.Response.status_code response; 8716 - body = Requests.Response.text response; 10550 + body; 10551 + parsed_body; 8717 10552 }) 8718 10553 8719 10554 (** Check video exists in my playlists ··· 8733 10568 if Requests.Response.ok response then 8734 10569 Requests.Response.json response 8735 10570 else 10571 + let body = Requests.Response.text response in 10572 + let parsed_body = 10573 + match Jsont_bytesrw.decode_string Jsont.json body with 10574 + | Ok json -> Some (Openapi.Runtime.Json json) 10575 + | Error _ -> Some (Openapi.Runtime.Raw body) 10576 + in 8736 10577 raise (Openapi.Runtime.Api_error { 8737 10578 operation = op_name; 8738 10579 method_ = "GET"; 8739 10580 url; 8740 10581 status = Requests.Response.status_code response; 8741 - body = Requests.Response.text response; 10582 + body; 10583 + parsed_body; 8742 10584 }) 8743 10585 8744 10586 (** Get my user used quota *) ··· 8756 10598 if Requests.Response.ok response then 8757 10599 Requests.Response.json response 8758 10600 else 10601 + let body = Requests.Response.text response in 10602 + let parsed_body = 10603 + match Jsont_bytesrw.decode_string Jsont.json body with 10604 + | Ok json -> Some (Openapi.Runtime.Json json) 10605 + | Error _ -> Some (Openapi.Runtime.Raw body) 10606 + in 8759 10607 raise (Openapi.Runtime.Api_error { 8760 10608 operation = op_name; 8761 10609 method_ = "GET"; 8762 10610 url; 8763 10611 status = Requests.Response.status_code response; 8764 - body = Requests.Response.text response; 10612 + body; 10613 + parsed_body; 8765 10614 }) 8766 10615 8767 10616 (** List comments on user's videos ··· 8790 10639 if Requests.Response.ok response then 8791 10640 Requests.Response.json response 8792 10641 else 10642 + let body = Requests.Response.text response in 10643 + let parsed_body = 10644 + match Jsont_bytesrw.decode_string Jsont.json body with 10645 + | Ok json -> Some (Openapi.Runtime.Json json) 10646 + | Error _ -> Some (Openapi.Runtime.Raw body) 10647 + in 8793 10648 raise (Openapi.Runtime.Api_error { 8794 10649 operation = op_name; 8795 10650 method_ = "GET"; 8796 10651 url; 8797 10652 status = Requests.Response.status_code response; 8798 - body = Requests.Response.text response; 10653 + body; 10654 + parsed_body; 8799 10655 }) 8800 10656 8801 10657 (** Register a user ··· 8815 10671 if Requests.Response.ok response then 8816 10672 Requests.Response.json response 8817 10673 else 10674 + let body = Requests.Response.text response in 10675 + let parsed_body = 10676 + match Jsont_bytesrw.decode_string Jsont.json body with 10677 + | Ok json -> Some (Openapi.Runtime.Json json) 10678 + | Error _ -> Some (Openapi.Runtime.Raw body) 10679 + in 8818 10680 raise (Openapi.Runtime.Api_error { 8819 10681 operation = op_name; 8820 10682 method_ = "POST"; 8821 10683 url; 8822 10684 status = Requests.Response.status_code response; 8823 - body = Requests.Response.text response; 10685 + body; 10686 + parsed_body; 8824 10687 }) 8825 10688 8826 10689 (** List registrations ··· 8841 10704 if Requests.Response.ok response then 8842 10705 Requests.Response.json response 8843 10706 else 10707 + let body = Requests.Response.text response in 10708 + let parsed_body = 10709 + match Jsont_bytesrw.decode_string Jsont.json body with 10710 + | Ok json -> Some (Openapi.Runtime.Json json) 10711 + | Error _ -> Some (Openapi.Runtime.Raw body) 10712 + in 8844 10713 raise (Openapi.Runtime.Api_error { 8845 10714 operation = op_name; 8846 10715 method_ = "GET"; 8847 10716 url; 8848 10717 status = Requests.Response.status_code response; 8849 - body = Requests.Response.text response; 10718 + body; 10719 + parsed_body; 8850 10720 }) 8851 10721 8852 10722 (** Resend verification link to registration request email *) ··· 8864 10734 if Requests.Response.ok response then 8865 10735 Requests.Response.json response 8866 10736 else 10737 + let body = Requests.Response.text response in 10738 + let parsed_body = 10739 + match Jsont_bytesrw.decode_string Jsont.json body with 10740 + | Ok json -> Some (Openapi.Runtime.Json json) 10741 + | Error _ -> Some (Openapi.Runtime.Raw body) 10742 + in 8867 10743 raise (Openapi.Runtime.Api_error { 8868 10744 operation = op_name; 8869 10745 method_ = "POST"; 8870 10746 url; 8871 10747 status = Requests.Response.status_code response; 8872 - body = Requests.Response.text response; 10748 + body; 10749 + parsed_body; 8873 10750 }) 8874 10751 8875 10752 (** Delete registration ··· 8891 10768 if Requests.Response.ok response then 8892 10769 Requests.Response.json response 8893 10770 else 10771 + let body = Requests.Response.text response in 10772 + let parsed_body = 10773 + match Jsont_bytesrw.decode_string Jsont.json body with 10774 + | Ok json -> Some (Openapi.Runtime.Json json) 10775 + | Error _ -> Some (Openapi.Runtime.Raw body) 10776 + in 8894 10777 raise (Openapi.Runtime.Api_error { 8895 10778 operation = op_name; 8896 10779 method_ = "DELETE"; 8897 10780 url; 8898 10781 status = Requests.Response.status_code response; 8899 - body = Requests.Response.text response; 10782 + body; 10783 + parsed_body; 8900 10784 }) 8901 10785 8902 10786 (** Accept registration ··· 8916 10800 if Requests.Response.ok response then 8917 10801 Requests.Response.json response 8918 10802 else 10803 + let body = Requests.Response.text response in 10804 + let parsed_body = 10805 + match Jsont_bytesrw.decode_string Jsont.json body with 10806 + | Ok json -> Some (Openapi.Runtime.Json json) 10807 + | Error _ -> Some (Openapi.Runtime.Raw body) 10808 + in 8919 10809 raise (Openapi.Runtime.Api_error { 8920 10810 operation = op_name; 8921 10811 method_ = "POST"; 8922 10812 url; 8923 10813 status = Requests.Response.status_code response; 8924 - body = Requests.Response.text response; 10814 + body; 10815 + parsed_body; 8925 10816 }) 8926 10817 8927 10818 (** Reject registration ··· 8941 10832 if Requests.Response.ok response then 8942 10833 Requests.Response.json response 8943 10834 else 10835 + let body = Requests.Response.text response in 10836 + let parsed_body = 10837 + match Jsont_bytesrw.decode_string Jsont.json body with 10838 + | Ok json -> Some (Openapi.Runtime.Json json) 10839 + | Error _ -> Some (Openapi.Runtime.Raw body) 10840 + in 8944 10841 raise (Openapi.Runtime.Api_error { 8945 10842 operation = op_name; 8946 10843 method_ = "POST"; 8947 10844 url; 8948 10845 status = Requests.Response.status_code response; 8949 - body = Requests.Response.text response; 10846 + body; 10847 + parsed_body; 8950 10848 }) 8951 10849 8952 10850 (** Verify a registration email ··· 8970 10868 if Requests.Response.ok response then 8971 10869 Requests.Response.json response 8972 10870 else 10871 + let body = Requests.Response.text response in 10872 + let parsed_body = 10873 + match Jsont_bytesrw.decode_string Jsont.json body with 10874 + | Ok json -> Some (Openapi.Runtime.Json json) 10875 + | Error _ -> Some (Openapi.Runtime.Raw body) 10876 + in 8973 10877 raise (Openapi.Runtime.Api_error { 8974 10878 operation = op_name; 8975 10879 method_ = "POST"; 8976 10880 url; 8977 10881 status = Requests.Response.status_code response; 8978 - body = Requests.Response.text response; 10882 + body; 10883 + parsed_body; 8979 10884 }) 8980 10885 8981 10886 (** Logout ··· 8995 10900 if Requests.Response.ok response then 8996 10901 Requests.Response.json response 8997 10902 else 10903 + let body = Requests.Response.text response in 10904 + let parsed_body = 10905 + match Jsont_bytesrw.decode_string Jsont.json body with 10906 + | Ok json -> Some (Openapi.Runtime.Json json) 10907 + | Error _ -> Some (Openapi.Runtime.Raw body) 10908 + in 8998 10909 raise (Openapi.Runtime.Api_error { 8999 10910 operation = op_name; 9000 10911 method_ = "POST"; 9001 10912 url; 9002 10913 status = Requests.Response.status_code response; 9003 - body = Requests.Response.text response; 10914 + body; 10915 + parsed_body; 9004 10916 }) 9005 10917 9006 10918 (** Login ··· 9020 10932 if Requests.Response.ok response then 9021 10933 Requests.Response.json response 9022 10934 else 10935 + let body = Requests.Response.text response in 10936 + let parsed_body = 10937 + match Jsont_bytesrw.decode_string Jsont.json body with 10938 + | Ok json -> Some (Openapi.Runtime.Json json) 10939 + | Error _ -> Some (Openapi.Runtime.Raw body) 10940 + in 9023 10941 raise (Openapi.Runtime.Api_error { 9024 10942 operation = op_name; 9025 10943 method_ = "POST"; 9026 10944 url; 9027 10945 status = Requests.Response.status_code response; 9028 - body = Requests.Response.text response; 10946 + body; 10947 + parsed_body; 9029 10948 }) 9030 10949 9031 10950 (** Get a user ··· 9046 10965 if Requests.Response.ok response then 9047 10966 Requests.Response.json response 9048 10967 else 10968 + let body = Requests.Response.text response in 10969 + let parsed_body = 10970 + match Jsont_bytesrw.decode_string Jsont.json body with 10971 + | Ok json -> Some (Openapi.Runtime.Json json) 10972 + | Error _ -> Some (Openapi.Runtime.Raw body) 10973 + in 9049 10974 raise (Openapi.Runtime.Api_error { 9050 10975 operation = op_name; 9051 10976 method_ = "GET"; 9052 10977 url; 9053 10978 status = Requests.Response.status_code response; 9054 - body = Requests.Response.text response; 10979 + body; 10980 + parsed_body; 9055 10981 }) 9056 10982 9057 10983 (** Update a user ··· 9071 10997 if Requests.Response.ok response then 9072 10998 Requests.Response.json response 9073 10999 else 11000 + let body = Requests.Response.text response in 11001 + let parsed_body = 11002 + match Jsont_bytesrw.decode_string Jsont.json body with 11003 + | Ok json -> Some (Openapi.Runtime.Json json) 11004 + | Error _ -> Some (Openapi.Runtime.Raw body) 11005 + in 9074 11006 raise (Openapi.Runtime.Api_error { 9075 11007 operation = op_name; 9076 11008 method_ = "PUT"; 9077 11009 url; 9078 11010 status = Requests.Response.status_code response; 9079 - body = Requests.Response.text response; 11011 + body; 11012 + parsed_body; 9080 11013 }) 9081 11014 9082 11015 (** Delete a user ··· 9096 11029 if Requests.Response.ok response then 9097 11030 Requests.Response.json response 9098 11031 else 11032 + let body = Requests.Response.text response in 11033 + let parsed_body = 11034 + match Jsont_bytesrw.decode_string Jsont.json body with 11035 + | Ok json -> Some (Openapi.Runtime.Json json) 11036 + | Error _ -> Some (Openapi.Runtime.Raw body) 11037 + in 9099 11038 raise (Openapi.Runtime.Api_error { 9100 11039 operation = op_name; 9101 11040 method_ = "DELETE"; 9102 11041 url; 9103 11042 status = Requests.Response.status_code response; 9104 - body = Requests.Response.text response; 11043 + body; 11044 + parsed_body; 9105 11045 }) 9106 11046 9107 11047 (** Reset password ··· 9121 11061 if Requests.Response.ok response then 9122 11062 Requests.Response.json response 9123 11063 else 11064 + let body = Requests.Response.text response in 11065 + let parsed_body = 11066 + match Jsont_bytesrw.decode_string Jsont.json body with 11067 + | Ok json -> Some (Openapi.Runtime.Json json) 11068 + | Error _ -> Some (Openapi.Runtime.Raw body) 11069 + in 9124 11070 raise (Openapi.Runtime.Api_error { 9125 11071 operation = op_name; 9126 11072 method_ = "POST"; 9127 11073 url; 9128 11074 status = Requests.Response.status_code response; 9129 - body = Requests.Response.text response; 11075 + body; 11076 + parsed_body; 9130 11077 }) 9131 11078 9132 11079 (** List token sessions ··· 9146 11093 if Requests.Response.ok response then 9147 11094 Requests.Response.json response 9148 11095 else 11096 + let body = Requests.Response.text response in 11097 + let parsed_body = 11098 + match Jsont_bytesrw.decode_string Jsont.json body with 11099 + | Ok json -> Some (Openapi.Runtime.Json json) 11100 + | Error _ -> Some (Openapi.Runtime.Raw body) 11101 + in 9149 11102 raise (Openapi.Runtime.Api_error { 9150 11103 operation = op_name; 9151 11104 method_ = "GET"; 9152 11105 url; 9153 11106 status = Requests.Response.status_code response; 9154 - body = Requests.Response.text response; 11107 + body; 11108 + parsed_body; 9155 11109 }) 9156 11110 9157 11111 (** List token sessions ··· 9172 11126 if Requests.Response.ok response then 9173 11127 Requests.Response.json response 9174 11128 else 11129 + let body = Requests.Response.text response in 11130 + let parsed_body = 11131 + match Jsont_bytesrw.decode_string Jsont.json body with 11132 + | Ok json -> Some (Openapi.Runtime.Json json) 11133 + | Error _ -> Some (Openapi.Runtime.Raw body) 11134 + in 9175 11135 raise (Openapi.Runtime.Api_error { 9176 11136 operation = op_name; 9177 11137 method_ = "GET"; 9178 11138 url; 9179 11139 status = Requests.Response.status_code response; 9180 - body = Requests.Response.text response; 11140 + body; 11141 + parsed_body; 9181 11142 }) 9182 11143 9183 11144 (** Confirm two factor auth ··· 9199 11160 if Requests.Response.ok response then 9200 11161 Requests.Response.json response 9201 11162 else 11163 + let body = Requests.Response.text response in 11164 + let parsed_body = 11165 + match Jsont_bytesrw.decode_string Jsont.json body with 11166 + | Ok json -> Some (Openapi.Runtime.Json json) 11167 + | Error _ -> Some (Openapi.Runtime.Raw body) 11168 + in 9202 11169 raise (Openapi.Runtime.Api_error { 9203 11170 operation = op_name; 9204 11171 method_ = "POST"; 9205 11172 url; 9206 11173 status = Requests.Response.status_code response; 9207 - body = Requests.Response.text response; 11174 + body; 11175 + parsed_body; 9208 11176 }) 9209 11177 9210 11178 (** Disable two factor auth ··· 9226 11194 if Requests.Response.ok response then 9227 11195 Requests.Response.json response 9228 11196 else 11197 + let body = Requests.Response.text response in 11198 + let parsed_body = 11199 + match Jsont_bytesrw.decode_string Jsont.json body with 11200 + | Ok json -> Some (Openapi.Runtime.Json json) 11201 + | Error _ -> Some (Openapi.Runtime.Raw body) 11202 + in 9229 11203 raise (Openapi.Runtime.Api_error { 9230 11204 operation = op_name; 9231 11205 method_ = "POST"; 9232 11206 url; 9233 11207 status = Requests.Response.status_code response; 9234 - body = Requests.Response.text response; 11208 + body; 11209 + parsed_body; 9235 11210 }) 9236 11211 9237 11212 (** Verify a user ··· 9256 11231 if Requests.Response.ok response then 9257 11232 Requests.Response.json response 9258 11233 else 11234 + let body = Requests.Response.text response in 11235 + let parsed_body = 11236 + match Jsont_bytesrw.decode_string Jsont.json body with 11237 + | Ok json -> Some (Openapi.Runtime.Json json) 11238 + | Error _ -> Some (Openapi.Runtime.Raw body) 11239 + in 9259 11240 raise (Openapi.Runtime.Api_error { 9260 11241 operation = op_name; 9261 11242 method_ = "POST"; 9262 11243 url; 9263 11244 status = Requests.Response.status_code response; 9264 - body = Requests.Response.text response; 11245 + body; 11246 + parsed_body; 9265 11247 }) 9266 11248 9267 11249 (** List user exports ··· 9283 11265 if Requests.Response.ok response then 9284 11266 Requests.Response.json response 9285 11267 else 11268 + let body = Requests.Response.text response in 11269 + let parsed_body = 11270 + match Jsont_bytesrw.decode_string Jsont.json body with 11271 + | Ok json -> Some (Openapi.Runtime.Json json) 11272 + | Error _ -> Some (Openapi.Runtime.Raw body) 11273 + in 9286 11274 raise (Openapi.Runtime.Api_error { 9287 11275 operation = op_name; 9288 11276 method_ = "GET"; 9289 11277 url; 9290 11278 status = Requests.Response.status_code response; 9291 - body = Requests.Response.text response; 11279 + body; 11280 + parsed_body; 9292 11281 }) 9293 11282 9294 11283 (** Request user export ··· 9310 11299 if Requests.Response.ok response then 9311 11300 Requests.Response.json response 9312 11301 else 11302 + let body = Requests.Response.text response in 11303 + let parsed_body = 11304 + match Jsont_bytesrw.decode_string Jsont.json body with 11305 + | Ok json -> Some (Openapi.Runtime.Json json) 11306 + | Error _ -> Some (Openapi.Runtime.Raw body) 11307 + in 9313 11308 raise (Openapi.Runtime.Api_error { 9314 11309 operation = op_name; 9315 11310 method_ = "POST"; 9316 11311 url; 9317 11312 status = Requests.Response.status_code response; 9318 - body = Requests.Response.text response; 11313 + body; 11314 + parsed_body; 9319 11315 }) 9320 11316 9321 11317 (** Delete a user export ··· 9338 11334 if Requests.Response.ok response then 9339 11335 Requests.Response.json response 9340 11336 else 11337 + let body = Requests.Response.text response in 11338 + let parsed_body = 11339 + match Jsont_bytesrw.decode_string Jsont.json body with 11340 + | Ok json -> Some (Openapi.Runtime.Json json) 11341 + | Error _ -> Some (Openapi.Runtime.Raw body) 11342 + in 9341 11343 raise (Openapi.Runtime.Api_error { 9342 11344 operation = op_name; 9343 11345 method_ = "DELETE"; 9344 11346 url; 9345 11347 status = Requests.Response.status_code response; 9346 - body = Requests.Response.text response; 11348 + body; 11349 + parsed_body; 9347 11350 }) 9348 11351 9349 11352 (** Initialize the resumable user import ··· 9365 11368 if Requests.Response.ok response then 9366 11369 Requests.Response.json response 9367 11370 else 11371 + let body = Requests.Response.text response in 11372 + let parsed_body = 11373 + match Jsont_bytesrw.decode_string Jsont.json body with 11374 + | Ok json -> Some (Openapi.Runtime.Json json) 11375 + | Error _ -> Some (Openapi.Runtime.Raw body) 11376 + in 9368 11377 raise (Openapi.Runtime.Api_error { 9369 11378 operation = op_name; 9370 11379 method_ = "POST"; 9371 11380 url; 9372 11381 status = Requests.Response.status_code response; 9373 - body = Requests.Response.text response; 11382 + body; 11383 + parsed_body; 9374 11384 }) 9375 11385 9376 11386 (** Send chunk for the resumable user import ··· 9395 11405 if Requests.Response.ok response then 9396 11406 Requests.Response.json response 9397 11407 else 11408 + let body = Requests.Response.text response in 11409 + let parsed_body = 11410 + match Jsont_bytesrw.decode_string Jsont.json body with 11411 + | Ok json -> Some (Openapi.Runtime.Json json) 11412 + | Error _ -> Some (Openapi.Runtime.Raw body) 11413 + in 9398 11414 raise (Openapi.Runtime.Api_error { 9399 11415 operation = op_name; 9400 11416 method_ = "PUT"; 9401 11417 url; 9402 11418 status = Requests.Response.status_code response; 9403 - body = Requests.Response.text response; 11419 + body; 11420 + parsed_body; 9404 11421 }) 9405 11422 9406 11423 (** Cancel the resumable user import ··· 9425 11442 if Requests.Response.ok response then 9426 11443 Requests.Response.json response 9427 11444 else 11445 + let body = Requests.Response.text response in 11446 + let parsed_body = 11447 + match Jsont_bytesrw.decode_string Jsont.json body with 11448 + | Ok json -> Some (Openapi.Runtime.Json json) 11449 + | Error _ -> Some (Openapi.Runtime.Raw body) 11450 + in 9428 11451 raise (Openapi.Runtime.Api_error { 9429 11452 operation = op_name; 9430 11453 method_ = "DELETE"; 9431 11454 url; 9432 11455 status = Requests.Response.status_code response; 9433 - body = Requests.Response.text response; 11456 + body; 11457 + parsed_body; 9434 11458 }) 9435 11459 9436 11460 (** Get latest user import ··· 9452 11476 if Requests.Response.ok response then 9453 11477 Requests.Response.json response 9454 11478 else 11479 + let body = Requests.Response.text response in 11480 + let parsed_body = 11481 + match Jsont_bytesrw.decode_string Jsont.json body with 11482 + | Ok json -> Some (Openapi.Runtime.Json json) 11483 + | Error _ -> Some (Openapi.Runtime.Raw body) 11484 + in 9455 11485 raise (Openapi.Runtime.Api_error { 9456 11486 operation = op_name; 9457 11487 method_ = "GET"; 9458 11488 url; 9459 11489 status = Requests.Response.status_code response; 9460 - body = Requests.Response.text response; 11490 + body; 11491 + parsed_body; 9461 11492 }) 9462 11493 9463 11494 (** Create a synchronization for a video channel *) ··· 9475 11506 if Requests.Response.ok response then 9476 11507 Requests.Response.json response 9477 11508 else 11509 + let body = Requests.Response.text response in 11510 + let parsed_body = 11511 + match Jsont_bytesrw.decode_string Jsont.json body with 11512 + | Ok json -> Some (Openapi.Runtime.Json json) 11513 + | Error _ -> Some (Openapi.Runtime.Raw body) 11514 + in 9478 11515 raise (Openapi.Runtime.Api_error { 9479 11516 operation = op_name; 9480 11517 method_ = "POST"; 9481 11518 url; 9482 11519 status = Requests.Response.status_code response; 9483 - body = Requests.Response.text response; 11520 + body; 11521 + parsed_body; 9484 11522 }) 9485 11523 9486 11524 (** Delete a video channel synchronization ··· 9500 11538 if Requests.Response.ok response then 9501 11539 Requests.Response.json response 9502 11540 else 11541 + let body = Requests.Response.text response in 11542 + let parsed_body = 11543 + match Jsont_bytesrw.decode_string Jsont.json body with 11544 + | Ok json -> Some (Openapi.Runtime.Json json) 11545 + | Error _ -> Some (Openapi.Runtime.Raw body) 11546 + in 9503 11547 raise (Openapi.Runtime.Api_error { 9504 11548 operation = op_name; 9505 11549 method_ = "DELETE"; 9506 11550 url; 9507 11551 status = Requests.Response.status_code response; 9508 - body = Requests.Response.text response; 11552 + body; 11553 + parsed_body; 9509 11554 }) 9510 11555 9511 11556 (** Triggers the channel synchronization job, fetching all the videos from the remote channel ··· 9525 11570 if Requests.Response.ok response then 9526 11571 Requests.Response.json response 9527 11572 else 11573 + let body = Requests.Response.text response in 11574 + let parsed_body = 11575 + match Jsont_bytesrw.decode_string Jsont.json body with 11576 + | Ok json -> Some (Openapi.Runtime.Json json) 11577 + | Error _ -> Some (Openapi.Runtime.Raw body) 11578 + in 9528 11579 raise (Openapi.Runtime.Api_error { 9529 11580 operation = op_name; 9530 11581 method_ = "POST"; 9531 11582 url; 9532 11583 status = Requests.Response.status_code response; 9533 - body = Requests.Response.text response; 11584 + body; 11585 + parsed_body; 9534 11586 }) 9535 11587 9536 11588 (** Create a video channel *) ··· 9548 11600 if Requests.Response.ok response then 9549 11601 Requests.Response.json response 9550 11602 else 11603 + let body = Requests.Response.text response in 11604 + let parsed_body = 11605 + match Jsont_bytesrw.decode_string Jsont.json body with 11606 + | Ok json -> Some (Openapi.Runtime.Json json) 11607 + | Error _ -> Some (Openapi.Runtime.Raw body) 11608 + in 9551 11609 raise (Openapi.Runtime.Api_error { 9552 11610 operation = op_name; 9553 11611 method_ = "POST"; 9554 11612 url; 9555 11613 status = Requests.Response.status_code response; 9556 - body = Requests.Response.text response; 11614 + body; 11615 + parsed_body; 9557 11616 }) 9558 11617 9559 11618 (** Update a video channel ··· 9573 11632 if Requests.Response.ok response then 9574 11633 Requests.Response.json response 9575 11634 else 11635 + let body = Requests.Response.text response in 11636 + let parsed_body = 11637 + match Jsont_bytesrw.decode_string Jsont.json body with 11638 + | Ok json -> Some (Openapi.Runtime.Json json) 11639 + | Error _ -> Some (Openapi.Runtime.Raw body) 11640 + in 9576 11641 raise (Openapi.Runtime.Api_error { 9577 11642 operation = op_name; 9578 11643 method_ = "PUT"; 9579 11644 url; 9580 11645 status = Requests.Response.status_code response; 9581 - body = Requests.Response.text response; 11646 + body; 11647 + parsed_body; 9582 11648 }) 9583 11649 9584 11650 (** Delete a video channel ··· 9598 11664 if Requests.Response.ok response then 9599 11665 Requests.Response.json response 9600 11666 else 11667 + let body = Requests.Response.text response in 11668 + let parsed_body = 11669 + match Jsont_bytesrw.decode_string Jsont.json body with 11670 + | Ok json -> Some (Openapi.Runtime.Json json) 11671 + | Error _ -> Some (Openapi.Runtime.Raw body) 11672 + in 9601 11673 raise (Openapi.Runtime.Api_error { 9602 11674 operation = op_name; 9603 11675 method_ = "DELETE"; 9604 11676 url; 9605 11677 status = Requests.Response.status_code response; 9606 - body = Requests.Response.text response; 11678 + body; 11679 + parsed_body; 9607 11680 }) 9608 11681 9609 11682 (** Delete channel avatar ··· 9623 11696 if Requests.Response.ok response then 9624 11697 Requests.Response.json response 9625 11698 else 11699 + let body = Requests.Response.text response in 11700 + let parsed_body = 11701 + match Jsont_bytesrw.decode_string Jsont.json body with 11702 + | Ok json -> Some (Openapi.Runtime.Json json) 11703 + | Error _ -> Some (Openapi.Runtime.Raw body) 11704 + in 9626 11705 raise (Openapi.Runtime.Api_error { 9627 11706 operation = op_name; 9628 11707 method_ = "DELETE"; 9629 11708 url; 9630 11709 status = Requests.Response.status_code response; 9631 - body = Requests.Response.text response; 11710 + body; 11711 + parsed_body; 9632 11712 }) 9633 11713 9634 11714 (** Update channel avatar ··· 9648 11728 if Requests.Response.ok response then 9649 11729 Requests.Response.json response 9650 11730 else 11731 + let body = Requests.Response.text response in 11732 + let parsed_body = 11733 + match Jsont_bytesrw.decode_string Jsont.json body with 11734 + | Ok json -> Some (Openapi.Runtime.Json json) 11735 + | Error _ -> Some (Openapi.Runtime.Raw body) 11736 + in 9651 11737 raise (Openapi.Runtime.Api_error { 9652 11738 operation = op_name; 9653 11739 method_ = "POST"; 9654 11740 url; 9655 11741 status = Requests.Response.status_code response; 9656 - body = Requests.Response.text response; 11742 + body; 11743 + parsed_body; 9657 11744 }) 9658 11745 9659 11746 (** Delete channel banner ··· 9673 11760 if Requests.Response.ok response then 9674 11761 Requests.Response.json response 9675 11762 else 11763 + let body = Requests.Response.text response in 11764 + let parsed_body = 11765 + match Jsont_bytesrw.decode_string Jsont.json body with 11766 + | Ok json -> Some (Openapi.Runtime.Json json) 11767 + | Error _ -> Some (Openapi.Runtime.Raw body) 11768 + in 9676 11769 raise (Openapi.Runtime.Api_error { 9677 11770 operation = op_name; 9678 11771 method_ = "DELETE"; 9679 11772 url; 9680 11773 status = Requests.Response.status_code response; 9681 - body = Requests.Response.text response; 11774 + body; 11775 + parsed_body; 9682 11776 }) 9683 11777 9684 11778 (** Update channel banner ··· 9698 11792 if Requests.Response.ok response then 9699 11793 Requests.Response.json response 9700 11794 else 11795 + let body = Requests.Response.text response in 11796 + let parsed_body = 11797 + match Jsont_bytesrw.decode_string Jsont.json body with 11798 + | Ok json -> Some (Openapi.Runtime.Json json) 11799 + | Error _ -> Some (Openapi.Runtime.Raw body) 11800 + in 9701 11801 raise (Openapi.Runtime.Api_error { 9702 11802 operation = op_name; 9703 11803 method_ = "POST"; 9704 11804 url; 9705 11805 status = Requests.Response.status_code response; 9706 - body = Requests.Response.text response; 11806 + body; 11807 + parsed_body; 9707 11808 }) 9708 11809 9709 11810 (** *List channel collaborators ··· 9725 11826 if Requests.Response.ok response then 9726 11827 Requests.Response.json response 9727 11828 else 11829 + let body = Requests.Response.text response in 11830 + let parsed_body = 11831 + match Jsont_bytesrw.decode_string Jsont.json body with 11832 + | Ok json -> Some (Openapi.Runtime.Json json) 11833 + | Error _ -> Some (Openapi.Runtime.Raw body) 11834 + in 9728 11835 raise (Openapi.Runtime.Api_error { 9729 11836 operation = op_name; 9730 11837 method_ = "GET"; 9731 11838 url; 9732 11839 status = Requests.Response.status_code response; 9733 - body = Requests.Response.text response; 11840 + body; 11841 + parsed_body; 9734 11842 }) 9735 11843 9736 11844 (** Invite a collaborator ··· 9752 11860 if Requests.Response.ok response then 9753 11861 Requests.Response.json response 9754 11862 else 11863 + let body = Requests.Response.text response in 11864 + let parsed_body = 11865 + match Jsont_bytesrw.decode_string Jsont.json body with 11866 + | Ok json -> Some (Openapi.Runtime.Json json) 11867 + | Error _ -> Some (Openapi.Runtime.Raw body) 11868 + in 9755 11869 raise (Openapi.Runtime.Api_error { 9756 11870 operation = op_name; 9757 11871 method_ = "POST"; 9758 11872 url; 9759 11873 status = Requests.Response.status_code response; 9760 - body = Requests.Response.text response; 11874 + body; 11875 + parsed_body; 9761 11876 }) 9762 11877 9763 11878 (** Remove a channel collaborator ··· 9780 11895 if Requests.Response.ok response then 9781 11896 Requests.Response.json response 9782 11897 else 11898 + let body = Requests.Response.text response in 11899 + let parsed_body = 11900 + match Jsont_bytesrw.decode_string Jsont.json body with 11901 + | Ok json -> Some (Openapi.Runtime.Json json) 11902 + | Error _ -> Some (Openapi.Runtime.Raw body) 11903 + in 9783 11904 raise (Openapi.Runtime.Api_error { 9784 11905 operation = op_name; 9785 11906 method_ = "DELETE"; 9786 11907 url; 9787 11908 status = Requests.Response.status_code response; 9788 - body = Requests.Response.text response; 11909 + body; 11910 + parsed_body; 9789 11911 }) 9790 11912 9791 11913 (** Accept a collaboration invitation ··· 9808 11930 if Requests.Response.ok response then 9809 11931 Requests.Response.json response 9810 11932 else 11933 + let body = Requests.Response.text response in 11934 + let parsed_body = 11935 + match Jsont_bytesrw.decode_string Jsont.json body with 11936 + | Ok json -> Some (Openapi.Runtime.Json json) 11937 + | Error _ -> Some (Openapi.Runtime.Raw body) 11938 + in 9811 11939 raise (Openapi.Runtime.Api_error { 9812 11940 operation = op_name; 9813 11941 method_ = "POST"; 9814 11942 url; 9815 11943 status = Requests.Response.status_code response; 9816 - body = Requests.Response.text response; 11944 + body; 11945 + parsed_body; 9817 11946 }) 9818 11947 9819 11948 (** Reject a collaboration invitation ··· 9836 11965 if Requests.Response.ok response then 9837 11966 Requests.Response.json response 9838 11967 else 11968 + let body = Requests.Response.text response in 11969 + let parsed_body = 11970 + match Jsont_bytesrw.decode_string Jsont.json body with 11971 + | Ok json -> Some (Openapi.Runtime.Json json) 11972 + | Error _ -> Some (Openapi.Runtime.Raw body) 11973 + in 9839 11974 raise (Openapi.Runtime.Api_error { 9840 11975 operation = op_name; 9841 11976 method_ = "POST"; 9842 11977 url; 9843 11978 status = Requests.Response.status_code response; 9844 - body = Requests.Response.text response; 11979 + body; 11980 + parsed_body; 9845 11981 }) 9846 11982 9847 11983 (** List followers of a video channel ··· 9865 12001 if Requests.Response.ok response then 9866 12002 Requests.Response.json response 9867 12003 else 12004 + let body = Requests.Response.text response in 12005 + let parsed_body = 12006 + match Jsont_bytesrw.decode_string Jsont.json body with 12007 + | Ok json -> Some (Openapi.Runtime.Json json) 12008 + | Error _ -> Some (Openapi.Runtime.Raw body) 12009 + in 9868 12010 raise (Openapi.Runtime.Api_error { 9869 12011 operation = op_name; 9870 12012 method_ = "GET"; 9871 12013 url; 9872 12014 status = Requests.Response.status_code response; 9873 - body = Requests.Response.text response; 12015 + body; 12016 + parsed_body; 9874 12017 }) 9875 12018 9876 12019 (** Import videos in channel ··· 9892 12035 if Requests.Response.ok response then 9893 12036 Requests.Response.json response 9894 12037 else 12038 + let body = Requests.Response.text response in 12039 + let parsed_body = 12040 + match Jsont_bytesrw.decode_string Jsont.json body with 12041 + | Ok json -> Some (Openapi.Runtime.Json json) 12042 + | Error _ -> Some (Openapi.Runtime.Raw body) 12043 + in 9895 12044 raise (Openapi.Runtime.Api_error { 9896 12045 operation = op_name; 9897 12046 method_ = "POST"; 9898 12047 url; 9899 12048 status = Requests.Response.status_code response; 9900 - body = Requests.Response.text response; 12049 + body; 12050 + parsed_body; 9901 12051 }) 9902 12052 9903 12053 (** List playlists of a channel ··· 9920 12070 if Requests.Response.ok response then 9921 12071 Requests.Response.json response 9922 12072 else 12073 + let body = Requests.Response.text response in 12074 + let parsed_body = 12075 + match Jsont_bytesrw.decode_string Jsont.json body with 12076 + | Ok json -> Some (Openapi.Runtime.Json json) 12077 + | Error _ -> Some (Openapi.Runtime.Raw body) 12078 + in 9923 12079 raise (Openapi.Runtime.Api_error { 9924 12080 operation = op_name; 9925 12081 method_ = "GET"; 9926 12082 url; 9927 12083 status = Requests.Response.status_code response; 9928 - body = Requests.Response.text response; 12084 + body; 12085 + parsed_body; 9929 12086 }) 9930 12087 9931 12088 (** Reorder channel playlists ··· 9945 12102 if Requests.Response.ok response then 9946 12103 Requests.Response.json response 9947 12104 else 12105 + let body = Requests.Response.text response in 12106 + let parsed_body = 12107 + match Jsont_bytesrw.decode_string Jsont.json body with 12108 + | Ok json -> Some (Openapi.Runtime.Json json) 12109 + | Error _ -> Some (Openapi.Runtime.Raw body) 12110 + in 9948 12111 raise (Openapi.Runtime.Api_error { 9949 12112 operation = op_name; 9950 12113 method_ = "POST"; 9951 12114 url; 9952 12115 status = Requests.Response.status_code response; 9953 - body = Requests.Response.text response; 12116 + body; 12117 + parsed_body; 9954 12118 }) 9955 12119 9956 12120 (** List video playlists ··· 9972 12136 if Requests.Response.ok response then 9973 12137 Requests.Response.json response 9974 12138 else 12139 + let body = Requests.Response.text response in 12140 + let parsed_body = 12141 + match Jsont_bytesrw.decode_string Jsont.json body with 12142 + | Ok json -> Some (Openapi.Runtime.Json json) 12143 + | Error _ -> Some (Openapi.Runtime.Raw body) 12144 + in 9975 12145 raise (Openapi.Runtime.Api_error { 9976 12146 operation = op_name; 9977 12147 method_ = "GET"; 9978 12148 url; 9979 12149 status = Requests.Response.status_code response; 9980 - body = Requests.Response.text response; 12150 + body; 12151 + parsed_body; 9981 12152 }) 9982 12153 9983 12154 (** Create a video playlist ··· 9997 12168 if Requests.Response.ok response then 9998 12169 Requests.Response.json response 9999 12170 else 12171 + let body = Requests.Response.text response in 12172 + let parsed_body = 12173 + match Jsont_bytesrw.decode_string Jsont.json body with 12174 + | Ok json -> Some (Openapi.Runtime.Json json) 12175 + | Error _ -> Some (Openapi.Runtime.Raw body) 12176 + in 10000 12177 raise (Openapi.Runtime.Api_error { 10001 12178 operation = op_name; 10002 12179 method_ = "POST"; 10003 12180 url; 10004 12181 status = Requests.Response.status_code response; 10005 - body = Requests.Response.text response; 12182 + body; 12183 + parsed_body; 10006 12184 }) 10007 12185 10008 12186 (** List available playlist privacy policies *) ··· 10020 12198 if Requests.Response.ok response then 10021 12199 Requests.Response.json response 10022 12200 else 12201 + let body = Requests.Response.text response in 12202 + let parsed_body = 12203 + match Jsont_bytesrw.decode_string Jsont.json body with 12204 + | Ok json -> Some (Openapi.Runtime.Json json) 12205 + | Error _ -> Some (Openapi.Runtime.Raw body) 12206 + in 10023 12207 raise (Openapi.Runtime.Api_error { 10024 12208 operation = op_name; 10025 12209 method_ = "GET"; 10026 12210 url; 10027 12211 status = Requests.Response.status_code response; 10028 - body = Requests.Response.text response; 12212 + body; 12213 + parsed_body; 10029 12214 }) 10030 12215 10031 12216 (** Update a video playlist ··· 10047 12232 if Requests.Response.ok response then 10048 12233 Requests.Response.json response 10049 12234 else 12235 + let body = Requests.Response.text response in 12236 + let parsed_body = 12237 + match Jsont_bytesrw.decode_string Jsont.json body with 12238 + | Ok json -> Some (Openapi.Runtime.Json json) 12239 + | Error _ -> Some (Openapi.Runtime.Raw body) 12240 + in 10050 12241 raise (Openapi.Runtime.Api_error { 10051 12242 operation = op_name; 10052 12243 method_ = "PUT"; 10053 12244 url; 10054 12245 status = Requests.Response.status_code response; 10055 - body = Requests.Response.text response; 12246 + body; 12247 + parsed_body; 10056 12248 }) 10057 12249 10058 12250 (** Delete a video playlist ··· 10072 12264 if Requests.Response.ok response then 10073 12265 Requests.Response.json response 10074 12266 else 12267 + let body = Requests.Response.text response in 12268 + let parsed_body = 12269 + match Jsont_bytesrw.decode_string Jsont.json body with 12270 + | Ok json -> Some (Openapi.Runtime.Json json) 12271 + | Error _ -> Some (Openapi.Runtime.Raw body) 12272 + in 10075 12273 raise (Openapi.Runtime.Api_error { 10076 12274 operation = op_name; 10077 12275 method_ = "DELETE"; 10078 12276 url; 10079 12277 status = Requests.Response.status_code response; 10080 - body = Requests.Response.text response; 12278 + body; 12279 + parsed_body; 10081 12280 }) 10082 12281 10083 12282 (** List videos of a playlist ··· 10099 12298 if Requests.Response.ok response then 10100 12299 Requests.Response.json response 10101 12300 else 12301 + let body = Requests.Response.text response in 12302 + let parsed_body = 12303 + match Jsont_bytesrw.decode_string Jsont.json body with 12304 + | Ok json -> Some (Openapi.Runtime.Json json) 12305 + | Error _ -> Some (Openapi.Runtime.Raw body) 12306 + in 10102 12307 raise (Openapi.Runtime.Api_error { 10103 12308 operation = op_name; 10104 12309 method_ = "GET"; 10105 12310 url; 10106 12311 status = Requests.Response.status_code response; 10107 - body = Requests.Response.text response; 12312 + body; 12313 + parsed_body; 10108 12314 }) 10109 12315 10110 12316 (** Add a video in a playlist ··· 10124 12330 if Requests.Response.ok response then 10125 12331 Requests.Response.json response 10126 12332 else 12333 + let body = Requests.Response.text response in 12334 + let parsed_body = 12335 + match Jsont_bytesrw.decode_string Jsont.json body with 12336 + | Ok json -> Some (Openapi.Runtime.Json json) 12337 + | Error _ -> Some (Openapi.Runtime.Raw body) 12338 + in 10127 12339 raise (Openapi.Runtime.Api_error { 10128 12340 operation = op_name; 10129 12341 method_ = "POST"; 10130 12342 url; 10131 12343 status = Requests.Response.status_code response; 10132 - body = Requests.Response.text response; 12344 + body; 12345 + parsed_body; 10133 12346 }) 10134 12347 10135 12348 (** Reorder playlist elements ··· 10149 12362 if Requests.Response.ok response then 10150 12363 Requests.Response.json response 10151 12364 else 12365 + let body = Requests.Response.text response in 12366 + let parsed_body = 12367 + match Jsont_bytesrw.decode_string Jsont.json body with 12368 + | Ok json -> Some (Openapi.Runtime.Json json) 12369 + | Error _ -> Some (Openapi.Runtime.Raw body) 12370 + in 10152 12371 raise (Openapi.Runtime.Api_error { 10153 12372 operation = op_name; 10154 12373 method_ = "POST"; 10155 12374 url; 10156 12375 status = Requests.Response.status_code response; 10157 - body = Requests.Response.text response; 12376 + body; 12377 + parsed_body; 10158 12378 }) 10159 12379 10160 12380 (** Update a playlist element ··· 10175 12395 if Requests.Response.ok response then 10176 12396 Requests.Response.json response 10177 12397 else 12398 + let body = Requests.Response.text response in 12399 + let parsed_body = 12400 + match Jsont_bytesrw.decode_string Jsont.json body with 12401 + | Ok json -> Some (Openapi.Runtime.Json json) 12402 + | Error _ -> Some (Openapi.Runtime.Raw body) 12403 + in 10178 12404 raise (Openapi.Runtime.Api_error { 10179 12405 operation = op_name; 10180 12406 method_ = "PUT"; 10181 12407 url; 10182 12408 status = Requests.Response.status_code response; 10183 - body = Requests.Response.text response; 12409 + body; 12410 + parsed_body; 10184 12411 }) 10185 12412 10186 12413 (** Delete an element from a playlist ··· 10201 12428 if Requests.Response.ok response then 10202 12429 Requests.Response.json response 10203 12430 else 12431 + let body = Requests.Response.text response in 12432 + let parsed_body = 12433 + match Jsont_bytesrw.decode_string Jsont.json body with 12434 + | Ok json -> Some (Openapi.Runtime.Json json) 12435 + | Error _ -> Some (Openapi.Runtime.Raw body) 12436 + in 10204 12437 raise (Openapi.Runtime.Api_error { 10205 12438 operation = op_name; 10206 12439 method_ = "DELETE"; 10207 12440 url; 10208 12441 status = Requests.Response.status_code response; 10209 - body = Requests.Response.text response; 12442 + body; 12443 + parsed_body; 10210 12444 }) 10211 12445 10212 12446 (** List video blocks ··· 10233 12467 if Requests.Response.ok response then 10234 12468 Requests.Response.json response 10235 12469 else 12470 + let body = Requests.Response.text response in 12471 + let parsed_body = 12472 + match Jsont_bytesrw.decode_string Jsont.json body with 12473 + | Ok json -> Some (Openapi.Runtime.Json json) 12474 + | Error _ -> Some (Openapi.Runtime.Raw body) 12475 + in 10236 12476 raise (Openapi.Runtime.Api_error { 10237 12477 operation = op_name; 10238 12478 method_ = "GET"; 10239 12479 url; 10240 12480 status = Requests.Response.status_code response; 10241 - body = Requests.Response.text response; 12481 + body; 12482 + parsed_body; 10242 12483 }) 10243 12484 10244 12485 (** List available video categories *) ··· 10256 12497 if Requests.Response.ok response then 10257 12498 Requests.Response.json response 10258 12499 else 12500 + let body = Requests.Response.text response in 12501 + let parsed_body = 12502 + match Jsont_bytesrw.decode_string Jsont.json body with 12503 + | Ok json -> Some (Openapi.Runtime.Json json) 12504 + | Error _ -> Some (Openapi.Runtime.Raw body) 12505 + in 10259 12506 raise (Openapi.Runtime.Api_error { 10260 12507 operation = op_name; 10261 12508 method_ = "GET"; 10262 12509 url; 10263 12510 status = Requests.Response.status_code response; 10264 - body = Requests.Response.text response; 12511 + body; 12512 + parsed_body; 10265 12513 }) 10266 12514 10267 12515 (** List instance comments ··· 10288 12536 if Requests.Response.ok response then 10289 12537 Requests.Response.json response 10290 12538 else 12539 + let body = Requests.Response.text response in 12540 + let parsed_body = 12541 + match Jsont_bytesrw.decode_string Jsont.json body with 12542 + | Ok json -> Some (Openapi.Runtime.Json json) 12543 + | Error _ -> Some (Openapi.Runtime.Raw body) 12544 + in 10291 12545 raise (Openapi.Runtime.Api_error { 10292 12546 operation = op_name; 10293 12547 method_ = "GET"; 10294 12548 url; 10295 12549 status = Requests.Response.status_code response; 10296 - body = Requests.Response.text response; 12550 + body; 12551 + parsed_body; 10297 12552 }) 10298 12553 10299 12554 (** Delete video import ··· 10315 12570 if Requests.Response.ok response then 10316 12571 Requests.Response.json response 10317 12572 else 12573 + let body = Requests.Response.text response in 12574 + let parsed_body = 12575 + match Jsont_bytesrw.decode_string Jsont.json body with 12576 + | Ok json -> Some (Openapi.Runtime.Json json) 12577 + | Error _ -> Some (Openapi.Runtime.Raw body) 12578 + in 10318 12579 raise (Openapi.Runtime.Api_error { 10319 12580 operation = op_name; 10320 12581 method_ = "DELETE"; 10321 12582 url; 10322 12583 status = Requests.Response.status_code response; 10323 - body = Requests.Response.text response; 12584 + body; 12585 + parsed_body; 10324 12586 }) 10325 12587 10326 12588 (** Cancel video import ··· 10342 12604 if Requests.Response.ok response then 10343 12605 Requests.Response.json response 10344 12606 else 12607 + let body = Requests.Response.text response in 12608 + let parsed_body = 12609 + match Jsont_bytesrw.decode_string Jsont.json body with 12610 + | Ok json -> Some (Openapi.Runtime.Json json) 12611 + | Error _ -> Some (Openapi.Runtime.Raw body) 12612 + in 10345 12613 raise (Openapi.Runtime.Api_error { 10346 12614 operation = op_name; 10347 12615 method_ = "POST"; 10348 12616 url; 10349 12617 status = Requests.Response.status_code response; 10350 - body = Requests.Response.text response; 12618 + body; 12619 + parsed_body; 10351 12620 }) 10352 12621 10353 12622 (** Retry video import ··· 10369 12638 if Requests.Response.ok response then 10370 12639 Requests.Response.json response 10371 12640 else 12641 + let body = Requests.Response.text response in 12642 + let parsed_body = 12643 + match Jsont_bytesrw.decode_string Jsont.json body with 12644 + | Ok json -> Some (Openapi.Runtime.Json json) 12645 + | Error _ -> Some (Openapi.Runtime.Raw body) 12646 + in 10372 12647 raise (Openapi.Runtime.Api_error { 10373 12648 operation = op_name; 10374 12649 method_ = "POST"; 10375 12650 url; 10376 12651 status = Requests.Response.status_code response; 10377 - body = Requests.Response.text response; 12652 + body; 12653 + parsed_body; 10378 12654 }) 10379 12655 10380 12656 (** List available video languages *) ··· 10392 12668 if Requests.Response.ok response then 10393 12669 Requests.Response.json response 10394 12670 else 12671 + let body = Requests.Response.text response in 12672 + let parsed_body = 12673 + match Jsont_bytesrw.decode_string Jsont.json body with 12674 + | Ok json -> Some (Openapi.Runtime.Json json) 12675 + | Error _ -> Some (Openapi.Runtime.Raw body) 12676 + in 10395 12677 raise (Openapi.Runtime.Api_error { 10396 12678 operation = op_name; 10397 12679 method_ = "GET"; 10398 12680 url; 10399 12681 status = Requests.Response.status_code response; 10400 - body = Requests.Response.text response; 12682 + body; 12683 + parsed_body; 10401 12684 }) 10402 12685 10403 12686 (** List available video licences *) ··· 10415 12698 if Requests.Response.ok response then 10416 12699 Requests.Response.json response 10417 12700 else 12701 + let body = Requests.Response.text response in 12702 + let parsed_body = 12703 + match Jsont_bytesrw.decode_string Jsont.json body with 12704 + | Ok json -> Some (Openapi.Runtime.Json json) 12705 + | Error _ -> Some (Openapi.Runtime.Raw body) 12706 + in 10418 12707 raise (Openapi.Runtime.Api_error { 10419 12708 operation = op_name; 10420 12709 method_ = "GET"; 10421 12710 url; 10422 12711 status = Requests.Response.status_code response; 10423 - body = Requests.Response.text response; 12712 + body; 12713 + parsed_body; 10424 12714 }) 10425 12715 10426 12716 (** Update information about a live ··· 10440 12730 if Requests.Response.ok response then 10441 12731 Requests.Response.json response 10442 12732 else 12733 + let body = Requests.Response.text response in 12734 + let parsed_body = 12735 + match Jsont_bytesrw.decode_string Jsont.json body with 12736 + | Ok json -> Some (Openapi.Runtime.Json json) 12737 + | Error _ -> Some (Openapi.Runtime.Raw body) 12738 + in 10443 12739 raise (Openapi.Runtime.Api_error { 10444 12740 operation = op_name; 10445 12741 method_ = "PUT"; 10446 12742 url; 10447 12743 status = Requests.Response.status_code response; 10448 - body = Requests.Response.text response; 12744 + body; 12745 + parsed_body; 10449 12746 }) 10450 12747 10451 12748 (** List live sessions ··· 10468 12765 if Requests.Response.ok response then 10469 12766 Requests.Response.json response 10470 12767 else 12768 + let body = Requests.Response.text response in 12769 + let parsed_body = 12770 + match Jsont_bytesrw.decode_string Jsont.json body with 12771 + | Ok json -> Some (Openapi.Runtime.Json json) 12772 + | Error _ -> Some (Openapi.Runtime.Raw body) 12773 + in 10471 12774 raise (Openapi.Runtime.Api_error { 10472 12775 operation = op_name; 10473 12776 method_ = "GET"; 10474 12777 url; 10475 12778 status = Requests.Response.status_code response; 10476 - body = Requests.Response.text response; 12779 + body; 12780 + parsed_body; 10477 12781 }) 10478 12782 10479 12783 (** List video ownership changes *) ··· 10491 12795 if Requests.Response.ok response then 10492 12796 Requests.Response.json response 10493 12797 else 12798 + let body = Requests.Response.text response in 12799 + let parsed_body = 12800 + match Jsont_bytesrw.decode_string Jsont.json body with 12801 + | Ok json -> Some (Openapi.Runtime.Json json) 12802 + | Error _ -> Some (Openapi.Runtime.Raw body) 12803 + in 10494 12804 raise (Openapi.Runtime.Api_error { 10495 12805 operation = op_name; 10496 12806 method_ = "GET"; 10497 12807 url; 10498 12808 status = Requests.Response.status_code response; 10499 - body = Requests.Response.text response; 12809 + body; 12810 + parsed_body; 10500 12811 }) 10501 12812 10502 12813 (** Accept ownership change request ··· 10516 12827 if Requests.Response.ok response then 10517 12828 Requests.Response.json response 10518 12829 else 12830 + let body = Requests.Response.text response in 12831 + let parsed_body = 12832 + match Jsont_bytesrw.decode_string Jsont.json body with 12833 + | Ok json -> Some (Openapi.Runtime.Json json) 12834 + | Error _ -> Some (Openapi.Runtime.Raw body) 12835 + in 10519 12836 raise (Openapi.Runtime.Api_error { 10520 12837 operation = op_name; 10521 12838 method_ = "POST"; 10522 12839 url; 10523 12840 status = Requests.Response.status_code response; 10524 - body = Requests.Response.text response; 12841 + body; 12842 + parsed_body; 10525 12843 }) 10526 12844 10527 12845 (** Refuse ownership change request ··· 10541 12859 if Requests.Response.ok response then 10542 12860 Requests.Response.json response 10543 12861 else 12862 + let body = Requests.Response.text response in 12863 + let parsed_body = 12864 + match Jsont_bytesrw.decode_string Jsont.json body with 12865 + | Ok json -> Some (Openapi.Runtime.Json json) 12866 + | Error _ -> Some (Openapi.Runtime.Raw body) 12867 + in 10544 12868 raise (Openapi.Runtime.Api_error { 10545 12869 operation = op_name; 10546 12870 method_ = "POST"; 10547 12871 url; 10548 12872 status = Requests.Response.status_code response; 10549 - body = Requests.Response.text response; 12873 + body; 12874 + parsed_body; 10550 12875 }) 10551 12876 10552 12877 (** List available video privacy policies *) ··· 10564 12889 if Requests.Response.ok response then 10565 12890 Requests.Response.json response 10566 12891 else 12892 + let body = Requests.Response.text response in 12893 + let parsed_body = 12894 + match Jsont_bytesrw.decode_string Jsont.json body with 12895 + | Ok json -> Some (Openapi.Runtime.Json json) 12896 + | Error _ -> Some (Openapi.Runtime.Raw body) 12897 + in 10567 12898 raise (Openapi.Runtime.Api_error { 10568 12899 operation = op_name; 10569 12900 method_ = "GET"; 10570 12901 url; 10571 12902 status = Requests.Response.status_code response; 10572 - body = Requests.Response.text response; 12903 + body; 12904 + parsed_body; 10573 12905 }) 10574 12906 10575 12907 (** Initialize the resumable upload of a video ··· 10589 12921 if Requests.Response.ok response then 10590 12922 Requests.Response.json response 10591 12923 else 12924 + let body = Requests.Response.text response in 12925 + let parsed_body = 12926 + match Jsont_bytesrw.decode_string Jsont.json body with 12927 + | Ok json -> Some (Openapi.Runtime.Json json) 12928 + | Error _ -> Some (Openapi.Runtime.Raw body) 12929 + in 10592 12930 raise (Openapi.Runtime.Api_error { 10593 12931 operation = op_name; 10594 12932 method_ = "POST"; 10595 12933 url; 10596 12934 status = Requests.Response.status_code response; 10597 - body = Requests.Response.text response; 12935 + body; 12936 + parsed_body; 10598 12937 }) 10599 12938 10600 12939 (** Cancel the resumable upload of a video, deleting any data uploaded so far ··· 10618 12957 if Requests.Response.ok response then 10619 12958 Requests.Response.json response 10620 12959 else 12960 + let body = Requests.Response.text response in 12961 + let parsed_body = 12962 + match Jsont_bytesrw.decode_string Jsont.json body with 12963 + | Ok json -> Some (Openapi.Runtime.Json json) 12964 + | Error _ -> Some (Openapi.Runtime.Raw body) 12965 + in 10621 12966 raise (Openapi.Runtime.Api_error { 10622 12967 operation = op_name; 10623 12968 method_ = "DELETE"; 10624 12969 url; 10625 12970 status = Requests.Response.status_code response; 10626 - body = Requests.Response.text response; 12971 + body; 12972 + parsed_body; 10627 12973 }) 10628 12974 10629 12975 (** Update a video ··· 10643 12989 if Requests.Response.ok response then 10644 12990 Requests.Response.json response 10645 12991 else 12992 + let body = Requests.Response.text response in 12993 + let parsed_body = 12994 + match Jsont_bytesrw.decode_string Jsont.json body with 12995 + | Ok json -> Some (Openapi.Runtime.Json json) 12996 + | Error _ -> Some (Openapi.Runtime.Raw body) 12997 + in 10646 12998 raise (Openapi.Runtime.Api_error { 10647 12999 operation = op_name; 10648 13000 method_ = "PUT"; 10649 13001 url; 10650 13002 status = Requests.Response.status_code response; 10651 - body = Requests.Response.text response; 13003 + body; 13004 + parsed_body; 10652 13005 }) 10653 13006 10654 13007 (** Delete a video ··· 10668 13021 if Requests.Response.ok response then 10669 13022 Requests.Response.json response 10670 13023 else 13024 + let body = Requests.Response.text response in 13025 + let parsed_body = 13026 + match Jsont_bytesrw.decode_string Jsont.json body with 13027 + | Ok json -> Some (Openapi.Runtime.Json json) 13028 + | Error _ -> Some (Openapi.Runtime.Raw body) 13029 + in 10671 13030 raise (Openapi.Runtime.Api_error { 10672 13031 operation = op_name; 10673 13032 method_ = "DELETE"; 10674 13033 url; 10675 13034 status = Requests.Response.status_code response; 10676 - body = Requests.Response.text response; 13035 + body; 13036 + parsed_body; 10677 13037 }) 10678 13038 10679 13039 (** Block a video ··· 10693 13053 if Requests.Response.ok response then 10694 13054 Requests.Response.json response 10695 13055 else 13056 + let body = Requests.Response.text response in 13057 + let parsed_body = 13058 + match Jsont_bytesrw.decode_string Jsont.json body with 13059 + | Ok json -> Some (Openapi.Runtime.Json json) 13060 + | Error _ -> Some (Openapi.Runtime.Raw body) 13061 + in 10696 13062 raise (Openapi.Runtime.Api_error { 10697 13063 operation = op_name; 10698 13064 method_ = "POST"; 10699 13065 url; 10700 13066 status = Requests.Response.status_code response; 10701 - body = Requests.Response.text response; 13067 + body; 13068 + parsed_body; 10702 13069 }) 10703 13070 10704 13071 (** Unblock a video by its id ··· 10718 13085 if Requests.Response.ok response then 10719 13086 Requests.Response.json response 10720 13087 else 13088 + let body = Requests.Response.text response in 13089 + let parsed_body = 13090 + match Jsont_bytesrw.decode_string Jsont.json body with 13091 + | Ok json -> Some (Openapi.Runtime.Json json) 13092 + | Error _ -> Some (Openapi.Runtime.Raw body) 13093 + in 10721 13094 raise (Openapi.Runtime.Api_error { 10722 13095 operation = op_name; 10723 13096 method_ = "DELETE"; 10724 13097 url; 10725 13098 status = Requests.Response.status_code response; 10726 - body = Requests.Response.text response; 13099 + body; 13100 + parsed_body; 10727 13101 }) 10728 13102 10729 13103 (** List captions of a video ··· 10743 13117 if Requests.Response.ok response then 10744 13118 Requests.Response.json response 10745 13119 else 13120 + let body = Requests.Response.text response in 13121 + let parsed_body = 13122 + match Jsont_bytesrw.decode_string Jsont.json body with 13123 + | Ok json -> Some (Openapi.Runtime.Json json) 13124 + | Error _ -> Some (Openapi.Runtime.Raw body) 13125 + in 10746 13126 raise (Openapi.Runtime.Api_error { 10747 13127 operation = op_name; 10748 13128 method_ = "GET"; 10749 13129 url; 10750 13130 status = Requests.Response.status_code response; 10751 - body = Requests.Response.text response; 13131 + body; 13132 + parsed_body; 10752 13133 }) 10753 13134 10754 13135 (** Generate a video caption ··· 10770 13151 if Requests.Response.ok response then 10771 13152 Requests.Response.json response 10772 13153 else 13154 + let body = Requests.Response.text response in 13155 + let parsed_body = 13156 + match Jsont_bytesrw.decode_string Jsont.json body with 13157 + | Ok json -> Some (Openapi.Runtime.Json json) 13158 + | Error _ -> Some (Openapi.Runtime.Raw body) 13159 + in 10773 13160 raise (Openapi.Runtime.Api_error { 10774 13161 operation = op_name; 10775 13162 method_ = "POST"; 10776 13163 url; 10777 13164 status = Requests.Response.status_code response; 10778 - body = Requests.Response.text response; 13165 + body; 13166 + parsed_body; 10779 13167 }) 10780 13168 10781 13169 (** Add or replace a video caption ··· 10796 13184 if Requests.Response.ok response then 10797 13185 Requests.Response.json response 10798 13186 else 13187 + let body = Requests.Response.text response in 13188 + let parsed_body = 13189 + match Jsont_bytesrw.decode_string Jsont.json body with 13190 + | Ok json -> Some (Openapi.Runtime.Json json) 13191 + | Error _ -> Some (Openapi.Runtime.Raw body) 13192 + in 10799 13193 raise (Openapi.Runtime.Api_error { 10800 13194 operation = op_name; 10801 13195 method_ = "PUT"; 10802 13196 url; 10803 13197 status = Requests.Response.status_code response; 10804 - body = Requests.Response.text response; 13198 + body; 13199 + parsed_body; 10805 13200 }) 10806 13201 10807 13202 (** Delete a video caption ··· 10822 13217 if Requests.Response.ok response then 10823 13218 Requests.Response.json response 10824 13219 else 13220 + let body = Requests.Response.text response in 13221 + let parsed_body = 13222 + match Jsont_bytesrw.decode_string Jsont.json body with 13223 + | Ok json -> Some (Openapi.Runtime.Json json) 13224 + | Error _ -> Some (Openapi.Runtime.Raw body) 13225 + in 10825 13226 raise (Openapi.Runtime.Api_error { 10826 13227 operation = op_name; 10827 13228 method_ = "DELETE"; 10828 13229 url; 10829 13230 status = Requests.Response.status_code response; 10830 - body = Requests.Response.text response; 13231 + body; 13232 + parsed_body; 10831 13233 }) 10832 13234 10833 13235 (** Replace video chapters ··· 10849 13251 if Requests.Response.ok response then 10850 13252 Requests.Response.json response 10851 13253 else 13254 + let body = Requests.Response.text response in 13255 + let parsed_body = 13256 + match Jsont_bytesrw.decode_string Jsont.json body with 13257 + | Ok json -> Some (Openapi.Runtime.Json json) 13258 + | Error _ -> Some (Openapi.Runtime.Raw body) 13259 + in 10852 13260 raise (Openapi.Runtime.Api_error { 10853 13261 operation = op_name; 10854 13262 method_ = "PUT"; 10855 13263 url; 10856 13264 status = Requests.Response.status_code response; 10857 - body = Requests.Response.text response; 13265 + body; 13266 + parsed_body; 10858 13267 }) 10859 13268 10860 13269 (** Delete a comment or a reply ··· 10875 13284 if Requests.Response.ok response then 10876 13285 Requests.Response.json response 10877 13286 else 13287 + let body = Requests.Response.text response in 13288 + let parsed_body = 13289 + match Jsont_bytesrw.decode_string Jsont.json body with 13290 + | Ok json -> Some (Openapi.Runtime.Json json) 13291 + | Error _ -> Some (Openapi.Runtime.Raw body) 13292 + in 10878 13293 raise (Openapi.Runtime.Api_error { 10879 13294 operation = op_name; 10880 13295 method_ = "DELETE"; 10881 13296 url; 10882 13297 status = Requests.Response.status_code response; 10883 - body = Requests.Response.text response; 13298 + body; 13299 + parsed_body; 10884 13300 }) 10885 13301 10886 13302 (** Approve a comment ··· 10903 13319 if Requests.Response.ok response then 10904 13320 Requests.Response.json response 10905 13321 else 13322 + let body = Requests.Response.text response in 13323 + let parsed_body = 13324 + match Jsont_bytesrw.decode_string Jsont.json body with 13325 + | Ok json -> Some (Openapi.Runtime.Json json) 13326 + | Error _ -> Some (Openapi.Runtime.Raw body) 13327 + in 10906 13328 raise (Openapi.Runtime.Api_error { 10907 13329 operation = op_name; 10908 13330 method_ = "POST"; 10909 13331 url; 10910 13332 status = Requests.Response.status_code response; 10911 - body = Requests.Response.text response; 13333 + body; 13334 + parsed_body; 10912 13335 }) 10913 13336 10914 13337 (** Get complete video description ··· 10928 13351 if Requests.Response.ok response then 10929 13352 Requests.Response.json response 10930 13353 else 13354 + let body = Requests.Response.text response in 13355 + let parsed_body = 13356 + match Jsont_bytesrw.decode_string Jsont.json body with 13357 + | Ok json -> Some (Openapi.Runtime.Json json) 13358 + | Error _ -> Some (Openapi.Runtime.Raw body) 13359 + in 10931 13360 raise (Openapi.Runtime.Api_error { 10932 13361 operation = op_name; 10933 13362 method_ = "GET"; 10934 13363 url; 10935 13364 status = Requests.Response.status_code response; 10936 - body = Requests.Response.text response; 13365 + body; 13366 + parsed_body; 10937 13367 }) 10938 13368 10939 13369 (** Request ownership change ··· 10953 13383 if Requests.Response.ok response then 10954 13384 Requests.Response.json response 10955 13385 else 13386 + let body = Requests.Response.text response in 13387 + let parsed_body = 13388 + match Jsont_bytesrw.decode_string Jsont.json body with 13389 + | Ok json -> Some (Openapi.Runtime.Json json) 13390 + | Error _ -> Some (Openapi.Runtime.Raw body) 13391 + in 10956 13392 raise (Openapi.Runtime.Api_error { 10957 13393 operation = op_name; 10958 13394 method_ = "POST"; 10959 13395 url; 10960 13396 status = Requests.Response.status_code response; 10961 - body = Requests.Response.text response; 13397 + body; 13398 + parsed_body; 10962 13399 }) 10963 13400 10964 13401 (** Delete video HLS files ··· 10978 13415 if Requests.Response.ok response then 10979 13416 Requests.Response.json response 10980 13417 else 13418 + let body = Requests.Response.text response in 13419 + let parsed_body = 13420 + match Jsont_bytesrw.decode_string Jsont.json body with 13421 + | Ok json -> Some (Openapi.Runtime.Json json) 13422 + | Error _ -> Some (Openapi.Runtime.Raw body) 13423 + in 10981 13424 raise (Openapi.Runtime.Api_error { 10982 13425 operation = op_name; 10983 13426 method_ = "DELETE"; 10984 13427 url; 10985 13428 status = Requests.Response.status_code response; 10986 - body = Requests.Response.text response; 13429 + body; 13430 + parsed_body; 10987 13431 }) 10988 13432 10989 13433 (** List video passwords ··· 11008 13452 if Requests.Response.ok response then 11009 13453 Requests.Response.json response 11010 13454 else 13455 + let body = Requests.Response.text response in 13456 + let parsed_body = 13457 + match Jsont_bytesrw.decode_string Jsont.json body with 13458 + | Ok json -> Some (Openapi.Runtime.Json json) 13459 + | Error _ -> Some (Openapi.Runtime.Raw body) 13460 + in 11011 13461 raise (Openapi.Runtime.Api_error { 11012 13462 operation = op_name; 11013 13463 method_ = "GET"; 11014 13464 url; 11015 13465 status = Requests.Response.status_code response; 11016 - body = Requests.Response.text response; 13466 + body; 13467 + parsed_body; 11017 13468 }) 11018 13469 11019 13470 (** Add a video password ··· 11035 13486 if Requests.Response.ok response then 11036 13487 Requests.Response.json response 11037 13488 else 13489 + let body = Requests.Response.text response in 13490 + let parsed_body = 13491 + match Jsont_bytesrw.decode_string Jsont.json body with 13492 + | Ok json -> Some (Openapi.Runtime.Json json) 13493 + | Error _ -> Some (Openapi.Runtime.Raw body) 13494 + in 11038 13495 raise (Openapi.Runtime.Api_error { 11039 13496 operation = op_name; 11040 13497 method_ = "POST"; 11041 13498 url; 11042 13499 status = Requests.Response.status_code response; 11043 - body = Requests.Response.text response; 13500 + body; 13501 + parsed_body; 11044 13502 }) 11045 13503 11046 13504 (** Update video passwords ··· 11062 13520 if Requests.Response.ok response then 11063 13521 Requests.Response.json response 11064 13522 else 13523 + let body = Requests.Response.text response in 13524 + let parsed_body = 13525 + match Jsont_bytesrw.decode_string Jsont.json body with 13526 + | Ok json -> Some (Openapi.Runtime.Json json) 13527 + | Error _ -> Some (Openapi.Runtime.Raw body) 13528 + in 11065 13529 raise (Openapi.Runtime.Api_error { 11066 13530 operation = op_name; 11067 13531 method_ = "PUT"; 11068 13532 url; 11069 13533 status = Requests.Response.status_code response; 11070 - body = Requests.Response.text response; 13534 + body; 13535 + parsed_body; 11071 13536 }) 11072 13537 11073 13538 (** Delete a video password ··· 11090 13555 if Requests.Response.ok response then 11091 13556 Requests.Response.json response 11092 13557 else 13558 + let body = Requests.Response.text response in 13559 + let parsed_body = 13560 + match Jsont_bytesrw.decode_string Jsont.json body with 13561 + | Ok json -> Some (Openapi.Runtime.Json json) 13562 + | Error _ -> Some (Openapi.Runtime.Raw body) 13563 + in 11093 13564 raise (Openapi.Runtime.Api_error { 11094 13565 operation = op_name; 11095 13566 method_ = "DELETE"; 11096 13567 url; 11097 13568 status = Requests.Response.status_code response; 11098 - body = Requests.Response.text response; 13569 + body; 13570 + parsed_body; 11099 13571 }) 11100 13572 11101 13573 (** Like/dislike a video ··· 11115 13587 if Requests.Response.ok response then 11116 13588 Requests.Response.json response 11117 13589 else 13590 + let body = Requests.Response.text response in 13591 + let parsed_body = 13592 + match Jsont_bytesrw.decode_string Jsont.json body with 13593 + | Ok json -> Some (Openapi.Runtime.Json json) 13594 + | Error _ -> Some (Openapi.Runtime.Raw body) 13595 + in 11118 13596 raise (Openapi.Runtime.Api_error { 11119 13597 operation = op_name; 11120 13598 method_ = "PUT"; 11121 13599 url; 11122 13600 status = Requests.Response.status_code response; 11123 - body = Requests.Response.text response; 13601 + body; 13602 + parsed_body; 11124 13603 }) 11125 13604 11126 13605 (** Delete video source file ··· 11140 13619 if Requests.Response.ok response then 11141 13620 Requests.Response.json response 11142 13621 else 13622 + let body = Requests.Response.text response in 13623 + let parsed_body = 13624 + match Jsont_bytesrw.decode_string Jsont.json body with 13625 + | Ok json -> Some (Openapi.Runtime.Json json) 13626 + | Error _ -> Some (Openapi.Runtime.Raw body) 13627 + in 11143 13628 raise (Openapi.Runtime.Api_error { 11144 13629 operation = op_name; 11145 13630 method_ = "DELETE"; 11146 13631 url; 11147 13632 status = Requests.Response.status_code response; 11148 - body = Requests.Response.text response; 13633 + body; 13634 + parsed_body; 11149 13635 }) 11150 13636 11151 13637 (** Initialize the resumable replacement of a video ··· 11167 13653 if Requests.Response.ok response then 11168 13654 Requests.Response.json response 11169 13655 else 13656 + let body = Requests.Response.text response in 13657 + let parsed_body = 13658 + match Jsont_bytesrw.decode_string Jsont.json body with 13659 + | Ok json -> Some (Openapi.Runtime.Json json) 13660 + | Error _ -> Some (Openapi.Runtime.Raw body) 13661 + in 11170 13662 raise (Openapi.Runtime.Api_error { 11171 13663 operation = op_name; 11172 13664 method_ = "POST"; 11173 13665 url; 11174 13666 status = Requests.Response.status_code response; 11175 - body = Requests.Response.text response; 13667 + body; 13668 + parsed_body; 11176 13669 }) 11177 13670 11178 13671 (** Send chunk for the resumable replacement of a video ··· 11197 13690 if Requests.Response.ok response then 11198 13691 Requests.Response.json response 11199 13692 else 13693 + let body = Requests.Response.text response in 13694 + let parsed_body = 13695 + match Jsont_bytesrw.decode_string Jsont.json body with 13696 + | Ok json -> Some (Openapi.Runtime.Json json) 13697 + | Error _ -> Some (Openapi.Runtime.Raw body) 13698 + in 11200 13699 raise (Openapi.Runtime.Api_error { 11201 13700 operation = op_name; 11202 13701 method_ = "PUT"; 11203 13702 url; 11204 13703 status = Requests.Response.status_code response; 11205 - body = Requests.Response.text response; 13704 + body; 13705 + parsed_body; 11206 13706 }) 11207 13707 11208 13708 (** Cancel the resumable replacement of a video ··· 11227 13727 if Requests.Response.ok response then 11228 13728 Requests.Response.json response 11229 13729 else 13730 + let body = Requests.Response.text response in 13731 + let parsed_body = 13732 + match Jsont_bytesrw.decode_string Jsont.json body with 13733 + | Ok json -> Some (Openapi.Runtime.Json json) 13734 + | Error _ -> Some (Openapi.Runtime.Raw body) 13735 + in 11230 13736 raise (Openapi.Runtime.Api_error { 11231 13737 operation = op_name; 11232 13738 method_ = "DELETE"; 11233 13739 url; 11234 13740 status = Requests.Response.status_code response; 11235 - body = Requests.Response.text response; 13741 + body; 13742 + parsed_body; 11236 13743 }) 11237 13744 11238 13745 (** List storyboards of a video ··· 11254 13761 if Requests.Response.ok response then 11255 13762 Requests.Response.json response 11256 13763 else 13764 + let body = Requests.Response.text response in 13765 + let parsed_body = 13766 + match Jsont_bytesrw.decode_string Jsont.json body with 13767 + | Ok json -> Some (Openapi.Runtime.Json json) 13768 + | Error _ -> Some (Openapi.Runtime.Raw body) 13769 + in 11257 13770 raise (Openapi.Runtime.Api_error { 11258 13771 operation = op_name; 11259 13772 method_ = "GET"; 11260 13773 url; 11261 13774 status = Requests.Response.status_code response; 11262 - body = Requests.Response.text response; 13775 + body; 13776 + parsed_body; 11263 13777 }) 11264 13778 11265 13779 (** Create a studio task ··· 11281 13795 if Requests.Response.ok response then 11282 13796 Requests.Response.json response 11283 13797 else 13798 + let body = Requests.Response.text response in 13799 + let parsed_body = 13800 + match Jsont_bytesrw.decode_string Jsont.json body with 13801 + | Ok json -> Some (Openapi.Runtime.Json json) 13802 + | Error _ -> Some (Openapi.Runtime.Raw body) 13803 + in 11284 13804 raise (Openapi.Runtime.Api_error { 11285 13805 operation = op_name; 11286 13806 method_ = "POST"; 11287 13807 url; 11288 13808 status = Requests.Response.status_code response; 11289 - body = Requests.Response.text response; 13809 + body; 13810 + parsed_body; 11290 13811 }) 11291 13812 11292 13813 (** Create a transcoding job ··· 11306 13827 if Requests.Response.ok response then 11307 13828 Requests.Response.json response 11308 13829 else 13830 + let body = Requests.Response.text response in 13831 + let parsed_body = 13832 + match Jsont_bytesrw.decode_string Jsont.json body with 13833 + | Ok json -> Some (Openapi.Runtime.Json json) 13834 + | Error _ -> Some (Openapi.Runtime.Raw body) 13835 + in 11309 13836 raise (Openapi.Runtime.Api_error { 11310 13837 operation = op_name; 11311 13838 method_ = "POST"; 11312 13839 url; 11313 13840 status = Requests.Response.status_code response; 11314 - body = Requests.Response.text response; 13841 + body; 13842 + parsed_body; 11315 13843 }) 11316 13844 11317 13845 (** Notify user is watching a video ··· 11333 13861 if Requests.Response.ok response then 11334 13862 Requests.Response.json response 11335 13863 else 13864 + let body = Requests.Response.text response in 13865 + let parsed_body = 13866 + match Jsont_bytesrw.decode_string Jsont.json body with 13867 + | Ok json -> Some (Openapi.Runtime.Json json) 13868 + | Error _ -> Some (Openapi.Runtime.Raw body) 13869 + in 11336 13870 raise (Openapi.Runtime.Api_error { 11337 13871 operation = op_name; 11338 13872 method_ = "POST"; 11339 13873 url; 11340 13874 status = Requests.Response.status_code response; 11341 - body = Requests.Response.text response; 13875 + body; 13876 + parsed_body; 11342 13877 }) 11343 13878 11344 13879 (** Delete video Web Video files ··· 11360 13895 if Requests.Response.ok response then 11361 13896 Requests.Response.json response 11362 13897 else 13898 + let body = Requests.Response.text response in 13899 + let parsed_body = 13900 + match Jsont_bytesrw.decode_string Jsont.json body with 13901 + | Ok json -> Some (Openapi.Runtime.Json json) 13902 + | Error _ -> Some (Openapi.Runtime.Raw body) 13903 + in 11363 13904 raise (Openapi.Runtime.Api_error { 11364 13905 operation = op_name; 11365 13906 method_ = "DELETE"; 11366 13907 url; 11367 13908 status = Requests.Response.status_code response; 11368 - body = Requests.Response.text response; 13909 + body; 13910 + parsed_body; 11369 13911 }) 11370 13912 11371 13913 (** List account watched words ··· 11387 13929 if Requests.Response.ok response then 11388 13930 Requests.Response.json response 11389 13931 else 13932 + let body = Requests.Response.text response in 13933 + let parsed_body = 13934 + match Jsont_bytesrw.decode_string Jsont.json body with 13935 + | Ok json -> Some (Openapi.Runtime.Json json) 13936 + | Error _ -> Some (Openapi.Runtime.Raw body) 13937 + in 11390 13938 raise (Openapi.Runtime.Api_error { 11391 13939 operation = op_name; 11392 13940 method_ = "GET"; 11393 13941 url; 11394 13942 status = Requests.Response.status_code response; 11395 - body = Requests.Response.text response; 13943 + body; 13944 + parsed_body; 11396 13945 }) 11397 13946 11398 13947 (** Add account watched words ··· 11412 13961 if Requests.Response.ok response then 11413 13962 Requests.Response.json response 11414 13963 else 13964 + let body = Requests.Response.text response in 13965 + let parsed_body = 13966 + match Jsont_bytesrw.decode_string Jsont.json body with 13967 + | Ok json -> Some (Openapi.Runtime.Json json) 13968 + | Error _ -> Some (Openapi.Runtime.Raw body) 13969 + in 11415 13970 raise (Openapi.Runtime.Api_error { 11416 13971 operation = op_name; 11417 13972 method_ = "POST"; 11418 13973 url; 11419 13974 status = Requests.Response.status_code response; 11420 - body = Requests.Response.text response; 13975 + body; 13976 + parsed_body; 11421 13977 }) 11422 13978 11423 13979 (** Update account watched words ··· 11439 13995 if Requests.Response.ok response then 11440 13996 Requests.Response.json response 11441 13997 else 13998 + let body = Requests.Response.text response in 13999 + let parsed_body = 14000 + match Jsont_bytesrw.decode_string Jsont.json body with 14001 + | Ok json -> Some (Openapi.Runtime.Json json) 14002 + | Error _ -> Some (Openapi.Runtime.Raw body) 14003 + in 11442 14004 raise (Openapi.Runtime.Api_error { 11443 14005 operation = op_name; 11444 14006 method_ = "PUT"; 11445 14007 url; 11446 14008 status = Requests.Response.status_code response; 11447 - body = Requests.Response.text response; 14009 + body; 14010 + parsed_body; 11448 14011 }) 11449 14012 11450 14013 (** Delete account watched words ··· 11466 14029 if Requests.Response.ok response then 11467 14030 Requests.Response.json response 11468 14031 else 14032 + let body = Requests.Response.text response in 14033 + let parsed_body = 14034 + match Jsont_bytesrw.decode_string Jsont.json body with 14035 + | Ok json -> Some (Openapi.Runtime.Json json) 14036 + | Error _ -> Some (Openapi.Runtime.Raw body) 14037 + in 11469 14038 raise (Openapi.Runtime.Api_error { 11470 14039 operation = op_name; 11471 14040 method_ = "DELETE"; 11472 14041 url; 11473 14042 status = Requests.Response.status_code response; 11474 - body = Requests.Response.text response; 14043 + body; 14044 + parsed_body; 11475 14045 }) 11476 14046 11477 14047 (** List server watched words ··· 11491 14061 if Requests.Response.ok response then 11492 14062 Requests.Response.json response 11493 14063 else 14064 + let body = Requests.Response.text response in 14065 + let parsed_body = 14066 + match Jsont_bytesrw.decode_string Jsont.json body with 14067 + | Ok json -> Some (Openapi.Runtime.Json json) 14068 + | Error _ -> Some (Openapi.Runtime.Raw body) 14069 + in 11494 14070 raise (Openapi.Runtime.Api_error { 11495 14071 operation = op_name; 11496 14072 method_ = "GET"; 11497 14073 url; 11498 14074 status = Requests.Response.status_code response; 11499 - body = Requests.Response.text response; 14075 + body; 14076 + parsed_body; 11500 14077 }) 11501 14078 11502 14079 (** Add server watched words ··· 11516 14093 if Requests.Response.ok response then 11517 14094 Requests.Response.json response 11518 14095 else 14096 + let body = Requests.Response.text response in 14097 + let parsed_body = 14098 + match Jsont_bytesrw.decode_string Jsont.json body with 14099 + | Ok json -> Some (Openapi.Runtime.Json json) 14100 + | Error _ -> Some (Openapi.Runtime.Raw body) 14101 + in 11519 14102 raise (Openapi.Runtime.Api_error { 11520 14103 operation = op_name; 11521 14104 method_ = "POST"; 11522 14105 url; 11523 14106 status = Requests.Response.status_code response; 11524 - body = Requests.Response.text response; 14107 + body; 14108 + parsed_body; 11525 14109 }) 11526 14110 11527 14111 (** Update server watched words ··· 11543 14127 if Requests.Response.ok response then 11544 14128 Requests.Response.json response 11545 14129 else 14130 + let body = Requests.Response.text response in 14131 + let parsed_body = 14132 + match Jsont_bytesrw.decode_string Jsont.json body with 14133 + | Ok json -> Some (Openapi.Runtime.Json json) 14134 + | Error _ -> Some (Openapi.Runtime.Raw body) 14135 + in 11546 14136 raise (Openapi.Runtime.Api_error { 11547 14137 operation = op_name; 11548 14138 method_ = "PUT"; 11549 14139 url; 11550 14140 status = Requests.Response.status_code response; 11551 - body = Requests.Response.text response; 14141 + body; 14142 + parsed_body; 11552 14143 }) 11553 14144 11554 14145 (** Delete server watched words ··· 11570 14161 if Requests.Response.ok response then 11571 14162 Requests.Response.json response 11572 14163 else 14164 + let body = Requests.Response.text response in 14165 + let parsed_body = 14166 + match Jsont_bytesrw.decode_string Jsont.json body with 14167 + | Ok json -> Some (Openapi.Runtime.Json json) 14168 + | Error _ -> Some (Openapi.Runtime.Raw body) 14169 + in 11573 14170 raise (Openapi.Runtime.Api_error { 11574 14171 operation = op_name; 11575 14172 method_ = "DELETE"; 11576 14173 url; 11577 14174 status = Requests.Response.status_code response; 11578 - body = Requests.Response.text response; 14175 + body; 14176 + parsed_body; 11579 14177 }) 11580 14178 11581 14179 (** Download video file ··· 11599 14197 if Requests.Response.ok response then 11600 14198 Requests.Response.json response 11601 14199 else 14200 + let body = Requests.Response.text response in 14201 + let parsed_body = 14202 + match Jsont_bytesrw.decode_string Jsont.json body with 14203 + | Ok json -> Some (Openapi.Runtime.Json json) 14204 + | Error _ -> Some (Openapi.Runtime.Raw body) 14205 + in 11602 14206 raise (Openapi.Runtime.Api_error { 11603 14207 operation = op_name; 11604 14208 method_ = "GET"; 11605 14209 url; 11606 14210 status = Requests.Response.status_code response; 11607 - body = Requests.Response.text response; 14211 + body; 14212 + parsed_body; 11608 14213 }) 11609 14214 11610 14215 (** Videos podcast feed ··· 11624 14229 if Requests.Response.ok response then 11625 14230 Requests.Response.json response 11626 14231 else 14232 + let body = Requests.Response.text response in 14233 + let parsed_body = 14234 + match Jsont_bytesrw.decode_string Jsont.json body with 14235 + | Ok json -> Some (Openapi.Runtime.Json json) 14236 + | Error _ -> Some (Openapi.Runtime.Raw body) 14237 + in 11627 14238 raise (Openapi.Runtime.Api_error { 11628 14239 operation = op_name; 11629 14240 method_ = "GET"; 11630 14241 url; 11631 14242 status = Requests.Response.status_code response; 11632 - body = Requests.Response.text response; 14243 + body; 14244 + parsed_body; 11633 14245 }) 11634 14246 11635 14247 (** Videos of subscriptions feeds ··· 11668 14280 if Requests.Response.ok response then 11669 14281 Requests.Response.json response 11670 14282 else 14283 + let body = Requests.Response.text response in 14284 + let parsed_body = 14285 + match Jsont_bytesrw.decode_string Jsont.json body with 14286 + | Ok json -> Some (Openapi.Runtime.Json json) 14287 + | Error _ -> Some (Openapi.Runtime.Raw body) 14288 + in 11671 14289 raise (Openapi.Runtime.Api_error { 11672 14290 operation = op_name; 11673 14291 method_ = "GET"; 11674 14292 url; 11675 14293 status = Requests.Response.status_code response; 11676 - body = Requests.Response.text response; 14294 + body; 14295 + parsed_body; 11677 14296 }) 11678 14297 11679 14298 (** Comments on videos feeds ··· 11698 14317 if Requests.Response.ok response then 11699 14318 Requests.Response.json response 11700 14319 else 14320 + let body = Requests.Response.text response in 14321 + let parsed_body = 14322 + match Jsont_bytesrw.decode_string Jsont.json body with 14323 + | Ok json -> Some (Openapi.Runtime.Json json) 14324 + | Error _ -> Some (Openapi.Runtime.Raw body) 14325 + in 11701 14326 raise (Openapi.Runtime.Api_error { 11702 14327 operation = op_name; 11703 14328 method_ = "GET"; 11704 14329 url; 11705 14330 status = Requests.Response.status_code response; 11706 - body = Requests.Response.text response; 14331 + body; 14332 + parsed_body; 11707 14333 }) 11708 14334 11709 14335 (** Common videos feeds ··· 11744 14370 if Requests.Response.ok response then 11745 14371 Requests.Response.json response 11746 14372 else 14373 + let body = Requests.Response.text response in 14374 + let parsed_body = 14375 + match Jsont_bytesrw.decode_string Jsont.json body with 14376 + | Ok json -> Some (Openapi.Runtime.Json json) 14377 + | Error _ -> Some (Openapi.Runtime.Raw body) 14378 + in 11747 14379 raise (Openapi.Runtime.Api_error { 11748 14380 operation = op_name; 11749 14381 method_ = "GET"; 11750 14382 url; 11751 14383 status = Requests.Response.status_code response; 11752 - body = Requests.Response.text response; 14384 + body; 14385 + parsed_body; 11753 14386 }) 11754 14387 11755 14388 (** Get private HLS video file ··· 11771 14404 if Requests.Response.ok response then 11772 14405 Requests.Response.json response 11773 14406 else 14407 + let body = Requests.Response.text response in 14408 + let parsed_body = 14409 + match Jsont_bytesrw.decode_string Jsont.json body with 14410 + | Ok json -> Some (Openapi.Runtime.Json json) 14411 + | Error _ -> Some (Openapi.Runtime.Raw body) 14412 + in 11774 14413 raise (Openapi.Runtime.Api_error { 11775 14414 operation = op_name; 11776 14415 method_ = "GET"; 11777 14416 url; 11778 14417 status = Requests.Response.status_code response; 11779 - body = Requests.Response.text response; 14418 + body; 14419 + parsed_body; 11780 14420 }) 11781 14421 11782 14422 (** Get public HLS video file ··· 11796 14436 if Requests.Response.ok response then 11797 14437 Requests.Response.json response 11798 14438 else 14439 + let body = Requests.Response.text response in 14440 + let parsed_body = 14441 + match Jsont_bytesrw.decode_string Jsont.json body with 14442 + | Ok json -> Some (Openapi.Runtime.Json json) 14443 + | Error _ -> Some (Openapi.Runtime.Raw body) 14444 + in 11799 14445 raise (Openapi.Runtime.Api_error { 11800 14446 operation = op_name; 11801 14447 method_ = "GET"; 11802 14448 url; 11803 14449 status = Requests.Response.status_code response; 11804 - body = Requests.Response.text response; 14450 + body; 14451 + parsed_body; 11805 14452 }) 11806 14453 11807 14454 (** Get private Web Video file ··· 11824 14471 if Requests.Response.ok response then 11825 14472 Requests.Response.json response 11826 14473 else 14474 + let body = Requests.Response.text response in 14475 + let parsed_body = 14476 + match Jsont_bytesrw.decode_string Jsont.json body with 14477 + | Ok json -> Some (Openapi.Runtime.Json json) 14478 + | Error _ -> Some (Openapi.Runtime.Raw body) 14479 + in 11827 14480 raise (Openapi.Runtime.Api_error { 11828 14481 operation = op_name; 11829 14482 method_ = "GET"; 11830 14483 url; 11831 14484 status = Requests.Response.status_code response; 11832 - body = Requests.Response.text response; 14485 + body; 14486 + parsed_body; 11833 14487 }) 11834 14488 11835 14489 (** Get public Web Video file ··· 11851 14505 if Requests.Response.ok response then 11852 14506 Requests.Response.json response 11853 14507 else 14508 + let body = Requests.Response.text response in 14509 + let parsed_body = 14510 + match Jsont_bytesrw.decode_string Jsont.json body with 14511 + | Ok json -> Some (Openapi.Runtime.Json json) 14512 + | Error _ -> Some (Openapi.Runtime.Raw body) 14513 + in 11854 14514 raise (Openapi.Runtime.Api_error { 11855 14515 operation = op_name; 11856 14516 method_ = "GET"; 11857 14517 url; 11858 14518 status = Requests.Response.status_code response; 11859 - body = Requests.Response.text response; 14519 + body; 14520 + parsed_body; 11860 14521 }) 11861 14522 end 11862 14523 11863 14524 module VideoChannelList = struct 14525 + module Types = struct 14526 + module T = struct 14527 + type t = { 14528 + data : VideoChannel.T.t list option; 14529 + total : int option; 14530 + } 14531 + end 14532 + end 14533 + 11864 14534 module T = struct 11865 - type t = { 11866 - data : VideoChannel.T.t list option; 11867 - total : int option; 11868 - } 14535 + include Types.T 11869 14536 11870 14537 let v ?data ?total () = { data; total } 11871 14538 ··· 11904 14571 if Requests.Response.ok response then 11905 14572 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 11906 14573 else 14574 + let body = Requests.Response.text response in 14575 + let parsed_body = 14576 + match Jsont_bytesrw.decode_string Jsont.json body with 14577 + | Ok json -> Some (Openapi.Runtime.Json json) 14578 + | Error _ -> Some (Openapi.Runtime.Raw body) 14579 + in 11907 14580 raise (Openapi.Runtime.Api_error { 11908 14581 operation = op_name; 11909 14582 method_ = "GET"; 11910 14583 url; 11911 14584 status = Requests.Response.status_code response; 11912 - body = Requests.Response.text response; 14585 + body; 14586 + parsed_body; 11913 14587 }) 11914 14588 11915 14589 (** Search channels ··· 11944 14618 if Requests.Response.ok response then 11945 14619 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 11946 14620 else 14621 + let body = Requests.Response.text response in 14622 + let parsed_body = 14623 + match Jsont_bytesrw.decode_string Jsont.json body with 14624 + | Ok json -> Some (Openapi.Runtime.Json json) 14625 + | Error _ -> Some (Openapi.Runtime.Raw body) 14626 + in 11947 14627 raise (Openapi.Runtime.Api_error { 11948 14628 operation = op_name; 11949 14629 method_ = "GET"; 11950 14630 url; 11951 14631 status = Requests.Response.status_code response; 11952 - body = Requests.Response.text response; 14632 + body; 14633 + parsed_body; 11953 14634 }) 11954 14635 11955 14636 (** List my user subscriptions ··· 11970 14651 if Requests.Response.ok response then 11971 14652 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 11972 14653 else 14654 + let body = Requests.Response.text response in 14655 + let parsed_body = 14656 + match Jsont_bytesrw.decode_string Jsont.json body with 14657 + | Ok json -> Some (Openapi.Runtime.Json json) 14658 + | Error _ -> Some (Openapi.Runtime.Raw body) 14659 + in 11973 14660 raise (Openapi.Runtime.Api_error { 11974 14661 operation = op_name; 11975 14662 method_ = "GET"; 11976 14663 url; 11977 14664 status = Requests.Response.status_code response; 11978 - body = Requests.Response.text response; 14665 + body; 14666 + parsed_body; 11979 14667 }) 11980 14668 11981 14669 (** List video channels ··· 11997 14685 if Requests.Response.ok response then 11998 14686 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 11999 14687 else 14688 + let body = Requests.Response.text response in 14689 + let parsed_body = 14690 + match Jsont_bytesrw.decode_string Jsont.json body with 14691 + | Ok json -> Some (Openapi.Runtime.Json json) 14692 + | Error _ -> Some (Openapi.Runtime.Raw body) 14693 + in 12000 14694 raise (Openapi.Runtime.Api_error { 12001 14695 operation = op_name; 12002 14696 method_ = "GET"; 12003 14697 url; 12004 14698 status = Requests.Response.status_code response; 12005 - body = Requests.Response.text response; 14699 + body; 14700 + parsed_body; 12006 14701 }) 12007 14702 end 12008 14703 12009 14704 module UserWithStats = struct 14705 + module Types = struct 14706 + module T = struct 14707 + type t = { 14708 + account : Account.T.t option; 14709 + admin_flags : UserAdminFlags.T.t option; 14710 + auto_play_next_video : bool option; (** Automatically start playing the upcoming video after the currently playing video *) 14711 + auto_play_next_video_playlist : bool option; (** Automatically start playing the video on the playlist after the currently playing video *) 14712 + auto_play_video : bool option; (** Automatically start playing the video on the watch page *) 14713 + blocked : bool option; 14714 + blocked_reason : string option; 14715 + created_at : string option; 14716 + email : string option; (** The user email *) 14717 + email_public : bool option; (** Has the user accepted to display the email publicly? *) 14718 + email_verified : bool option; (** Has the user confirmed their email address? *) 14719 + id : Id.T.t option; 14720 + language : string option; (** default language for this user *) 14721 + last_login_date : Ptime.t option; 14722 + new_features_info_read : float option; (** New features information the user has read *) 14723 + no_account_setup_warning_modal : bool option; 14724 + no_instance_config_warning_modal : bool option; 14725 + no_welcome_modal : bool option; 14726 + notification_settings : UserNotificationSettings.T.t option; 14727 + nsfw_flags_blurred : Nsfwflag.T.t option; 14728 + nsfw_flags_displayed : Nsfwflag.T.t option; 14729 + nsfw_flags_hidden : Nsfwflag.T.t option; 14730 + nsfw_flags_warned : Nsfwflag.T.t option; 14731 + nsfw_policy : Nsfwpolicy.T.t option; 14732 + p2p_enabled : bool option; (** whether to enable P2P in the player or not *) 14733 + plugin_auth : string option; (** Auth plugin to use to authenticate the user *) 14734 + role : Jsont.json option; 14735 + theme : string option; (** Theme enabled by this user *) 14736 + two_factor_enabled : bool option; (** Whether the user has enabled two-factor authentication or not *) 14737 + username : Username.T.t option; 14738 + video_channels : VideoChannel.T.t list option; 14739 + video_languages : string list option; (** list of languages to filter videos down to *) 14740 + video_quota : int option; (** The user video quota in bytes *) 14741 + video_quota_daily : int option; (** The user daily video quota in bytes *) 14742 + videos_history_enabled : bool option; (** whether to keep track of watched history or not *) 14743 + videos_count : int option; (** Count of videos published *) 14744 + abuses_count : int option; (** Count of reports/abuses of which the user is a target *) 14745 + abuses_accepted_count : int option; (** Count of reports/abuses created by the user and accepted/acted upon by the moderation team *) 14746 + abuses_created_count : int option; (** Count of reports/abuses created by the user *) 14747 + video_comments_count : int option; (** Count of comments published *) 14748 + } 14749 + end 14750 + end 14751 + 12010 14752 module T = struct 12011 - type t = { 12012 - account : Account.T.t 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? *) 12023 - id : Id.T.t 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 *) 12052 - } 14753 + include Types.T 12053 14754 12054 14755 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 } 12055 14756 ··· 12143 14844 end 12144 14845 12145 14846 module User = struct 14847 + module Types = struct 14848 + module T = struct 14849 + type t = { 14850 + account : Account.T.t option; 14851 + admin_flags : UserAdminFlags.T.t option; 14852 + auto_play_next_video : bool option; (** Automatically start playing the upcoming video after the currently playing video *) 14853 + auto_play_next_video_playlist : bool option; (** Automatically start playing the video on the playlist after the currently playing video *) 14854 + auto_play_video : bool option; (** Automatically start playing the video on the watch page *) 14855 + blocked : bool option; 14856 + blocked_reason : string option; 14857 + created_at : string option; 14858 + email : string option; (** The user email *) 14859 + email_public : bool option; (** Has the user accepted to display the email publicly? *) 14860 + email_verified : bool option; (** Has the user confirmed their email address? *) 14861 + id : Id.T.t option; 14862 + language : string option; (** default language for this user *) 14863 + last_login_date : Ptime.t option; 14864 + new_features_info_read : float option; (** New features information the user has read *) 14865 + no_account_setup_warning_modal : bool option; 14866 + no_instance_config_warning_modal : bool option; 14867 + no_welcome_modal : bool option; 14868 + notification_settings : UserNotificationSettings.T.t option; 14869 + nsfw_flags_blurred : Nsfwflag.T.t option; 14870 + nsfw_flags_displayed : Nsfwflag.T.t option; 14871 + nsfw_flags_hidden : Nsfwflag.T.t option; 14872 + nsfw_flags_warned : Nsfwflag.T.t option; 14873 + nsfw_policy : Nsfwpolicy.T.t option; 14874 + p2p_enabled : bool option; (** whether to enable P2P in the player or not *) 14875 + plugin_auth : string option; (** Auth plugin to use to authenticate the user *) 14876 + role : Jsont.json option; 14877 + theme : string option; (** Theme enabled by this user *) 14878 + two_factor_enabled : bool option; (** Whether the user has enabled two-factor authentication or not *) 14879 + username : Username.T.t option; 14880 + video_channels : VideoChannel.T.t list option; 14881 + video_languages : string list option; (** list of languages to filter videos down to *) 14882 + video_quota : int option; (** The user video quota in bytes *) 14883 + video_quota_daily : int option; (** The user daily video quota in bytes *) 14884 + videos_history_enabled : bool option; (** whether to keep track of watched history or not *) 14885 + } 14886 + end 14887 + end 14888 + 12146 14889 module T = struct 12147 - type t = { 12148 - account : Account.T.t option; 12149 - admin_flags : UserAdminFlags.T.t option; 12150 - auto_play_next_video : bool option; (** Automatically start playing the upcoming video after the currently playing video *) 12151 - auto_play_next_video_playlist : bool option; (** Automatically start playing the video on the playlist after the currently playing video *) 12152 - auto_play_video : bool option; (** Automatically start playing the video on the watch page *) 12153 - blocked : bool option; 12154 - blocked_reason : string option; 12155 - created_at : string option; 12156 - email : string option; (** The user email *) 12157 - email_public : bool option; (** Has the user accepted to display the email publicly? *) 12158 - email_verified : bool option; (** Has the user confirmed their email address? *) 12159 - id : Id.T.t option; 12160 - language : string option; (** default language for this user *) 12161 - last_login_date : Ptime.t option; 12162 - new_features_info_read : float option; (** New features information the user has read *) 12163 - no_account_setup_warning_modal : bool option; 12164 - no_instance_config_warning_modal : bool option; 12165 - no_welcome_modal : bool option; 12166 - notification_settings : UserNotificationSettings.T.t option; 12167 - nsfw_flags_blurred : Nsfwflag.T.t option; 12168 - nsfw_flags_displayed : Nsfwflag.T.t option; 12169 - nsfw_flags_hidden : Nsfwflag.T.t option; 12170 - nsfw_flags_warned : Nsfwflag.T.t option; 12171 - nsfw_policy : Nsfwpolicy.T.t option; 12172 - p2p_enabled : bool option; (** whether to enable P2P in the player or not *) 12173 - plugin_auth : string option; (** Auth plugin to use to authenticate the user *) 12174 - role : Jsont.json option; 12175 - theme : string option; (** Theme enabled by this user *) 12176 - two_factor_enabled : bool option; (** Whether the user has enabled two-factor authentication or not *) 12177 - username : Username.T.t option; 12178 - video_channels : VideoChannel.T.t list option; 12179 - video_languages : string list option; (** list of languages to filter videos down to *) 12180 - video_quota : int option; (** The user video quota in bytes *) 12181 - video_quota_daily : int option; (** The user daily video quota in bytes *) 12182 - videos_history_enabled : bool option; (** whether to keep track of watched history or not *) 12183 - } 14890 + include Types.T 12184 14891 12185 14892 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 () = { 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 } 12186 14893 ··· 12283 14990 if Requests.Response.ok response then 12284 14991 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 12285 14992 else 14993 + let body = Requests.Response.text response in 14994 + let parsed_body = 14995 + match Jsont_bytesrw.decode_string Jsont.json body with 14996 + | Ok json -> Some (Openapi.Runtime.Json json) 14997 + | Error _ -> Some (Openapi.Runtime.Raw body) 14998 + in 12286 14999 raise (Openapi.Runtime.Api_error { 12287 15000 operation = op_name; 12288 15001 method_ = "GET"; 12289 15002 url; 12290 15003 status = Requests.Response.status_code response; 12291 - body = Requests.Response.text response; 15004 + body; 15005 + parsed_body; 12292 15006 }) 12293 15007 12294 15008 (** Get my user information *) ··· 12306 15020 if Requests.Response.ok response then 12307 15021 Openapi.Runtime.Json.decode_json_exn T.jsont (Requests.Response.json response) 12308 15022 else 15023 + let body = Requests.Response.text response in 15024 + let parsed_body = 15025 + match Jsont_bytesrw.decode_string Jsont.json body with 15026 + | Ok json -> Some (Openapi.Runtime.Json json) 15027 + | Error _ -> Some (Openapi.Runtime.Raw body) 15028 + in 12309 15029 raise (Openapi.Runtime.Api_error { 12310 15030 operation = op_name; 12311 15031 method_ = "GET"; 12312 15032 url; 12313 15033 status = Requests.Response.status_code response; 12314 - body = Requests.Response.text response; 15034 + body; 15035 + parsed_body; 12315 15036 }) 12316 15037 end 12317 15038 12318 15039 module AbuseStateSet = struct 15040 + module Types = struct 15041 + module T = struct 15042 + (** The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`) *) 15043 + type t = string 15044 + end 15045 + end 15046 + 12319 15047 module T = struct 12320 - (** The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`) *) 12321 - type t = string 12322 - 15048 + include Types.T 12323 15049 let jsont = Jsont.string 12324 15050 end 12325 15051 end 12326 15052 12327 15053 module AbuseStateConstant = struct 15054 + module Types = struct 15055 + module T = struct 15056 + type t = { 15057 + id : AbuseStateSet.T.t option; 15058 + label : string option; 15059 + } 15060 + end 15061 + end 15062 + 12328 15063 module T = struct 12329 - type t = { 12330 - id : AbuseStateSet.T.t option; 12331 - label : string option; 12332 - } 15064 + include Types.T 12333 15065 12334 15066 let v ?id ?label () = { id; label } 12335 15067 ··· 12347 15079 end 12348 15080 12349 15081 module AbusePredefinedReasons = struct 15082 + module Types = struct 15083 + module T = struct 15084 + type t = Jsont.json 15085 + end 15086 + end 15087 + 12350 15088 module T = struct 12351 - type t = Jsont.json 12352 - 15089 + include Types.T 12353 15090 let jsont = Jsont.json 12354 - 12355 15091 let v () = Jsont.Null ((), Jsont.Meta.none) 12356 15092 end 12357 15093 end 12358 15094 12359 15095 module Abuse = struct 15096 + module Types = struct 15097 + module T = struct 15098 + type t = { 15099 + created_at : Ptime.t option; 15100 + id : Id.T.t option; 15101 + moderation_comment : string option; 15102 + predefined_reasons : AbusePredefinedReasons.T.t option; 15103 + reason : string option; 15104 + reporter_account : Account.T.t option; 15105 + state : AbuseStateConstant.T.t option; 15106 + video : Jsont.json option; 15107 + } 15108 + end 15109 + end 15110 + 12360 15111 module T = struct 12361 - type t = { 12362 - created_at : Ptime.t option; 12363 - id : Id.T.t option; 12364 - moderation_comment : string option; 12365 - predefined_reasons : AbusePredefinedReasons.T.t option; 12366 - reason : string option; 12367 - reporter_account : Account.T.t option; 12368 - state : AbuseStateConstant.T.t option; 12369 - video : Jsont.json option; 12370 - } 15112 + include Types.T 12371 15113 12372 15114 let v ?created_at ?id ?moderation_comment ?predefined_reasons ?reason ?reporter_account ?state ?video () = { created_at; id; moderation_comment; predefined_reasons; reason; reporter_account; state; video } 12373 15115 ··· 12385 15127 (fun created_at id moderation_comment predefined_reasons reason reporter_account state video -> { created_at; id; moderation_comment; predefined_reasons; reason; reporter_account; state; video }) 12386 15128 |> Jsont.Object.opt_mem "createdAt" Openapi.Runtime.ptime_jsont ~enc:(fun r -> r.created_at) 12387 15129 |> Jsont.Object.opt_mem "id" Id.T.jsont ~enc:(fun r -> r.id) 12388 - |> Jsont.Object.opt_mem "moderationComment" Jsont.string ~enc:(fun r -> r.moderation_comment) 15130 + |> Jsont.Object.opt_mem "moderationComment" (Openapi.Runtime.validated_string ~min_length:2 ~max_length:3000 Jsont.string) ~enc:(fun r -> r.moderation_comment) 12389 15131 |> Jsont.Object.opt_mem "predefinedReasons" AbusePredefinedReasons.T.jsont ~enc:(fun r -> r.predefined_reasons) 12390 - |> Jsont.Object.opt_mem "reason" Jsont.string ~enc:(fun r -> r.reason) 15132 + |> Jsont.Object.opt_mem "reason" (Openapi.Runtime.validated_string ~min_length:2 ~max_length:3000 Jsont.string) ~enc:(fun r -> r.reason) 12391 15133 |> Jsont.Object.opt_mem "reporterAccount" Account.T.jsont ~enc:(fun r -> r.reporter_account) 12392 15134 |> Jsont.Object.opt_mem "state" AbuseStateConstant.T.jsont ~enc:(fun r -> r.state) 12393 15135 |> Jsont.Object.opt_mem "video" Jsont.json ~enc:(fun r -> r.video)
+21 -21
peertube.mli peer_tube.mli
··· 1 - (** {1 Peertube} 1 + (** {1 PeerTube} 2 2 3 3 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite 4 4 HTTP/REST library for your programming language to use PeerTube. ··· 147 147 148 148 module VideosForXml : sig 149 149 module T : sig 150 - type t 150 + type t = Jsont.json 151 151 152 152 val jsont : t Jsont.t 153 153 ··· 212 212 213 213 module VideoStudioCreateTask : sig 214 214 module T : sig 215 - type t 215 + type t = Jsont.json 216 216 217 217 val jsont : t Jsont.t 218 218 ··· 424 424 425 425 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. 426 426 *) 427 - type t 427 + type t = Jsont.json 428 428 429 429 val jsont : t Jsont.t 430 430 ··· 619 619 module VideoLicenceSet : sig 620 620 module T : sig 621 621 (** licence id of the video (see [/videos/licences](#operation/getLicences)) *) 622 - type t 622 + type t = Jsont.json 623 623 624 624 val jsont : t Jsont.t 625 625 ··· 645 645 module VideoLanguageSet : sig 646 646 module T : sig 647 647 (** language id of the video (see [/videos/languages](#operation/getLanguages)) *) 648 - type t 648 + type t = Jsont.json 649 649 650 650 val jsont : t Jsont.t 651 651 ··· 740 740 741 741 module VideoCommentsForXml : sig 742 742 module T : sig 743 - type t 743 + type t = Jsont.json 744 744 745 745 val jsont : t Jsont.t 746 746 ··· 843 843 module VideoCategorySet : sig 844 844 module T : sig 845 845 (** category id of the video (see [/videos/categories](#operation/getCategories)) *) 846 - type t 846 + type t = Jsont.json 847 847 848 848 val jsont : t Jsont.t 849 849 ··· 868 868 869 869 module Uuidv4 : sig 870 870 module T : sig 871 - type t 871 + type t = Jsont.json 872 872 873 873 val jsont : t Jsont.t 874 874 ··· 879 879 module UsernameChannel : sig 880 880 module T : sig 881 881 (** immutable name of the channel, used to interact with its actor *) 882 - type t 882 + type t = Jsont.json 883 883 884 884 val jsont : t Jsont.t 885 885 ··· 890 890 module Username : sig 891 891 module T : sig 892 892 (** immutable name of the user, used to find or mention its actor *) 893 - type t 893 + type t = Jsont.json 894 894 895 895 val jsont : t Jsont.t 896 896 ··· 1051 1051 module ShortUuid : sig 1052 1052 module T : sig 1053 1053 (** translation of a uuid v4 with a bigger alphabet to have a shorter uuid *) 1054 - type t 1054 + type t = Jsont.json 1055 1055 1056 1056 val jsont : t Jsont.t 1057 1057 ··· 1395 1395 1396 1396 module RunnerJobPayload : sig 1397 1397 module T : sig 1398 - type t 1398 + type t = Jsont.json 1399 1399 1400 1400 val jsont : t Jsont.t 1401 1401 ··· 1568 1568 module PredefinedAbuseReasons : sig 1569 1569 module T : sig 1570 1570 (** Reason categories that help triage reports *) 1571 - type t 1571 + type t = Jsont.json 1572 1572 1573 1573 val jsont : t Jsont.t 1574 1574 ··· 1836 1836 1837 1837 module Password : sig 1838 1838 module T : sig 1839 - type t 1839 + type t = Jsont.json 1840 1840 1841 1841 val jsont : t Jsont.t 1842 1842 ··· 2130 2130 - `1` WEB 2131 2131 - `2` EMAIL 2132 2132 *) 2133 - type t 2133 + type t = Jsont.json 2134 2134 2135 2135 val jsont : t Jsont.t 2136 2136 ··· 2398 2398 2399 2399 module Id : sig 2400 2400 module T : sig 2401 - type t 2401 + type t = Jsont.json 2402 2402 2403 2403 val jsont : t Jsont.t 2404 2404 ··· 2938 2938 2939 2939 module AddVideoPasswords : sig 2940 2940 module T : sig 2941 - type t 2941 + type t = Jsont.json 2942 2942 2943 2943 val jsont : t Jsont.t 2944 2944 ··· 4237 4237 (** Construct a value 4238 4238 @param text Text of the comment 4239 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 4240 + val v : ?deleted_at:Ptime.t option -> ?is_deleted:bool -> ?account:Account.T.t -> ?created_at:Ptime.t -> ?held_for_review:bool -> ?id:Id.T.t -> ?in_reply_to_comment_id:Id.T.t -> ?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 4241 4242 4242 val account : t -> Account.T.t option 4243 4243 ··· 4251 4251 4252 4252 val in_reply_to_comment_id : t -> Id.T.t option 4253 4253 4254 - val is_deleted : t -> bool option 4254 + val is_deleted : t -> bool 4255 4255 4256 4256 (** Text of the comment *) 4257 4257 val text : t -> string option ··· 6237 6237 6238 6238 module AbusePredefinedReasons : sig 6239 6239 module T : sig 6240 - type t 6240 + type t = Jsont.json 6241 6241 6242 6242 val jsont : t Jsont.t 6243 6243